Skip to content

Commit

Permalink
btrfs: convert BTRFS_ILOCK-* defines to enum bit
Browse files Browse the repository at this point in the history
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Dec 5, 2022
1 parent d549ff7 commit c7321b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c7321b7

Please sign in to comment.