diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 19:06:25 +0400 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-29 19:06:25 +0400 | 
| commit | 53113b06e48c6c38f7612c1f8043b8a0d2adf72b (patch) | |
| tree | b50f098b72b6389fde956d8272c08169ff2b53cc /fs/nfs/super.c | |
| parent | 37542b6a7e73e81f8c066a48e6911e476ee3b22f (diff) | |
| parent | a4cdbd8bfb87ceff455aae85727077889b75001b (diff) | |
| download | linux-53113b06e48c6c38f7612c1f8043b8a0d2adf72b.tar.xz | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
  ...
Diffstat (limited to 'fs/nfs/super.c')
| -rw-r--r-- | fs/nfs/super.c | 96 | 
1 files changed, 46 insertions, 50 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 3600ec700d58..0a42e8f4adcb 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -260,8 +260,8 @@ static int  nfs_statfs(struct dentry *, struct kstatfs *);  static int  nfs_show_options(struct seq_file *, struct vfsmount *);  static int  nfs_show_stats(struct seq_file *, struct vfsmount *);  static int nfs_get_sb(struct file_system_type *, int, const char *, void *, struct vfsmount *); -static int nfs_xdev_get_sb(struct file_system_type *fs_type, -		int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); +static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type, +		int flags, const char *dev_name, void *raw_data);  static void nfs_put_super(struct super_block *);  static void nfs_kill_super(struct super_block *);  static int nfs_remount(struct super_block *sb, int *flags, char *raw_data); @@ -277,7 +277,7 @@ static struct file_system_type nfs_fs_type = {  struct file_system_type nfs_xdev_fs_type = {  	.owner		= THIS_MODULE,  	.name		= "nfs", -	.get_sb		= nfs_xdev_get_sb, +	.mount		= nfs_xdev_mount,  	.kill_sb	= nfs_kill_super,  	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,  }; @@ -302,14 +302,14 @@ static int nfs4_try_mount(int flags, const char *dev_name,  	struct nfs_parsed_mount_data *data, struct vfsmount *mnt);  static int nfs4_get_sb(struct file_system_type *fs_type,  	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); -static int nfs4_remote_get_sb(struct file_system_type *fs_type, -	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); -static int nfs4_xdev_get_sb(struct file_system_type *fs_type, -	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); +static struct dentry *nfs4_remote_mount(struct file_system_type *fs_type, +	int flags, const char *dev_name, void *raw_data); +static struct dentry *nfs4_xdev_mount(struct file_system_type *fs_type, +	int flags, const char *dev_name, void *raw_data);  static int nfs4_referral_get_sb(struct file_system_type *fs_type,  	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); -static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, -	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt); +static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type, +	int flags, const char *dev_name, void *raw_data);  static void nfs4_kill_super(struct super_block *sb);  static struct file_system_type nfs4_fs_type = { @@ -323,7 +323,7 @@ static struct file_system_type nfs4_fs_type = {  static struct file_system_type nfs4_remote_fs_type = {  	.owner		= THIS_MODULE,  	.name		= "nfs4", -	.get_sb		= nfs4_remote_get_sb, +	.mount		= nfs4_remote_mount,  	.kill_sb	= nfs4_kill_super,  	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,  }; @@ -331,7 +331,7 @@ static struct file_system_type nfs4_remote_fs_type = {  struct file_system_type nfs4_xdev_fs_type = {  	.owner		= THIS_MODULE,  	.name		= "nfs4", -	.get_sb		= nfs4_xdev_get_sb, +	.mount		= nfs4_xdev_mount,  	.kill_sb	= nfs4_kill_super,  	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,  }; @@ -339,7 +339,7 @@ struct file_system_type nfs4_xdev_fs_type = {  static struct file_system_type nfs4_remote_referral_fs_type = {  	.owner		= THIS_MODULE,  	.name		= "nfs4", -	.get_sb		= nfs4_remote_referral_get_sb, +	.mount		= nfs4_remote_referral_mount,  	.kill_sb	= nfs4_kill_super,  	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,  }; @@ -2397,9 +2397,9 @@ static void nfs_kill_super(struct super_block *s)  /*   * Clone an NFS2/3 server record on xdev traversal (FSID-change)   */ -static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, -			   const char *dev_name, void *raw_data, -			   struct vfsmount *mnt) +static struct dentry * +nfs_xdev_mount(struct file_system_type *fs_type, int flags, +		const char *dev_name, void *raw_data)  {  	struct nfs_clone_mount *data = raw_data;  	struct super_block *s; @@ -2411,7 +2411,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,  	};  	int error; -	dprintk("--> nfs_xdev_get_sb()\n"); +	dprintk("--> nfs_xdev_mount()\n");  	/* create a new volume representation */  	server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); @@ -2458,28 +2458,26 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,  	}  	s->s_flags |= MS_ACTIVE; -	mnt->mnt_sb = s; -	mnt->mnt_root = mntroot;  	/* clone any lsm security options from the parent to the new sb */  	security_sb_clone_mnt_opts(data->sb, s); -	dprintk("<-- nfs_xdev_get_sb() = 0\n"); -	return 0; +	dprintk("<-- nfs_xdev_mount() = 0\n"); +	return mntroot;  out_err_nosb:  	nfs_free_server(server);  out_err_noserver: -	dprintk("<-- nfs_xdev_get_sb() = %d [error]\n", error); -	return error; +	dprintk("<-- nfs_xdev_mount() = %d [error]\n", error); +	return ERR_PTR(error);  error_splat_super:  	if (server && !s->s_root)  		bdi_unregister(&server->backing_dev_info);  error_splat_bdi:  	deactivate_locked_super(s); -	dprintk("<-- nfs_xdev_get_sb() = %d [splat]\n", error); -	return error; +	dprintk("<-- nfs_xdev_mount() = %d [splat]\n", error); +	return ERR_PTR(error);  }  #ifdef CONFIG_NFS_V4 @@ -2649,8 +2647,9 @@ out_no_address:  /*   * Get the superblock for the NFS4 root partition   */ -static int nfs4_remote_get_sb(struct file_system_type *fs_type, -	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) +static struct dentry * +nfs4_remote_mount(struct file_system_type *fs_type, int flags, +		  const char *dev_name, void *raw_data)  {  	struct nfs_parsed_mount_data *data = raw_data;  	struct super_block *s; @@ -2714,15 +2713,16 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,  		goto error_splat_root;  	s->s_flags |= MS_ACTIVE; -	mnt->mnt_sb = s; -	mnt->mnt_root = mntroot; -	error = 0; + +	security_free_mnt_opts(&data->lsm_opts); +	nfs_free_fhandle(mntfh); +	return mntroot;  out:  	security_free_mnt_opts(&data->lsm_opts);  out_free_fh:  	nfs_free_fhandle(mntfh); -	return error; +	return ERR_PTR(error);  out_free:  	nfs_free_server(server); @@ -2968,9 +2968,9 @@ static void nfs4_kill_super(struct super_block *sb)  /*   * Clone an NFS4 server record on xdev traversal (FSID-change)   */ -static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags, -			    const char *dev_name, void *raw_data, -			    struct vfsmount *mnt) +static struct dentry * +nfs4_xdev_mount(struct file_system_type *fs_type, int flags, +		 const char *dev_name, void *raw_data)  {  	struct nfs_clone_mount *data = raw_data;  	struct super_block *s; @@ -2982,7 +2982,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,  	};  	int error; -	dprintk("--> nfs4_xdev_get_sb()\n"); +	dprintk("--> nfs4_xdev_mount()\n");  	/* create a new volume representation */  	server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); @@ -3029,32 +3029,30 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,  	}  	s->s_flags |= MS_ACTIVE; -	mnt->mnt_sb = s; -	mnt->mnt_root = mntroot;  	security_sb_clone_mnt_opts(data->sb, s); -	dprintk("<-- nfs4_xdev_get_sb() = 0\n"); -	return 0; +	dprintk("<-- nfs4_xdev_mount() = 0\n"); +	return mntroot;  out_err_nosb:  	nfs_free_server(server);  out_err_noserver: -	dprintk("<-- nfs4_xdev_get_sb() = %d [error]\n", error); -	return error; +	dprintk("<-- nfs4_xdev_mount() = %d [error]\n", error); +	return ERR_PTR(error);  error_splat_super:  	if (server && !s->s_root)  		bdi_unregister(&server->backing_dev_info);  error_splat_bdi:  	deactivate_locked_super(s); -	dprintk("<-- nfs4_xdev_get_sb() = %d [splat]\n", error); -	return error; +	dprintk("<-- nfs4_xdev_mount() = %d [splat]\n", error); +	return ERR_PTR(error);  } -static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, -		int flags, const char *dev_name, void *raw_data, -		struct vfsmount *mnt) +static struct dentry * +nfs4_remote_referral_mount(struct file_system_type *fs_type, int flags, +			   const char *dev_name, void *raw_data)  {  	struct nfs_clone_mount *data = raw_data;  	struct super_block *s; @@ -3118,14 +3116,12 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,  	}  	s->s_flags |= MS_ACTIVE; -	mnt->mnt_sb = s; -	mnt->mnt_root = mntroot;  	security_sb_clone_mnt_opts(data->sb, s);  	nfs_free_fhandle(mntfh);  	dprintk("<-- nfs4_referral_get_sb() = 0\n"); -	return 0; +	return mntroot;  out_err_nosb:  	nfs_free_server(server); @@ -3133,7 +3129,7 @@ out_err_noserver:  	nfs_free_fhandle(mntfh);  out_err_nofh:  	dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error); -	return error; +	return ERR_PTR(error);  error_splat_super:  	if (server && !s->s_root) @@ -3142,7 +3138,7 @@ error_splat_bdi:  	deactivate_locked_super(s);  	nfs_free_fhandle(mntfh);  	dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error); -	return error; +	return ERR_PTR(error);  }  /*  | 
