Browse Source

[PATCH] VFS: Permit filesystem to override root dentry on mount

Extend the get_sb() filesystem operation to take an extra argument that
permits the VFS to pass in the target vfsmount that defines the mountpoint.

The filesystem is then required to manually set the superblock and root dentry
pointers.  For most filesystems, this should be done with simple_set_mnt()
which will set the superblock pointer and then set the root dentry to the
superblock's s_root (as per the old default behaviour).

The get_sb() op now returns an integer as there's now no need to return the
superblock pointer.

This patch permits a superblock to be implicitly shared amongst several mount
points, such as can be done with NFS to avoid potential inode aliasing.  In
such a case, simple_set_mnt() would not be called, and instead the mnt_root
and mnt_sb would be set directly.

The patch also makes the following changes:

 (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
     pointer argument and return an integer, so most filesystems have to change
     very little.

 (*) If one of the convenience function is not used, then get_sb() should
     normally call simple_set_mnt() to instantiate the vfsmount. This will
     always return 0, and so can be tail-called from get_sb().

 (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
     dcache upon superblock destruction rather than shrink_dcache_anon().

     This is required because the superblock may now have multiple trees that
     aren't actually bound to s_root, but that still need to be cleaned up. The
     currently called functions assume that the whole tree is rooted at s_root,
     and that anonymous dentries are not the roots of trees which results in
     dentries being left unculled.

     However, with the way NFS superblock sharing are currently set to be
     implemented, these assumptions are violated: the root of the filesystem is
     simply a dummy dentry and inode (the real inode for '/' may well be
     inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
     with child trees.

     [*] Anonymous until discovered from another tree.

 (*) The documentation has been adjusted, including the additional bit of
     changing ext2_* into foo_* in the documentation.

[akpm@osdl.org: convert ipath_fs, do other stuff]
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nathan Scott <nathans@sgi.com>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
master
David Howells 16 years ago
committed by Linus Torvalds
parent
commit
454e2398be
  1. 7
      Documentation/filesystems/Locking
  2. 7
      Documentation/filesystems/porting
  3. 4
      Documentation/filesystems/vfs.txt
  4. 7
      arch/ia64/kernel/perfmon.c
  5. 6
      arch/powerpc/platforms/cell/spufs/inode.c
  6. 7
      drivers/infiniband/core/uverbs_main.c
  7. 13
      drivers/infiniband/hw/ipath/ipath_fs.c
  8. 6
      drivers/isdn/capi/capifs.c
  9. 7
      drivers/misc/ibmasm/ibmasmfs.c
  10. 6
      drivers/oprofile/oprofilefs.c
  11. 6
      drivers/usb/core/inode.c
  12. 6
      drivers/usb/gadget/inode.c
  13. 21
      fs/9p/vfs_super.c
  14. 7
      fs/adfs/super.c
  15. 7
      fs/affs/super.c
  16. 24
      fs/afs/super.c
  17. 6
      fs/autofs/init.c
  18. 6
      fs/autofs4/init.c
  19. 7
      fs/befs/linuxvfs.c
  20. 6
      fs/bfs/inode.c
  21. 6
      fs/binfmt_misc.c
  22. 6
      fs/block_dev.c
  23. 10
      fs/cifs/cifsfs.c
  24. 6
      fs/coda/inode.c
  25. 6
      fs/configfs/mount.c
  26. 7
      fs/cramfs/inode.c
  27. 40
      fs/dcache.c
  28. 8
      fs/debugfs/inode.c
  29. 8
      fs/devfs/base.c
  30. 6
      fs/devpts/inode.c
  31. 6
      fs/efs/super.c
  32. 13
      fs/eventpoll.c
  33. 6
      fs/ext2/super.c
  34. 6
      fs/ext3/super.c
  35. 7
      fs/freevxfs/vxfs_super.c
  36. 8
      fs/fuse/inode.c
  37. 7
      fs/hfs/super.c
  38. 8
      fs/hfsplus/super.c
  39. 8
      fs/hostfs/hostfs_kern.c
  40. 7
      fs/hpfs/super.c
  41. 8
      fs/hppfs/hppfs_kern.c
  42. 6
      fs/hugetlbfs/inode.c
  43. 6
      fs/inotify_user.c
  44. 7
      fs/isofs/inode.c
  45. 7
      fs/jffs/inode-v23.c
  46. 49
      fs/jffs2/super.c
  47. 7
      fs/jfs/super.c
  48. 12
      fs/libfs.c
  49. 7
      fs/minix/inode.c
  50. 9
      fs/msdos/namei.c
  51. 9
      fs/namespace.c
  52. 6
      fs/ncpfs/inode.c
  53. 96
      fs/nfs/inode.c
  54. 6
      fs/nfsd/nfsctl.c
  55. 7
      fs/ntfs/super.c
  56. 6
      fs/ocfs2/dlm/dlmfs.c
  57. 12
      fs/ocfs2/super.c
  58. 6
      fs/openpromfs/inode.c
  59. 9
      fs/pipe.c
  60. 6
      fs/proc/root.c
  61. 7
      fs/qnx4/inode.c
  62. 13
      fs/ramfs/inode.c
  63. 9
      fs/reiserfs/super.c
  64. 7
      fs/romfs/inode.c
  65. 6
      fs/smbfs/inode.c
  66. 109
      fs/super.c
  67. 6
      fs/sysfs/mount.c
  68. 13
      fs/sysv/super.c
  69. 6
      fs/udf/super.c
  70. 6
      fs/ufs/super.c
  71. 9
      fs/vfat/namei.c
  72. 8
      fs/xfs/linux-2.6/xfs_super.c
  73. 1
      include/linux/dcache.h
  74. 25
      include/linux/fs.h
  75. 4
      include/linux/ramfs.h
  76. 8
      ipc/mqueue.c
  77. 8
      kernel/cpuset.c
  78. 8
      kernel/futex.c
  79. 6
      mm/shmem.c
  80. 7
      net/socket.c
  81. 6
      net/sunrpc/rpc_pipe.c
  82. 8
      security/inode.c
  83. 7
      security/selinux/selinuxfs.c

7
Documentation/filesystems/Locking

@ -142,15 +142,16 @@ see also dquot_operations section.
--------------------------- file_system_type ---------------------------
prototypes:
struct super_block *(*get_sb) (struct file_system_type *, int,
const char *, void *);
struct int (*get_sb) (struct file_system_type *, int,
const char *, void *, struct vfsmount *);
void (*kill_sb) (struct super_block *);
locking rules:
may block BKL
get_sb yes yes
kill_sb yes yes
->get_sb() returns error or a locked superblock (exclusive on ->s_umount).
->get_sb() returns error or 0 with locked superblock attached to the vfsmount
(exclusive on ->s_umount).
->kill_sb() takes a write-locked superblock, does all shutdown work on it,
unlocks and drops the reference.

7
Documentation/filesystems/porting

@ -50,10 +50,11 @@ Turn your foo_read_super() into a function that would return 0 in case of
success and negative number in case of error (-EINVAL unless you have more
informative error value to report). Call it foo_fill_super(). Now declare
struct super_block foo_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
int foo_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, foo_fill_super,
mnt);
}
(or similar with s/bdev/nodev/ or s/bdev/single/, depending on the kind of

4
Documentation/filesystems/vfs.txt

@ -113,8 +113,8 @@ members are defined:
struct file_system_type {
const char *name;
int fs_flags;
struct super_block *(*get_sb) (struct file_system_type *, int,
const char *, void *);
struct int (*get_sb) (struct file_system_type *, int,
const char *, void *, struct vfsmount *);
void (*kill_sb) (struct super_block *);
struct module *owner;
struct file_system_type * next;

7
arch/ia64/kernel/perfmon.c

@ -595,10 +595,11 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
}
static struct super_block *
pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
static int
pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC);
return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt);
}
static struct file_system_type pfm_fs_type = {

6
arch/powerpc/platforms/cell/spufs/inode.c

@ -436,11 +436,11 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
return spufs_create_root(sb, data);
}
static struct super_block *
static int
spufs_get_sb(struct file_system_type *fstype, int flags,
const char *name, void *data)
const char *name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fstype, flags, data, spufs_fill_super);
return get_sb_single(fstype, flags, data, spufs_fill_super, mnt);
}
static struct file_system_type spufs_type = {

7
drivers/infiniband/core/uverbs_main.c

@ -821,11 +821,12 @@ static void ib_uverbs_remove_one(struct ib_device *device)
kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
}
static struct super_block *uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "infinibandevent:", NULL,
INFINIBANDEVENTFS_MAGIC);
INFINIBANDEVENTFS_MAGIC, mnt);
}
static struct file_system_type uverbs_event_fs = {

13
drivers/infiniband/hw/ipath/ipath_fs.c

@ -542,13 +542,14 @@ bail:
return ret;
}
static struct super_block *ipathfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data, struct vfsmount *mnt)
{
ipath_super = get_sb_single(fs_type, flags, data,
ipathfs_fill_super);
return ipath_super;
int ret = get_sb_single(fs_type, flags, data,
ipathfs_fill_super, mnt);
if (ret >= 0)
ipath_super = mnt->mnt_sb;
return ret;
}
static void ipathfs_kill_super(struct super_block *s)

6
drivers/isdn/capi/capifs.c

@ -121,10 +121,10 @@ fail:
return -ENOMEM;
}
static struct super_block *capifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int capifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, capifs_fill_super);
return get_sb_single(fs_type, flags, data, capifs_fill_super, mnt);
}
static struct file_system_type capifs_fs_type = {

7
drivers/misc/ibmasm/ibmasmfs.c

@ -90,10 +90,11 @@ 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 struct super_block *ibmasmfs_get_super(struct file_system_type *fst,
int flags, const char *name, void *data)
static int ibmasmfs_get_super(struct file_system_type *fst,
int flags, const char *name, void *data,
struct vfsmount *mnt)
{
return get_sb_single(fst, flags, data, ibmasmfs_fill_super);
return get_sb_single(fst, flags, data, ibmasmfs_fill_super, mnt);
}
static struct super_operations ibmasmfs_s_ops = {

6
drivers/oprofile/oprofilefs.c

@ -272,10 +272,10 @@ static int oprofilefs_fill_super(struct super_block * sb, void * data, int silen
}
static struct super_block *oprofilefs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int oprofilefs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, oprofilefs_fill_super);
return get_sb_single(fs_type, flags, data, oprofilefs_fill_super, mnt);
}

6
drivers/usb/core/inode.c

@ -543,10 +543,10 @@ static void fs_remove_file (struct dentry *dentry)
/* --------------------------------------------------------------------- */
static struct super_block *usb_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int usb_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, usbfs_fill_super);
return get_sb_single(fs_type, flags, data, usbfs_fill_super, mnt);
}
static struct file_system_type usb_fs_type = {

6
drivers/usb/gadget/inode.c

@ -2070,11 +2070,11 @@ enomem0:
}
/* "mount -t gadgetfs path /dev/gadget" ends up here */
static struct super_block *
static int
gadgetfs_get_sb (struct file_system_type *t, int flags,
const char *path, void *opts)
const char *path, void *opts, struct vfsmount *mnt)
{
return get_sb_single (t, flags, opts, gadgetfs_fill_super);
return get_sb_single (t, flags, opts, gadgetfs_fill_super, mnt);
}
static void

21
fs/9p/vfs_super.c

@ -99,12 +99,13 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
* @flags: mount flags
* @dev_name: device name that was mounted
* @data: mount options
* @mnt: mountpoint record to be instantiated
*
*/
static struct super_block *v9fs_get_sb(struct file_system_type
*fs_type, int flags,
const char *dev_name, void *data)
static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data,
struct vfsmount *mnt)
{
struct super_block *sb = NULL;
struct v9fs_fcall *fcall = NULL;
@ -123,17 +124,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type
v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
if (!v9ses)
return ERR_PTR(-ENOMEM);
return -ENOMEM;
if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
dprintk(DEBUG_ERROR, "problem initiating session\n");
sb = ERR_PTR(newfid);
retval = newfid;
goto out_free_session;
}
sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
if (IS_ERR(sb))
if (IS_ERR(sb)) {
retval = PTR_ERR(sb);
goto out_close_session;
}
v9fs_fill_super(sb, v9ses, flags);
inode = v9fs_get_inode(sb, S_IFDIR | mode);
@ -184,19 +187,19 @@ static struct super_block *v9fs_get_sb(struct file_system_type
goto put_back_sb;
}
return sb;
return simple_set_mnt(mnt, sb);
out_close_session:
v9fs_session_close(v9ses);
out_free_session:
kfree(v9ses);
return sb;
return retval;
put_back_sb:
/* deactivate_super calls v9fs_kill_super which will frees the rest */
up_write(&sb->s_umount);
deactivate_super(sb);
return ERR_PTR(retval);
return retval;
}
/**

7
fs/adfs/super.c

@ -470,10 +470,11 @@ error:
return -EINVAL;
}
static struct super_block *adfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int adfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super,
mnt);
}
static struct file_system_type adfs_fs_type = {

7
fs/affs/super.c

@ -524,10 +524,11 @@ affs_statfs(struct super_block *sb, struct kstatfs *buf)
return 0;
}
static struct super_block *affs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int affs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super,
mnt);
}
static struct file_system_type affs_fs_type = {

24
fs/afs/super.c

@ -38,9 +38,9 @@ struct afs_mount_params {
static void afs_i_init_once(void *foo, kmem_cache_t *cachep,
unsigned long flags);
static struct super_block *afs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data);
static int afs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt);
static struct inode *afs_alloc_inode(struct super_block *sb);
@ -294,10 +294,11 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent)
* get an AFS superblock
* - TODO: don't use get_sb_nodev(), but rather call sget() directly
*/
static struct super_block *afs_get_sb(struct file_system_type *fs_type,
int flags,
const char *dev_name,
void *options)
static int afs_get_sb(struct file_system_type *fs_type,
int flags,
const char *dev_name,
void *options,
struct vfsmount *mnt)
{
struct afs_mount_params params;
struct super_block *sb;
@ -311,7 +312,7 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
ret = afscm_start();
if (ret < 0) {
_leave(" = %d", ret);
return ERR_PTR(ret);
return ret;
}
/* parse the options */
@ -348,18 +349,19 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
goto error;
}
sb->s_flags |= MS_ACTIVE;
simple_set_mnt(mnt, sb);
afs_put_volume(params.volume);
afs_put_cell(params.default_cell);
_leave(" = %p", sb);
return sb;
_leave(" = 0 [%p]", 0, sb);
return 0;
error:
afs_put_volume(params.volume);
afs_put_cell(params.default_cell);
afscm_stop();
_leave(" = %d", ret);
return ERR_PTR(ret);
return ret;
} /* end afs_get_sb() */
/*****************************************************************************/

6
fs/autofs/init.c

@ -14,10 +14,10 @@
#include <linux/init.h>
#include "autofs_i.h"
static struct super_block *autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, autofs_fill_super);
return get_sb_nodev(fs_type, flags, data, autofs_fill_super, mnt);
}
static struct file_system_type autofs_fs_type = {

6
fs/autofs4/init.c

@ -14,10 +14,10 @@
#include <linux/init.h>
#include "autofs_i.h"
static struct super_block *autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int autofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, autofs4_fill_super);
return get_sb_nodev(fs_type, flags, data, autofs4_fill_super, mnt);
}
static struct file_system_type autofs_fs_type = {

7
fs/befs/linuxvfs.c

@ -899,11 +899,12 @@ befs_statfs(struct super_block *sb, struct kstatfs *buf)
return 0;
}
static struct super_block *
static int
befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name,
void *data)
void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super,
mnt);
}
static struct file_system_type befs_fs_type = {

6
fs/bfs/inode.c

@ -410,10 +410,10 @@ out:
return -EINVAL;
}
static struct super_block *bfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int bfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super, mnt);
}
static struct file_system_type bfs_fs_type = {

6
fs/binfmt_misc.c

@ -739,10 +739,10 @@ static int bm_fill_super(struct super_block * sb, void * data, int silent)
return err;
}
static struct super_block *bm_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int bm_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, bm_fill_super);
return get_sb_single(fs_type, flags, data, bm_fill_super, mnt);
}
static struct linux_binfmt misc_format = {

6
fs/block_dev.c

@ -300,10 +300,10 @@ static struct super_operations bdev_sops = {
.clear_inode = bdev_clear_inode,
};
static struct super_block *bd_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int bd_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576);
return get_sb_pseudo(fs_type, "bdev:", &bdev_sops, 0x62646576, mnt);
}
static struct file_system_type bd_type = {

10
fs/cifs/cifsfs.c

@ -460,9 +460,9 @@ struct super_operations cifs_super_ops = {
.remount_fs = cifs_remount,
};
static struct super_block *
static int
cifs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
int rc;
struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
@ -470,7 +470,7 @@ cifs_get_sb(struct file_system_type *fs_type,
cFYI(1, ("Devname: %s flags: %d ", dev_name, flags));
if (IS_ERR(sb))
return sb;
return PTR_ERR(sb);
sb->s_flags = flags;
@ -478,10 +478,10 @@ cifs_get_sb(struct file_system_type *fs_type,
if (rc) {
up_write(&sb->s_umount);
deactivate_super(sb);
return ERR_PTR(rc);
return rc;
}
sb->s_flags |= MS_ACTIVE;
return sb;
return simple_set_mnt(mnt, sb);
}
static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov,

6
fs/coda/inode.c

@ -307,10 +307,10 @@ static int coda_statfs(struct super_block *sb, struct kstatfs *buf)
/* init_coda: used by filesystems.c to register coda */
static struct super_block *coda_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int coda_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, coda_fill_super);
return get_sb_nodev(fs_type, flags, data, coda_fill_super, mnt);
}
struct file_system_type coda_fs_type = {

6
fs/configfs/mount.c

@ -103,10 +103,10 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent)
return 0;
}
static struct super_block *configfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int configfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, configfs_fill_super);
return get_sb_single(fs_type, flags, data, configfs_fill_super, mnt);
}
static struct file_system_type configfs_fs_type = {

7
fs/cramfs/inode.c

@ -528,10 +528,11 @@ static struct super_operations cramfs_ops = {
.statfs = cramfs_statfs,
};
static struct super_block *cramfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int cramfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super,
mnt);
}
static struct file_system_type cramfs_fs_type = {

40
fs/dcache.c

@ -687,46 +687,6 @@ void shrink_dcache_parent(struct dentry * parent)
prune_dcache(found, parent->d_sb);
}
/**
* shrink_dcache_anon - further prune the cache
* @head: head of d_hash list of dentries to prune
*
* Prune the dentries that are anonymous
*
* parsing d_hash list does not hlist_for_each_entry_rcu() as it
* done under dcache_lock.
*
*/
void shrink_dcache_anon(struct super_block *sb)
{
struct hlist_node *lp;
struct hlist_head *head = &sb->s_anon;
int found;
do {
found = 0;
spin_lock(&dcache_lock);
hlist_for_each(lp, head) {
struct dentry *this = hlist_entry(lp, struct dentry, d_hash);
if (!list_empty(&this->d_lru)) {
dentry_stat.nr_unused--;
list_del_init(&this->d_lru);
}
/*
* move only zero ref count dentries to the end
* of the unused list for prune_dcache
*/
if (!atomic_read(&this->d_count)) {
list_add_tail(&this->d_lru, &dentry_unused);
dentry_stat.nr_unused++;
found++;
}
}
spin_unlock(&dcache_lock);
prune_dcache(found, sb);
} while(found);
}
/*
* Scan `nr' dentries and return the number which remain.
*

8
fs/debugfs/inode.c

@ -111,11 +111,11 @@ static int debug_fill_super(struct super_block *sb, void *data, int silent)
return simple_fill_super(sb, DEBUGFS_MAGIC, debug_files);
}
static struct super_block *debug_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int debug_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, debug_fill_super);
return get_sb_single(fs_type, flags, data, debug_fill_super, mnt);
}
static struct file_system_type debug_fs_type = {

8
fs/devfs/base.c

@ -2549,11 +2549,11 @@ static int devfs_fill_super(struct super_block *sb, void *data, int silent)
return -EINVAL;
} /* End Function devfs_fill_super */
static struct super_block *devfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int devfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, devfs_fill_super);
return get_sb_single(fs_type, flags, data, devfs_fill_super, mnt);
}
static struct file_system_type devfs_fs_type = {

6
fs/devpts/inode.c

@ -130,10 +130,10 @@ fail:
return -ENOMEM;
}
static struct super_block *devpts_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int devpts_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_single(fs_type, flags, data, devpts_fill_super);
return get_sb_single(fs_type, flags, data, devpts_fill_super, mnt);
}
static struct file_system_type devpts_fs_type = {

6
fs/efs/super.c

@ -18,10 +18,10 @@
static int efs_statfs(struct super_block *s, struct kstatfs *buf);
static int efs_fill_super(struct super_block *s, void *d, int silent);
static struct super_block *efs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int efs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super, mnt);
}
static struct file_system_type efs_fs_type = {

13
fs/eventpoll.c

@ -268,9 +268,9 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
int maxevents, long timeout);
static int eventpollfs_delete_dentry(struct dentry *dentry);
static struct inode *ep_eventpoll_inode(void);
static struct super_block *eventpollfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data);
static int eventpollfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt);
/*
* This semaphore is used to serialize ep_free() and eventpoll_release_file().
@ -1595,11 +1595,12 @@ eexit_1:
}
static struct super_block *
static int
eventpollfs_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "eventpoll:", NULL, EVENTPOLLFS_MAGIC);
return get_sb_pseudo(fs_type, "eventpoll:", NULL, EVENTPOLLFS_MAGIC,
mnt);
}

6
fs/ext2/super.c

@ -1087,10 +1087,10 @@ static int ext2_statfs (struct super_block * sb, struct kstatfs * buf)
return 0;
}
static struct super_block *ext2_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int ext2_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super, mnt);
}
#ifdef CONFIG_QUOTA

6
fs/ext3/super.c

@ -2646,10 +2646,10 @@ out:
#endif
static struct super_block *ext3_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int ext3_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super, mnt);
}
static struct file_system_type ext3_fs_type = {

7
fs/freevxfs/vxfs_super.c

@ -241,10 +241,11 @@ out:
/*
* The usual module blurb.
*/
static struct super_block *vxfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int vxfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super,
mnt);
}
static struct file_system_type vxfs_fs_type = {

8
fs/fuse/inode.c

@ -569,11 +569,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
return err;
}
static struct super_block *fuse_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *raw_data)
static int fuse_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *raw_data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super);
return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
}
static struct file_system_type fuse_fs_type = {

7
fs/hfs/super.c

@ -413,10 +413,11 @@ bail:
return res;
}
static struct super_block *hfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int hfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super, mnt);
}
static struct file_system_type hfs_fs_type = {

8
fs/hfsplus/super.c

@ -450,10 +450,12 @@ static void hfsplus_destroy_inode(struct inode *inode)
#define HFSPLUS_INODE_SIZE sizeof(struct hfsplus_inode_info)
static struct super_block *hfsplus_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int hfsplus_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data,
struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, hfsplus_fill_super,
mnt);
}
static struct file_system_type hfsplus_fs_type = {

8
fs/hostfs/hostfs_kern.c

@ -993,11 +993,11 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
return(err);
}
static struct super_block *hostfs_read_sb(struct file_system_type *type,
int flags, const char *dev_name,
void *data)
static int hostfs_read_sb(struct file_system_type *type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
return(get_sb_nodev(type, flags, data, hostfs_fill_sb_common));
return get_sb_nodev(type, flags, data, hostfs_fill_sb_common, mnt);
}
static struct file_system_type hostfs_type = {

7
fs/hpfs/super.c

@ -662,10 +662,11 @@ bail0:
return -EINVAL;
}
static struct super_block *hpfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int hpfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super,
mnt);
}
static struct file_system_type hpfs_fs_type = {

8
fs/hppfs/hppfs_kern.c

@ -769,11 +769,11 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
return(err);
}
static struct super_block *hppfs_read_super(struct file_system_type *type,
int flags, const char *dev_name,
void *data)
static int hppfs_read_super(struct file_system_type *type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
return(get_sb_nodev(type, flags, data, hppfs_fill_super));
return get_sb_nodev(type, flags, data, hppfs_fill_super, mnt);
}
static struct file_system_type hppfs_type = {

6
fs/hugetlbfs/inode.c

@ -723,10 +723,10 @@ void hugetlb_put_quota(struct address_space *mapping)
}
}
static struct super_block *hugetlbfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int hugetlbfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super);
return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super, mnt);
}
static struct file_system_type hugetlbfs_fs_type = {

6
fs/inotify_user.c

@ -672,11 +672,11 @@ out:
return ret;
}
static struct super_block *
static int
inotify_get_sb(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_pseudo(fs_type, "inotify", NULL, 0xBAD1DEA);
return get_sb_pseudo(fs_type, "inotify", NULL, 0xBAD1DEA, mnt);
}
static struct file_system_type inotify_fs_type = {

7
fs/isofs/inode.c

@ -1399,10 +1399,11 @@ struct inode *isofs_iget(struct super_block *sb,
return inode;
}
static struct super_block *isofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int isofs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super,
mnt);
}
static struct file_system_type iso9660_fs_type = {

7
fs/jffs/inode-v23.c

@ -1785,10 +1785,11 @@ static struct super_operations jffs_ops =
.remount_fs = jffs_remount,
};
static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int jffs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, jffs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, jffs_fill_super,
mnt);
}
static struct file_system_type jffs_fs_type = {

49
fs/jffs2/super.c

@ -111,9 +111,10 @@ static int jffs2_sb_set(struct super_block *sb, void *data)
return 0;
}
static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct mtd_info *mtd)
static int jffs2_get_sb_mtd(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct mtd_info *mtd,
struct vfsmount *mnt)
{
struct super_block *sb;
struct jffs2_sb_info *c;
@ -121,19 +122,20 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type,
c = kmalloc(sizeof(*c), GFP_KERNEL);
if (!c)
return ERR_PTR(-ENOMEM);
return -ENOMEM;
memset(c, 0, sizeof(*c));
c->mtd = mtd;
sb = sget(fs_type, jffs2_sb_compare, jffs2_sb_set, c);
if (IS_ERR(sb))
goto out_put;
goto out_error;
if (sb->s_root) {
/* New mountpoint for JFFS2 which is already mounted */
D1(printk(KERN_DEBUG "jffs2_get_sb_mtd(): Device %d (\"%s\") is already mounted\n",
mtd->index, mtd->name));
ret = simple_set_mnt(mnt, sb);
goto out_put;
}
@ -161,44 +163,47 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type,
/* Failure case... */
up_write(&sb->s_umount);
deactivate_super(sb);
return ERR_PTR(ret);
return ret;
}
sb->s_flags |= MS_ACTIVE;
return sb;
return simple_set_mnt(mnt, sb);
out_error:
ret = PTR_ERR(sb);
out_put:
kfree(c);
put_mtd_device(mtd);
return sb;
return ret;
}
static struct super_block *jffs2_get_sb_mtdnr(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, int mtdnr)
static int jffs2_get_sb_mtdnr(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, int mtdnr,
struct vfsmount *mnt)
{
struct mtd_info *mtd;
mtd = get_mtd_device(NULL, mtdnr);
if (!mtd) {
D1(printk(KERN_DEBUG "jffs2: MTD device #%u doesn't appear to exist\n", mtdnr));
return ERR_PTR(-EINVAL);
return -EINVAL;
}
return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd);
return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd, mnt);
}
static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int jffs2_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
int err;
struct nameidata nd;
int mtdnr;
if (!dev_name)
return ERR_PTR(-EINVAL);
return -EINVAL;
D1(printk(KERN_DEBUG "jffs2_get_sb(): dev_name \"%s\"\n", dev_name));
@ -220,7 +225,7 @@ static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
mtd = get_mtd_device(NULL, mtdnr);
if (mtd) {
if (!strcmp(mtd->name, dev_name+4))
return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd);
return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd, mnt);
put_mtd_device(mtd);
}
}
@ -233,7 +238,7 @@ static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
if (!*endptr) {
/* It was a valid number */
D1(printk(KERN_DEBUG "jffs2_get_sb(): mtd%%d, mtdnr %d\n", mtdnr));
return jffs2_get_sb_mtdnr(fs_type, flags, dev_name, data, mtdnr);
return jffs2_get_sb_mtdnr(fs_type, flags, dev_name, data, mtdnr, mnt);
}
}
}
@ -247,7 +252,7 @@ static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
err, nd.dentry->d_inode));
if (err)
return ERR_PTR(err);
return err;
err = -EINVAL;
@ -269,11 +274,11 @@ static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
mtdnr = iminor(nd.dentry->d_inode);
path_release(&nd);
return jffs2_get_sb_mtdnr(fs_type, flags, dev_name, data, mtdnr);
return jffs2_get_sb_mtdnr(fs_type, flags, dev_name, data, mtdnr, mnt);
out:
path_release(&nd);
return ERR_PTR(err);
return err;
}
static void jffs2_put_super (struct super_block *sb)

7
fs/jfs/super.c

@ -565,10 +565,11 @@ static void jfs_unlockfs(struct super_block *sb)
}
}
static struct super_block *jfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int jfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super,
mnt);
}
static int jfs_sync_fs(struct super_block *sb, int wait)

12
fs/libfs.c

@ -196,9 +196,9 @@ struct inode_operations simple_dir_inode_operations = {
* Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
* will never be mountable)
*/
struct super_block *
get_sb_pseudo(struct file_system_type *fs_type, char *name,
struct super_operations *ops, unsigned long magic)
int get_sb_pseudo(struct file_system_type *fs_type, char *name,
struct super_operations *ops, unsigned long magic,
struct vfsmount *mnt)
{
struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
static struct super_operations default_ops = {.statfs = simple_statfs};
@ -207,7 +207,7 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name,
struct qstr d_name = {.name = name, .len = strlen(name)};
if (IS_ERR(s))
return s;
return PTR_ERR(s);
s->s_flags = MS_NOUSER;
s->s_maxbytes = ~0ULL;
@ -232,12 +232,12 @@ get_sb_pseudo(struct file_system_type *fs_type, char *name,
d_instantiate(dentry, root);
s->s_root = dentry;
s->s_flags |= MS_ACTIVE;
return s;
return simple_set_mnt(mnt, s);
Enomem:
up_write(&s->s_umount);
deactivate_super(s);
return ERR_PTR(-ENOMEM);
return -ENOMEM;
}
int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)

7
fs/minix/inode.c

@ -559,10 +559,11 @@ void minix_truncate(struct inode * inode)
V2_minix_truncate(inode);
}
static struct super_block *minix_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int minix_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, minix_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, minix_fill_super,
mnt);
}
static struct file_system_type minix_fs_type = {

9
fs/msdos/namei.c

@ -661,11 +661,12 @@ static int msdos_fill_super(struct super_block *sb, void *data, int silent)
return 0;
}
static struct super_block *msdos_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int msdos_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data, struct vfsmount *mnt)
{
return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super);
return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super,
mnt);
}
static struct file_system_type msdos_fs_type = {

9
fs/namespace.c

@ -86,6 +86,15 @@ struct vfsmount *alloc_vfsmnt(const char *name)
return mnt;
}
int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
{
mnt->mnt_sb = sb;
mnt->mnt_root = dget(sb->s_root);
return 0;
}
EXPORT_SYMBOL(simple_set_mnt);
void free_vfsmnt(struct vfsmount *mnt)
{
kfree(mnt->mnt_devname);

6
fs/ncpfs/inode.c

@ -957,10 +957,10 @@ out:
return result;
}
static struct super_block *ncp_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
static int ncp_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data, struct vfsmount *mnt)
{
return get_sb_nodev(fs_type, flags, data, ncp_fill_super);
return get_sb_nodev(fs_type, flags, data, ncp_fill_super, mnt);
}
static struct file_system_type ncp_fs_type = {

96
fs/nfs/inode.c

@ -1690,8 +1690,8 @@ static int nfs_compare_super(struct super_block *sb, void *data)
return !nfs_compare_fh(&old->fh, &server->fh);
}
static struct super_block *nfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data)
static int nfs_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt)
{
int error;
struct nfs_server *server = NULL;
@ -1699,14 +1699,14 @@ static struct super_block *nfs_get_sb(struct file_system_type *fs_type,
struct nfs_fh *root;
struct nfs_mount_data *data = raw_data;
s = ERR_PTR(-EINVAL);
error = -EINVAL;
if (data == NULL) {
dprintk("%s: missing data argument\n", __FUNCTION__);
goto out_err;
goto out_err_noserver;
}
if (data->version <= 0 || data->version > NFS_MOUNT_VERSION) {
dprintk("%s: bad mount version\n", __FUNCTION__);
goto out_err;
goto out_err_noserver;
}
switch (data->version) {
case 1:
@ -1718,7 +1718,7 @@ static struct super_block *nfs_get_sb(struct file_system_type *fs_type,
dprintk("%s: mount structure version %d does not support NFSv3\n",
__FUNCTION__,
data->version);
goto out_err;
goto out_err_noserver;
}
data->root.size = NFS2_FHSIZE;
memcpy(data->root.data, data->old_root.data, NFS2_FHSIZE);
@ -1727,24 +1727,24 @@ static struct super_block *nfs_get_sb(struct file_system_type *fs_type,
dprintk("%s: mount structure version %d does not support strong security\n",
__FUNCTION__,
data->version);
goto out_err;
goto out_err_noserver;
}
case 5:
memset(data->context, 0, sizeof(data->context));
}
#ifndef CONFIG_NFS_V3
/* If NFSv3 is not compiled in, return -EPROTONOSUPPORT */
s = ERR_PTR(-EPROTONOSUPPORT);
error = -EPROTONOSUPPORT;
if (data->flags & NFS_MOUNT_VER3) {
dprintk("%s: NFSv3 not compiled into kernel\n", __FUNCTION__);
goto out_err;
goto out_err_noserver;
}
#endif /* CONFIG_NFS_V3 */
s = ERR_PTR(-ENOMEM);
error = -ENOMEM;
server = kzalloc(sizeof(struct nfs_server