summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2022-09-09 18:27:45 +0300
committerDavid Sterba <dsterba@suse.com>2022-12-05 20:00:40 +0300
commitc7321b76dfcc8a1b8d7dad3eff3595bad28252e2 (patch)
tree1dddf9676ddca48c0fb2cb3741d632acf642c8b0
parentd549ff7bdbe72f5e0e934895090fed2647e9813b (diff)
downloadlinux-c7321b76dfcc8a1b8d7dad3eff3595bad28252e2.tar.xz
btrfs: convert BTRFS_ILOCK-* defines to enum bit
Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/ctree.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index c0c0dc8fa99f..5adf76d89f9b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -34,6 +34,7 @@
#include "async-thread.h"
#include "block-rsv.h"
#include "locking.h"
+#include "misc.h"
struct btrfs_trans_handle;
struct btrfs_transaction;
@@ -3131,9 +3132,11 @@ struct iomap_dio *btrfs_dio_write(struct kiocb *iocb, struct iov_iter *iter,
extern const struct dentry_operations btrfs_dentry_operations;
/* Inode locking type flags, by default the exclusive lock is taken */
-#define BTRFS_ILOCK_SHARED (1U << 0)
-#define BTRFS_ILOCK_TRY (1U << 1)
-#define BTRFS_ILOCK_MMAP (1U << 2)
+enum btrfs_ilock_type {
+ ENUM_BIT(BTRFS_ILOCK_SHARED),
+ ENUM_BIT(BTRFS_ILOCK_TRY),
+ ENUM_BIT(BTRFS_ILOCK_MMAP),
+};
int btrfs_inode_lock(struct inode *inode, unsigned int ilock_flags);
void btrfs_inode_unlock(struct inode *inode, unsigned int ilock_flags);