On 2018/11/28 上午3:53, 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>
Reviewed-by: Qu Wenruo <w...@suse.com> Thanks, Qu > --- > 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, > + BTRFS_READ_LOCK, > + BTRFS_WRITE_LOCK_BLOCKING, > + BTRFS_READ_LOCK_BLOCKING, > +}; > > void btrfs_tree_lock(struct extent_buffer *eb); > void btrfs_tree_unlock(struct extent_buffer *eb); >
signature.asc
Description: OpenPGP digital signature