block: move block-related definitions out of fs.h
Move most of the block related definition out of fs.h into more suitable headers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:

committed by
Jens Axboe

parent
dd0dca223e
commit
3f1266f1f8
@@ -2563,79 +2563,10 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
|
||||
return IS_ENABLED(CONFIG_BLOCK) && sb == blockdev_superblock;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int register_blkdev(unsigned int, const char *);
|
||||
extern void unregister_blkdev(unsigned int, const char *);
|
||||
extern struct block_device *bdget(dev_t);
|
||||
extern struct block_device *bdgrab(struct block_device *bdev);
|
||||
extern void bd_set_size(struct block_device *, loff_t size);
|
||||
extern void bd_forget(struct inode *inode);
|
||||
extern void bdput(struct block_device *);
|
||||
extern void invalidate_bdev(struct block_device *);
|
||||
extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
|
||||
extern int sync_blockdev(struct block_device *bdev);
|
||||
extern struct super_block *freeze_bdev(struct block_device *);
|
||||
extern void emergency_thaw_bdev(struct super_block *sb);
|
||||
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
|
||||
extern int fsync_bdev(struct block_device *);
|
||||
#else
|
||||
static inline void bd_forget(struct inode *inode) {}
|
||||
static inline int sync_blockdev(struct block_device *bdev) { return 0; }
|
||||
static inline void invalidate_bdev(struct block_device *bdev) {}
|
||||
|
||||
static inline struct super_block *freeze_bdev(struct block_device *sb)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int emergency_thaw_bdev(struct super_block *sb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
void emergency_thaw_all(void);
|
||||
extern int sync_filesystem(struct super_block *);
|
||||
extern const struct file_operations def_blk_fops;
|
||||
extern const struct file_operations def_chr_fops;
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int blkdev_ioctl(struct block_device *, fmode_t, unsigned, unsigned long);
|
||||
extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
|
||||
extern int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder);
|
||||
extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
|
||||
void *holder);
|
||||
extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
|
||||
void *holder);
|
||||
extern struct block_device *bd_start_claiming(struct block_device *bdev,
|
||||
void *holder);
|
||||
extern void bd_abort_claiming(struct block_device *bdev,
|
||||
struct block_device *whole, void *holder);
|
||||
extern void blkdev_put(struct block_device *bdev, fmode_t mode);
|
||||
|
||||
#ifdef CONFIG_SYSFS
|
||||
extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
|
||||
extern void bd_unlink_disk_holder(struct block_device *bdev,
|
||||
struct gendisk *disk);
|
||||
#else
|
||||
static inline int bd_link_disk_holder(struct block_device *bdev,
|
||||
struct gendisk *disk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void bd_unlink_disk_holder(struct block_device *bdev,
|
||||
struct gendisk *disk)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* fs/char_dev.c */
|
||||
#define CHRDEV_MAJOR_MAX 512
|
||||
@@ -2666,31 +2597,12 @@ static inline void unregister_chrdev(unsigned int major, const char *name)
|
||||
__unregister_chrdev(major, 0, 256, name);
|
||||
}
|
||||
|
||||
/* fs/block_dev.c */
|
||||
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
|
||||
#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
#define BLKDEV_MAJOR_MAX 512
|
||||
extern const char *bdevname(struct block_device *bdev, char *buffer);
|
||||
extern struct block_device *lookup_bdev(const char *);
|
||||
extern void blkdev_show(struct seq_file *,off_t);
|
||||
|
||||
#else
|
||||
#define BLKDEV_MAJOR_MAX 0
|
||||
#endif
|
||||
|
||||
extern void init_special_inode(struct inode *, umode_t, dev_t);
|
||||
|
||||
/* Invalid inode operations -- fs/bad_inode.c */
|
||||
extern void make_bad_inode(struct inode *);
|
||||
extern bool is_bad_inode(struct inode *);
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int revalidate_disk(struct gendisk *);
|
||||
extern int check_disk_change(struct block_device *);
|
||||
extern int __invalidate_device(struct block_device *, bool);
|
||||
#endif
|
||||
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end);
|
||||
|
||||
@@ -3090,10 +3002,6 @@ static inline void remove_inode_hash(struct inode *inode)
|
||||
|
||||
extern void inode_sb_list_add(struct inode *inode);
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int bdev_read_only(struct block_device *);
|
||||
#endif
|
||||
extern int set_blocksize(struct block_device *, int);
|
||||
extern int sb_set_blocksize(struct super_block *, int);
|
||||
extern int sb_min_blocksize(struct super_block *, int);
|
||||
|
||||
|
Reference in New Issue
Block a user