On Tue, Nov 27, 2018 at 04:37:16PM -0800, Omar Sandoval wrote: > On Tue, Nov 27, 2018 at 08:53:55PM +0100, David Sterba wrote: > > We can use simple enum for values that are not part of on-disk format: > > tree lock types. > > > > Signed-off-by: David Sterba <dste...@suse.com> > > --- > > fs/btrfs/locking.h | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h > > index 29135def468e..684d0ef4faa4 100644 > > --- a/fs/btrfs/locking.h > > +++ b/fs/btrfs/locking.h > > @@ -6,10 +6,12 @@ > > #ifndef BTRFS_LOCKING_H > > #define BTRFS_LOCKING_H > > > > -#define BTRFS_WRITE_LOCK 1 > > -#define BTRFS_READ_LOCK 2 > > -#define BTRFS_WRITE_LOCK_BLOCKING 3 > > -#define BTRFS_READ_LOCK_BLOCKING 4 > > +enum { > > + BTRFS_WRITE_LOCK, > > See btrfs_set_path_blocking() and btrfs_release_path(); 0 means no lock, > so this needs to be BTRFS_WRITE_LOCK = 1. I imagine that lockdep would > catch this.
Oh right of course, thanks for catching it. I'll drop the patch for now, 0 could be added to the set as BTRFS_NO_LOCK and replaced in the code which is beyond what this series does.