mirror of https://gitee.com/openkylin/linux.git
new helper: mount_bdev()
... and switch of the obvious get_sb_bdev() users to ->mount() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
c96e41e92b
commit
152a083666
|
@ -490,17 +490,16 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int adfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *adfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type adfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "adfs",
|
||||
.get_sb = adfs_get_sb,
|
||||
.mount = adfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -573,17 +573,16 @@ affs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int affs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *affs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type affs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "affs",
|
||||
.get_sb = affs_get_sb,
|
||||
.mount = affs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -913,18 +913,17 @@ befs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
static struct dentry *
|
||||
befs_mount(struct file_system_type *fs_type, int flags, const char *dev_name,
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, befs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type befs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "befs",
|
||||
.get_sb = befs_get_sb,
|
||||
.mount = befs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -450,16 +450,16 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int bfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *bfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, bfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type bfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "bfs",
|
||||
.get_sb = bfs_get_sb,
|
||||
.mount = bfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -533,17 +533,16 @@ static const struct super_operations cramfs_ops = {
|
|||
.statfs = cramfs_statfs,
|
||||
};
|
||||
|
||||
static int cramfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *cramfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, cramfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type cramfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "cramfs",
|
||||
.get_sb = cramfs_get_sb,
|
||||
.mount = cramfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -20,16 +20,16 @@
|
|||
static int efs_statfs(struct dentry *dentry, struct kstatfs *buf);
|
||||
static int efs_fill_super(struct super_block *s, void *d, int silent);
|
||||
|
||||
static int efs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *efs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type efs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "efs",
|
||||
.get_sb = efs_get_sb,
|
||||
.mount = efs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1356,10 +1356,10 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ext2_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *ext2_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_QUOTA
|
||||
|
@ -1473,7 +1473,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
|
|||
static struct file_system_type ext2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ext2",
|
||||
.get_sb = ext2_get_sb,
|
||||
.mount = ext2_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -3020,16 +3020,16 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
|
|||
|
||||
#endif
|
||||
|
||||
static int ext3_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *ext3_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ext3_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type ext3_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ext3",
|
||||
.get_sb = ext3_get_sb,
|
||||
.mount = ext3_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -73,8 +73,8 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
|
|||
static int ext4_unfreeze(struct super_block *sb);
|
||||
static void ext4_write_super(struct super_block *sb);
|
||||
static int ext4_freeze(struct super_block *sb);
|
||||
static int ext4_get_sb(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data, struct vfsmount *mnt);
|
||||
static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data);
|
||||
static void ext4_destroy_lazyinit_thread(void);
|
||||
static void ext4_unregister_li_request(struct super_block *sb);
|
||||
|
||||
|
@ -82,7 +82,7 @@ static void ext4_unregister_li_request(struct super_block *sb);
|
|||
static struct file_system_type ext3_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ext3",
|
||||
.get_sb = ext4_get_sb,
|
||||
.mount = ext4_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
@ -4667,17 +4667,17 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
|
|||
|
||||
#endif
|
||||
|
||||
static int ext4_get_sb(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ext4_fill_super);
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||
static struct file_system_type ext2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ext2",
|
||||
.get_sb = ext4_get_sb,
|
||||
.mount = ext4_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
@ -4722,7 +4722,7 @@ static inline void unregister_as_ext3(void) { }
|
|||
static struct file_system_type ext4_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ext4",
|
||||
.get_sb = ext4_get_sb,
|
||||
.mount = ext4_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -675,18 +675,17 @@ static int msdos_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int msdos_get_sb(struct file_system_type *fs_type,
|
||||
static struct dentry *msdos_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, msdos_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type msdos_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "msdos",
|
||||
.get_sb = msdos_get_sb,
|
||||
.mount = msdos_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1071,18 +1071,17 @@ static int vfat_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int vfat_get_sb(struct file_system_type *fs_type,
|
||||
static struct dentry *vfat_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, vfat_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, vfat_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type vfat_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "vfat",
|
||||
.get_sb = vfat_get_sb,
|
||||
.mount = vfat_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -246,17 +246,16 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
|
|||
/*
|
||||
* The usual module blurb.
|
||||
*/
|
||||
static int vxfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *vxfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type vxfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "vxfs",
|
||||
.get_sb = vxfs_get_sb,
|
||||
.mount = vxfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1070,12 +1070,11 @@ static struct file_system_type fuse_fs_type = {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
static int fuse_get_sb_blk(struct file_system_type *fs_type,
|
||||
static struct dentry *fuse_mount_blk(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name,
|
||||
void *raw_data, struct vfsmount *mnt)
|
||||
void *raw_data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super);
|
||||
}
|
||||
|
||||
static void fuse_kill_sb_blk(struct super_block *sb)
|
||||
|
@ -1094,7 +1093,7 @@ static void fuse_kill_sb_blk(struct super_block *sb)
|
|||
static struct file_system_type fuseblk_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "fuseblk",
|
||||
.get_sb = fuse_get_sb_blk,
|
||||
.mount = fuse_mount_blk,
|
||||
.kill_sb = fuse_kill_sb_blk,
|
||||
.fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
|
||||
};
|
||||
|
|
|
@ -441,17 +441,16 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return res;
|
||||
}
|
||||
|
||||
static int hfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
static struct dentry *hfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, hfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type hfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "hfs",
|
||||
.get_sb = hfs_get_sb,
|
||||
.mount = hfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -495,18 +495,16 @@ static void hfsplus_destroy_inode(struct inode *inode)
|
|||
|
||||
#define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info)
|
||||
|
||||
static int hfsplus_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
static struct dentry *hfsplus_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type hfsplus_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "hfsplus",
|
||||
.get_sb = hfsplus_get_sb,
|
||||
.mount = hfsplus_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -686,17 +686,16 @@ bail2: brelse(bh0);
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int hpfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *hpfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type hpfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "hpfs",
|
||||
.get_sb = hpfs_get_sb,
|
||||
.mount = hpfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1507,17 +1507,16 @@ struct inode *isofs_iget(struct super_block *sb,
|
|||
return inode;
|
||||
}
|
||||
|
||||
static int isofs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *isofs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type iso9660_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "iso9660",
|
||||
.get_sb = isofs_get_sb,
|
||||
.mount = isofs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -583,11 +583,10 @@ static int jfs_unfreeze(struct super_block *sb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int jfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
|
||||
}
|
||||
|
||||
static int jfs_sync_fs(struct super_block *sb, int wait)
|
||||
|
@ -770,7 +769,7 @@ static const struct export_operations jfs_export_operations = {
|
|||
static struct file_system_type jfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "jfs",
|
||||
.get_sb = jfs_get_sb,
|
||||
.mount = jfs_do_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -614,17 +614,16 @@ void minix_truncate(struct inode * inode)
|
|||
V2_minix_truncate(inode);
|
||||
}
|
||||
|
||||
static int minix_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *minix_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, minix_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, minix_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type minix_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "minix",
|
||||
.get_sb = minix_get_sb,
|
||||
.mount = minix_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -3059,17 +3059,16 @@ struct kmem_cache *ntfs_index_ctx_cache;
|
|||
/* Driver wide mutex. */
|
||||
DEFINE_MUTEX(ntfs_lock);
|
||||
|
||||
static int ntfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *ntfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ntfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ntfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type ntfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ntfs",
|
||||
.get_sb = ntfs_get_sb,
|
||||
.mount = ntfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1236,14 +1236,12 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return status;
|
||||
}
|
||||
|
||||
static int ocfs2_get_sb(struct file_system_type *fs_type,
|
||||
static struct dentry *ocfs2_mount(struct file_system_type *fs_type,
|
||||
int flags,
|
||||
const char *dev_name,
|
||||
void *data,
|
||||
struct vfsmount *mnt)
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
|
||||
}
|
||||
|
||||
static void ocfs2_kill_sb(struct super_block *sb)
|
||||
|
@ -1267,8 +1265,7 @@ static void ocfs2_kill_sb(struct super_block *sb)
|
|||
static struct file_system_type ocfs2_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ocfs2",
|
||||
.get_sb = ocfs2_get_sb, /* is this called when we mount
|
||||
* the fs? */
|
||||
.mount = ocfs2_mount,
|
||||
.kill_sb = ocfs2_kill_sb,
|
||||
|
||||
.fs_flags = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE,
|
||||
|
|
|
@ -557,17 +557,16 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int omfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *m)
|
||||
static struct dentry *omfs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, omfs_fill_super, m);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, omfs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type omfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "omfs",
|
||||
.get_sb = omfs_get_sb,
|
||||
.mount = omfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -454,17 +454,16 @@ static void destroy_inodecache(void)
|
|||
kmem_cache_destroy(qnx4_inode_cachep);
|
||||
}
|
||||
|
||||
static int qnx4_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *qnx4_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, qnx4_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, qnx4_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type qnx4_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "qnx4",
|
||||
.get_sb = qnx4_get_sb,
|
||||
.mount = qnx4_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -2213,12 +2213,11 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
|
|||
|
||||
#endif
|
||||
|
||||
static int get_super_block(struct file_system_type *fs_type,
|
||||
static struct dentry *get_super_block(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name,
|
||||
void *data, struct vfsmount *mnt)
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super);
|
||||
}
|
||||
|
||||
static int __init init_reiserfs_fs(void)
|
||||
|
@ -2253,7 +2252,7 @@ static void __exit exit_reiserfs_fs(void)
|
|||
struct file_system_type reiserfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "reiserfs",
|
||||
.get_sb = get_super_block,
|
||||
.mount = get_super_block,
|
||||
.kill_sb = reiserfs_kill_sb,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -370,12 +370,10 @@ static void squashfs_put_super(struct super_block *sb)
|
|||
}
|
||||
|
||||
|
||||
static int squashfs_get_sb(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
static struct dentry *squashfs_mount(struct file_system_type *fs_type, int flags,
|
||||
const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, squashfs_fill_super);
|
||||
}
|
||||
|
||||
|
||||
|
@ -451,7 +449,7 @@ static void squashfs_destroy_inode(struct inode *inode)
|
|||
static struct file_system_type squashfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "squashfs",
|
||||
.get_sb = squashfs_get_sb,
|
||||
.mount = squashfs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV
|
||||
};
|
||||
|
|
28
fs/super.c
28
fs/super.c
|
@ -762,10 +762,9 @@ static int test_bdev_super(struct super_block *s, void *data)
|
|||
return (void *)s->s_bdev == data;
|
||||
}
|
||||
|
||||
int get_sb_bdev(struct file_system_type *fs_type,
|
||||
struct dentry *mount_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt)
|
||||
int (*fill_super)(struct super_block *, void *, int))
|
||||
{
|
||||
struct block_device *bdev;
|
||||
struct super_block *s;
|
||||
|
@ -777,7 +776,7 @@ int get_sb_bdev(struct file_system_type *fs_type,
|
|||
|
||||
bdev = open_bdev_exclusive(dev_name, mode, fs_type);
|
||||
if (IS_ERR(bdev))
|
||||
return PTR_ERR(bdev);
|
||||
return ERR_CAST(bdev);
|
||||
|
||||
/*
|
||||
* once the super is inserted into the list by sget, s_umount
|
||||
|
@ -829,15 +828,30 @@ int get_sb_bdev(struct file_system_type *fs_type,
|
|||
bdev->bd_super = s;
|
||||
}
|
||||
|
||||
simple_set_mnt(mnt, s);
|
||||
return 0;
|
||||
return dget(s->s_root);
|
||||
|
||||
error_s:
|
||||
error = PTR_ERR(s);
|
||||
error_bdev:
|
||||
close_bdev_exclusive(bdev, mode);
|
||||
error:
|
||||
return error;
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
EXPORT_SYMBOL(mount_bdev);
|
||||
|
||||
int get_sb_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt)
|
||||
{
|
||||
struct dentry *root;
|
||||
|
||||
root = mount_bdev(fs_type, flags, dev_name, data, fill_super);
|
||||
if (IS_ERR(root))
|
||||
return PTR_ERR(root);
|
||||
mnt->mnt_root = root;
|
||||
mnt->mnt_sb = root->d_sb;
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(get_sb_bdev);
|
||||
|
|
|
@ -526,23 +526,22 @@ static int v7_fill_super(struct super_block *sb, void *data, int silent)
|
|||
|
||||
/* Every kernel module contains stuff like this. */
|
||||
|
||||
static int sysv_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *sysv_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, sysv_fill_super);
|
||||
}
|
||||
|
||||
static int v7_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *v7_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, v7_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, v7_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type sysv_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "sysv",
|
||||
.get_sb = sysv_get_sb,
|
||||
.mount = sysv_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
@ -550,7 +549,7 @@ static struct file_system_type sysv_fs_type = {
|
|||
static struct file_system_type v7_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "v7",
|
||||
.get_sb = v7_get_sb,
|
||||
.mount = v7_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -107,17 +107,16 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
|
|||
}
|
||||
|
||||
/* UDF filesystem type */
|
||||
static int udf_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
struct vfsmount *mnt)
|
||||
static struct dentry *udf_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, udf_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, udf_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type udf_fstype = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "udf",
|
||||
.get_sb = udf_get_sb,
|
||||
.mount = udf_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1454,16 +1454,16 @@ static const struct super_operations ufs_super_ops = {
|
|||
.show_options = ufs_show_options,
|
||||
};
|
||||
|
||||
static int ufs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
|
||||
static struct dentry *ufs_mount(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, ufs_fill_super, mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, ufs_fill_super);
|
||||
}
|
||||
|
||||
static struct file_system_type ufs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "ufs",
|
||||
.get_sb = ufs_get_sb,
|
||||
.mount = ufs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1609,16 +1609,14 @@ xfs_fs_fill_super(
|
|||
goto out_free_sb;
|
||||
}
|
||||
|
||||
STATIC int
|
||||
xfs_fs_get_sb(
|
||||
STATIC struct dentry *
|
||||
xfs_fs_mount(
|
||||
struct file_system_type *fs_type,
|
||||
int flags,
|
||||
const char *dev_name,
|
||||
void *data,
|
||||
struct vfsmount *mnt)
|
||||
void *data)
|
||||
{
|
||||
return get_sb_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super,
|
||||
mnt);
|
||||
return mount_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super);
|
||||
}
|
||||
|
||||
static const struct super_operations xfs_super_operations = {
|
||||
|
@ -1639,7 +1637,7 @@ static const struct super_operations xfs_super_operations = {
|
|||
static struct file_system_type xfs_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "xfs",
|
||||
.get_sb = xfs_fs_get_sb,
|
||||
.mount = xfs_fs_mount,
|
||||
.kill_sb = kill_block_super,
|
||||
.fs_flags = FS_REQUIRES_DEV,
|
||||
};
|
||||
|
|
|
@ -1792,6 +1792,9 @@ struct file_system_type {
|
|||
extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
extern struct dentry *mount_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
extern int get_sb_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
|
|
Loading…
Reference in New Issue