On 11/20/19 10:05 PM, Matthew Wilcox wrote:
On Wed, Nov 20, 2019 at 05:48:30PM +0530, Ritesh Harjani wrote:
Not against your suggestion here.
But in kernel I do see a preference towards object followed by a verb.
At least in vfs I see functions like inode_lock()/unlock().
Plus I would not deny that this naming is also inspired from
xfs_ilock()/iunlock API names.
I see those names as being "classical Unix" heritage (eh, maybe SysV).
hmm, it was increasing the name of the macro if I do it that way.
But that's ok. Is below macro name better?
#define EXT4_INODE_IOLOCK_EXCL (1 << 0)
#define EXT4_INODE_IOLOCK_SHARED (1 << 1)
In particular, Linux tends to prefer read/write instead of
shared/exclusive terminology. rwlocks, rwsems, rcu_read_lock, seqlocks.
shared/exclusive is used by file locks. And XFS ;-)
I agree with Jan; just leave them opencoded.
Sure.
Probably worth adding inode_lock_downgrade() to fs.h instead of
accessing i_rwsem directly.
Yup, make sense. but since this series is independent of that change,
let me add that as a separate patch after this series.
Thanks for the review!!
-ritesh