Re: [RFCv3 2/4] ext4: Add ext4_ilock & ext4_iunlock API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Probably worth adding inode_lock_downgrade() to fs.h instead of
accessing i_rwsem directly.



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux