lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191120163500.GT20752@bombadil.infradead.org>
Date:   Wed, 20 Nov 2019 08:35:00 -0800
From:   Matthew Wilcox <willy@...radead.org>
To:     Ritesh Harjani <riteshh@...ux.ibm.com>
Cc:     Matthew Bobrowski <mbobrowski@...browski.org>, jack@...e.cz,
        tytso@....edu, linux-ext4@...r.kernel.org,
        linux-fsdevel@...r.kernel.org
Subject: Re: [RFCv3 2/4] ext4: Add ext4_ilock & ext4_iunlock API

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ