diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-03 16:47:22 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-03 17:34:02 -0400 |
commit | 5639fb38cabaa326b8b664d874a46509d4a60bf2 (patch) | |
tree | 3f3aa73ebc9505bede820ce02d7e8a9bad7dfa08 /include/linux/blkdev.h | |
parent | 9f4ed5ce05888b62d1e4417323c553e5d06f4abf (diff) |
Update bcachefs sources to 09d4c2acbf4c bcachefs: reconstruct_inode()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 998f5e2c..1d825a70 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -23,27 +23,6 @@ struct user_namespace; #define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) #define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) -typedef unsigned int __bitwise blk_mode_t; - -/* open for reading */ -#define BLK_OPEN_READ ((__force blk_mode_t)(1 << 0)) -/* open for writing */ -#define BLK_OPEN_WRITE ((__force blk_mode_t)(1 << 1)) -/* open exclusively (vs other exclusive openers */ -#define BLK_OPEN_EXCL ((__force blk_mode_t)(1 << 2)) -/* opened with O_NDELAY */ -#define BLK_OPEN_NDELAY ((__force blk_mode_t)(1 << 3)) -/* open for "writes" only for ioctls (specialy hack for floppy.c) */ -#define BLK_OPEN_WRITE_IOCTL ((__force blk_mode_t)(1 << 4)) - -#define BLK_OPEN_BUFFERED ((__force blk_mode_t)(1 << 5)) - -struct inode { - unsigned long i_ino; - loff_t i_size; - struct super_block *i_sb; -}; - struct file { struct inode *f_inode; }; @@ -89,15 +68,14 @@ struct blk_holder_ops { void (*mark_dead)(struct block_device *bdev); }; -struct bdev_handle { - struct block_device *bdev; - void *holder; - blk_mode_t mode; -}; +static inline struct block_device *file_bdev(struct file *file) +{ + return container_of(file->f_inode, struct block_device, __bd_inode); +} -void bdev_release(struct bdev_handle *); -struct bdev_handle *bdev_open_by_path(const char *, blk_mode_t, void *, - const struct blk_holder_ops *); +void fput(struct file *); +struct file *bdev_file_open_by_path(const char *, blk_mode_t, void *, + const struct blk_holder_ops *); int lookup_bdev(const char *path, dev_t *); struct super_block { |