Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (29 commits)
  braino in internal.h
  convert simple cases of nfs-related ->get_sb() to ->mount()
  convert btrfs
  convert ceph
  convert gfs2
  convert afs
  convert ecryptfs
  convert sysfs
  convert cgroup and cpuset
  switch get_sb_ns() users
  switch procfs to ->mount()
  setting ->proc_mnt doesn't belong in proc_get_sb()
  convert cifs
  convert nilfs
  switch logfs to ->mount()
  logfs: fix a leak in get_sb
  logfs get_sb, part 3
  logfs get_sb, part 2
  logfs get_sb massage, part 1
  convert v9fs
  ...
  • Loading branch information
torvalds committed Oct 29, 2010
2 parents 37542b6 + a4cdbd8 commit 53113b0
Show file tree
Hide file tree
Showing 102 changed files with 731 additions and 759 deletions.
9 changes: 4 additions & 5 deletions arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,15 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
}


static int
pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data,
struct vfsmount *mnt)
static struct dentry *
pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
{
return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt);
return mount_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC);
}

static struct file_system_type pfm_fs_type = {
.name = "pfmfs",
.get_sb = pfmfs_get_sb,
.mount = pfmfs_mount,
.kill_sb = kill_anon_super,
};

Expand Down
10 changes: 5 additions & 5 deletions arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,17 +798,17 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
return spufs_create_root(sb, data);
}

static int
spufs_get_sb(struct file_system_type *fstype, int flags,
const char *name, void *data, struct vfsmount *mnt)
static struct dentry *
spufs_mount(struct file_system_type *fstype, int flags,
const char *name, void *data)
{
return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);
return mount_single(fstype, flags, data, spufs_fill_super);
}

static struct file_system_type spufs_type = {
.owner = THIS_MODULE,
.name = "spufs",
.get_sb = spufs_get_sb,
.mount = spufs_mount,
.kill_sb = kill_litter_super,
};

Expand Down
8 changes: 4 additions & 4 deletions arch/s390/hypfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
return 0;
}

static int hypfs_get_super(struct file_system_type *fst, int flags,
const char *devname, void *data, struct vfsmount *mnt)
static struct dentry *hypfs_mount(struct file_system_type *fst, int flags,
const char *devname, void *data)
{
return get_sb_single(fst, flags, data, hypfs_fill_super, mnt);
return mount_single(fst, flags, data, hypfs_fill_super);
}

static void hypfs_kill_super(struct super_block *sb)
Expand Down Expand Up @@ -455,7 +455,7 @@ static const struct file_operations hypfs_file_ops = {
static struct file_system_type hypfs_type = {
.owner = THIS_MODULE,
.name = "s390_hypfs",
.get_sb = hypfs_get_super,
.mount = hypfs_mount,
.kill_sb = hypfs_kill_super
};

Expand Down
18 changes: 9 additions & 9 deletions drivers/base/devtmpfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,33 @@
static struct vfsmount *dev_mnt;

#if defined CONFIG_DEVTMPFS_MOUNT
static int dev_mount = 1;
static int mount_dev = 1;
#else
static int dev_mount;
static int mount_dev;
#endif

static DEFINE_MUTEX(dirlock);

static int __init mount_param(char *str)
{
dev_mount = simple_strtoul(str, NULL, 0);
mount_dev = simple_strtoul(str, NULL, 0);
return 1;
}
__setup("devtmpfs.mount=", mount_param);

static int dev_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt)
static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
{
#ifdef CONFIG_TMPFS
return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt);
return mount_single(fs_type, flags, data, shmem_fill_super);
#else
return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt);
return mount_single(fs_type, flags, data, ramfs_fill_super);
#endif
}

static struct file_system_type dev_fs_type = {
.name = "devtmpfs",
.get_sb = dev_get_sb,
.mount = dev_mount,
.kill_sb = kill_litter_super,
};

Expand Down Expand Up @@ -351,7 +351,7 @@ int devtmpfs_mount(const char *mntdir)
{
int err;

if (!dev_mount)
if (!mount_dev)
return 0;

if (!dev_mnt)
Expand Down
14 changes: 7 additions & 7 deletions drivers/infiniband/hw/ipath/ipath_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ static int ipathfs_fill_super(struct super_block *sb, void *data,
return ret;
}

static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt)
static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
int ret = get_sb_single(fs_type, flags, data,
ipathfs_fill_super, mnt);
if (ret >= 0)
ipath_super = mnt->mnt_sb;
struct dentry *ret;
ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
if (!IS_ERR(ret))
ipath_super = ret->d_sb;
return ret;
}

Expand Down Expand Up @@ -411,7 +411,7 @@ int ipathfs_remove_device(struct ipath_devdata *dd)
static struct file_system_type ipathfs_fs_type = {
.owner = THIS_MODULE,
.name = "ipathfs",
.get_sb = ipathfs_get_sb,
.mount = ipathfs_mount,
.kill_sb = ipathfs_kill_super,
};

Expand Down
14 changes: 7 additions & 7 deletions drivers/infiniband/hw/qib/qib_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent)
return ret;
}

static int qibfs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt)
static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
{
int ret = get_sb_single(fs_type, flags, data,
qibfs_fill_super, mnt);
if (ret >= 0)
qib_super = mnt->mnt_sb;
struct dentry *ret;
ret = mount_single(fs_type, flags, data, qibfs_fill_super);
if (!IS_ERR(ret))
qib_super = ret->d_sb;
return ret;
}

Expand Down Expand Up @@ -603,7 +603,7 @@ int qibfs_remove(struct qib_devdata *dd)
static struct file_system_type qibfs_fs_type = {
.owner = THIS_MODULE,
.name = "ipathfs",
.get_sb = qibfs_get_sb,
.mount = qibfs_mount,
.kill_sb = qibfs_kill_super,
};

Expand Down
8 changes: 4 additions & 4 deletions drivers/isdn/capi/capifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ capifs_fill_super(struct super_block *s, void *data, int silent)
return -ENOMEM;
}

static int capifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
static struct dentry *capifs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);
return mount_single(fs_type, flags, data, capifs_fill_super);
}

static struct file_system_type capifs_fs_type = {
.owner = THIS_MODULE,
.name = "capifs",
.get_sb = capifs_get_sb,
.mount = capifs_mount,
.kill_sb = kill_anon_super,
};

Expand Down
9 changes: 4 additions & 5 deletions drivers/misc/ibmasm/ibmasmfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root);
static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);


static int ibmasmfs_get_super(struct file_system_type *fst,
int flags, const char *name, void *data,
struct vfsmount *mnt)
static struct dentry *ibmasmfs_mount(struct file_system_type *fst,
int flags, const char *name, void *data)
{
return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);
return mount_single(fst, flags, data, ibmasmfs_fill_super);
}

static const struct super_operations ibmasmfs_s_ops = {
Expand All @@ -108,7 +107,7 @@ static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
static struct file_system_type ibmasmfs_type = {
.owner = THIS_MODULE,
.name = "ibmasmfs",
.get_sb = ibmasmfs_get_super,
.mount = ibmasmfs_mount,
.kill_sb = kill_litter_super,
};

Expand Down
10 changes: 4 additions & 6 deletions drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,17 +1030,15 @@ static const struct file_operations mtd_fops = {
#endif
};

static int mtd_inodefs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct vfsmount *mnt)
static struct dentry *mtd_inodefs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return get_sb_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC,
mnt);
return mount_pseudo(fs_type, "mtd_inode:", NULL, MTD_INODE_FS_MAGIC);
}

static struct file_system_type mtd_inodefs_type = {
.name = "mtd_inodefs",
.get_sb = mtd_inodefs_get_sb,
.mount = mtd_inodefs_mount,
.kill_sb = kill_anon_super,
};

Expand Down
54 changes: 22 additions & 32 deletions drivers/mtd/mtdsuper.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ static int get_sb_mtd_set(struct super_block *sb, void *_mtd)
/*
* get a superblock on an MTD-backed filesystem
*/
static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct mtd_info *mtd,
int (*fill_super)(struct super_block *, void *, int),
struct vfsmount *mnt)
int (*fill_super)(struct super_block *, void *, int))
{
struct super_block *sb;
int ret;
Expand All @@ -79,57 +78,49 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
if (ret < 0) {
deactivate_locked_super(sb);
return ret;
return ERR_PTR(ret);
}

/* go */
sb->s_flags |= MS_ACTIVE;
simple_set_mnt(mnt, sb);

return 0;
return dget(sb->s_root);

/* new mountpoint for an already mounted superblock */
already_mounted:
DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n",
mtd->index, mtd->name);
simple_set_mnt(mnt, sb);
ret = 0;
goto out_put;
put_mtd_device(mtd);
return dget(sb->s_root);

out_error:
ret = PTR_ERR(sb);
out_put:
put_mtd_device(mtd);
return ret;
return ERR_CAST(sb);
}

/*
* get a superblock on an MTD-backed filesystem by MTD device number
*/
static int get_sb_mtd_nr(struct file_system_type *fs_type, int flags,
static struct dentry *mount_mtd_nr(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, int mtdnr,
int (*fill_super)(struct super_block *, void *, int),
struct vfsmount *mnt)
int (*fill_super)(struct super_block *, void *, int))
{
struct mtd_info *mtd;

mtd = get_mtd_device(NULL, mtdnr);
if (IS_ERR(mtd)) {
DEBUG(0, "MTDSB: Device #%u doesn't appear to exist\n", mtdnr);
return PTR_ERR(mtd);
return ERR_CAST(mtd);
}

return get_sb_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super,
mnt);
return mount_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super);
}

/*
* set up an MTD-based superblock
*/
int get_sb_mtd(struct file_system_type *fs_type, int flags,
struct dentry *mount_mtd(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))
{
#ifdef CONFIG_BLOCK
struct block_device *bdev;
Expand All @@ -138,7 +129,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
int mtdnr;

if (!dev_name)
return -EINVAL;
return ERR_PTR(-EINVAL);

DEBUG(2, "MTDSB: dev_name \"%s\"\n", dev_name);

Expand All @@ -156,10 +147,10 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,

mtd = get_mtd_device_nm(dev_name + 4);
if (!IS_ERR(mtd))
return get_sb_mtd_aux(
return mount_mtd_aux(
fs_type, flags,
dev_name, data, mtd,
fill_super, mnt);
fill_super);

printk(KERN_NOTICE "MTD:"
" MTD device with name \"%s\" not found.\n",
Expand All @@ -174,9 +165,9 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
/* It was a valid number */
DEBUG(1, "MTDSB: mtd%%d, mtdnr %d\n",
mtdnr);
return get_sb_mtd_nr(fs_type, flags,
return mount_mtd_nr(fs_type, flags,
dev_name, data,
mtdnr, fill_super, mnt);
mtdnr, fill_super);
}
}
}
Expand All @@ -189,7 +180,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
if (IS_ERR(bdev)) {
ret = PTR_ERR(bdev);
DEBUG(1, "MTDSB: lookup_bdev() returned %d\n", ret);
return ret;
return ERR_PTR(ret);
}
DEBUG(1, "MTDSB: lookup_bdev() returned 0\n");

Expand All @@ -202,8 +193,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
if (major != MTD_BLOCK_MAJOR)
goto not_an_MTD_device;

return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super,
mnt);
return mount_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super);

not_an_MTD_device:
#endif /* CONFIG_BLOCK */
Expand All @@ -212,10 +202,10 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
printk(KERN_NOTICE
"MTD: Attempt to mount non-MTD device \"%s\"\n",
dev_name);
return -EINVAL;
return ERR_PTR(-EINVAL);
}

EXPORT_SYMBOL_GPL(get_sb_mtd);
EXPORT_SYMBOL_GPL(mount_mtd);

/*
* destroy an MTD-based superblock
Expand Down
Loading

0 comments on commit 53113b0

Please sign in to comment.