#include <linux/init.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/major.h>
#include <linux/device_cgroup.h>
#include <linux/blkdev.h>
#include <linux/blk-integrity.h>
#include <linux/backing-dev.h>
#include <linux/module.h>
#include <linux/blkpg.h>
#include <linux/magic.h>
#include <linux/buffer_head.h>
#include <linux/swap.h>
#include <linux/writeback.h>
#include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <linux/uio.h>
#include <linux/namei.h>
#include <linux/part_stat.h>
#include <linux/uaccess.h>
#include <linux/stat.h>
#include "../fs/internal.h"
#include "blk.h"
static bool bdev_allow_write_mounted = … IS_ENABLED(…);
struct bdev_inode { … };
static inline struct bdev_inode *BDEV_I(struct inode *inode)
{ … }
static inline struct inode *BD_INODE(struct block_device *bdev)
{ … }
struct block_device *I_BDEV(struct inode *inode)
{ … }
EXPORT_SYMBOL(…);
struct block_device *file_bdev(struct file *bdev_file)
{ … }
EXPORT_SYMBOL(…);
static void bdev_write_inode(struct block_device *bdev)
{ … }
static void kill_bdev(struct block_device *bdev)
{ … }
void invalidate_bdev(struct block_device *bdev)
{ … }
EXPORT_SYMBOL(…);
int truncate_bdev_range(struct block_device *bdev, blk_mode_t mode,
loff_t lstart, loff_t lend)
{ … }
static void set_init_blocksize(struct block_device *bdev)
{ … }
int set_blocksize(struct file *file, int size)
{ … }
EXPORT_SYMBOL(…);
int sb_set_blocksize(struct super_block *sb, int size)
{ … }
EXPORT_SYMBOL(…);
int sb_min_blocksize(struct super_block *sb, int size)
{ … }
EXPORT_SYMBOL(…);
int sync_blockdev_nowait(struct block_device *bdev)
{ … }
EXPORT_SYMBOL_GPL(…);
int sync_blockdev(struct block_device *bdev)
{ … }
EXPORT_SYMBOL(…);
int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend)
{ … }
EXPORT_SYMBOL(…);
int bdev_freeze(struct block_device *bdev)
{ … }
EXPORT_SYMBOL(…);
int bdev_thaw(struct block_device *bdev)
{ … }
EXPORT_SYMBOL(…);
static __cacheline_aligned_in_smp DEFINE_MUTEX(bdev_lock);
static struct kmem_cache *bdev_cachep __ro_after_init;
static struct inode *bdev_alloc_inode(struct super_block *sb)
{ … }
static void bdev_free_inode(struct inode *inode)
{ … }
static void init_once(void *data)
{ … }
static void bdev_evict_inode(struct inode *inode)
{ … }
static const struct super_operations bdev_sops = …;
static int bd_init_fs_context(struct fs_context *fc)
{ … }
static struct file_system_type bd_type = …;
struct super_block *blockdev_superblock __ro_after_init;
static struct vfsmount *blockdev_mnt __ro_after_init;
EXPORT_SYMBOL_GPL(…);
void __init bdev_cache_init(void)
{ … }
struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
{ … }
void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors)
{ … }
void bdev_add(struct block_device *bdev, dev_t dev)
{ … }
void bdev_unhash(struct block_device *bdev)
{ … }
void bdev_drop(struct block_device *bdev)
{ … }
long nr_blockdev_pages(void)
{ … }
static bool bd_may_claim(struct block_device *bdev, void *holder,
const struct blk_holder_ops *hops)
{ … }
int bd_prepare_to_claim(struct block_device *bdev, void *holder,
const struct blk_holder_ops *hops)
{ … }
EXPORT_SYMBOL_GPL(…);
static void bd_clear_claiming(struct block_device *whole, void *holder)
{ … }
static void bd_finish_claiming(struct block_device *bdev, void *holder,
const struct blk_holder_ops *hops)
{ … }
void bd_abort_claiming(struct block_device *bdev, void *holder)
{ … }
EXPORT_SYMBOL(…);
static void bd_end_claim(struct block_device *bdev, void *holder)
{ … }
static void blkdev_flush_mapping(struct block_device *bdev)
{ … }
static void blkdev_put_whole(struct block_device *bdev)
{ … }
static int blkdev_get_whole(struct block_device *bdev, blk_mode_t mode)
{ … }
static int blkdev_get_part(struct block_device *part, blk_mode_t mode)
{ … }
int bdev_permission(dev_t dev, blk_mode_t mode, void *holder)
{ … }
static void blkdev_put_part(struct block_device *part)
{ … }
struct block_device *blkdev_get_no_open(dev_t dev)
{ … }
void blkdev_put_no_open(struct block_device *bdev)
{ … }
static bool bdev_writes_blocked(struct block_device *bdev)
{ … }
static void bdev_block_writes(struct block_device *bdev)
{ … }
static void bdev_unblock_writes(struct block_device *bdev)
{ … }
static bool bdev_may_open(struct block_device *bdev, blk_mode_t mode)
{ … }
static void bdev_claim_write_access(struct block_device *bdev, blk_mode_t mode)
{ … }
static inline bool bdev_unclaimed(const struct file *bdev_file)
{ … }
static void bdev_yield_write_access(struct file *bdev_file)
{ … }
int bdev_open(struct block_device *bdev, blk_mode_t mode, void *holder,
const struct blk_holder_ops *hops, struct file *bdev_file)
{ … }
static unsigned blk_to_file_flags(blk_mode_t mode)
{ … }
struct file *bdev_file_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
const struct blk_holder_ops *hops)
{ … }
EXPORT_SYMBOL(…);
struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
void *holder,
const struct blk_holder_ops *hops)
{ … }
EXPORT_SYMBOL(…);
static inline void bd_yield_claim(struct file *bdev_file)
{ … }
void bdev_release(struct file *bdev_file)
{ … }
void bdev_fput(struct file *bdev_file)
{ … }
EXPORT_SYMBOL(…);
int lookup_bdev(const char *pathname, dev_t *dev)
{ … }
EXPORT_SYMBOL(…);
void bdev_mark_dead(struct block_device *bdev, bool surprise)
{ … }
EXPORT_SYMBOL_GPL(…);
void sync_bdevs(bool wait)
{ … }
void bdev_statx(struct path *path, struct kstat *stat,
u32 request_mask)
{ … }
bool disk_live(struct gendisk *disk)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int block_size(struct block_device *bdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init setup_bdev_allow_write_mounted(char *str)
{ … }
__setup(…);