diff options
| author | Bryan Schumaker <bjschuma@netapp.com> | 2012-07-16 16:39:19 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-17 13:33:54 -0400 |
| commit | 3cadf4b864cab9d19b935289c004799d1065cd03 (patch) | |
| tree | 0c35594b1d6f0fd0e2204df4e3a731c5e0eb7352 | |
| parent | fcf10398f641c4450119f8a4cc27e9e584edb010 (diff) | |
NFS: Create a single nfs_clone_super() function
v2 and v3 shared a function for this, but v4 implemented something only
slightly different. Might as well share code whenever possible...
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| -rw-r--r-- | fs/nfs/super.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 9bad4e753066..ca3c0e8cf774 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -2218,7 +2218,7 @@ static void nfs_fill_super(struct super_block *sb, | |||
| 2218 | } | 2218 | } |
| 2219 | 2219 | ||
| 2220 | /* | 2220 | /* |
| 2221 | * Finish setting up a cloned NFS2/3 superblock | 2221 | * Finish setting up a cloned NFS2/3/4 superblock |
| 2222 | */ | 2222 | */ |
| 2223 | static void nfs_clone_super(struct super_block *sb, | 2223 | static void nfs_clone_super(struct super_block *sb, |
| 2224 | struct nfs_mount_info *mount_info) | 2224 | struct nfs_mount_info *mount_info) |
| @@ -2229,16 +2229,17 @@ static void nfs_clone_super(struct super_block *sb, | |||
| 2229 | sb->s_blocksize_bits = old_sb->s_blocksize_bits; | 2229 | sb->s_blocksize_bits = old_sb->s_blocksize_bits; |
| 2230 | sb->s_blocksize = old_sb->s_blocksize; | 2230 | sb->s_blocksize = old_sb->s_blocksize; |
| 2231 | sb->s_maxbytes = old_sb->s_maxbytes; | 2231 | sb->s_maxbytes = old_sb->s_maxbytes; |
| 2232 | sb->s_xattr = old_sb->s_xattr; | ||
| 2233 | sb->s_op = old_sb->s_op; | ||
| 2234 | sb->s_time_gran = 1; | ||
| 2232 | 2235 | ||
| 2233 | if (server->nfs_client->rpc_ops->version == 3) { | 2236 | if (server->nfs_client->rpc_ops->version != 2) { |
| 2234 | /* The VFS shouldn't apply the umask to mode bits. We will do | 2237 | /* The VFS shouldn't apply the umask to mode bits. We will do |
| 2235 | * so ourselves when necessary. | 2238 | * so ourselves when necessary. |
| 2236 | */ | 2239 | */ |
| 2237 | sb->s_flags |= MS_POSIXACL; | 2240 | sb->s_flags |= MS_POSIXACL; |
| 2238 | sb->s_time_gran = 1; | ||
| 2239 | } | 2241 | } |
| 2240 | 2242 | ||
| 2241 | sb->s_op = old_sb->s_op; | ||
| 2242 | nfs_initialise_sb(sb); | 2243 | nfs_initialise_sb(sb); |
| 2243 | } | 2244 | } |
| 2244 | 2245 | ||
| @@ -2580,27 +2581,6 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, | |||
| 2580 | #ifdef CONFIG_NFS_V4 | 2581 | #ifdef CONFIG_NFS_V4 |
| 2581 | 2582 | ||
| 2582 | /* | 2583 | /* |
| 2583 | * Finish setting up a cloned NFS4 superblock | ||
| 2584 | */ | ||
| 2585 | static void nfs4_clone_super(struct super_block *sb, | ||
| 2586 | struct nfs_mount_info *mount_info) | ||
| 2587 | { | ||
| 2588 | const struct super_block *old_sb = mount_info->cloned->sb; | ||
| 2589 | sb->s_blocksize_bits = old_sb->s_blocksize_bits; | ||
| 2590 | sb->s_blocksize = old_sb->s_blocksize; | ||
| 2591 | sb->s_maxbytes = old_sb->s_maxbytes; | ||
| 2592 | sb->s_time_gran = 1; | ||
| 2593 | sb->s_op = old_sb->s_op; | ||
| 2594 | /* | ||
| 2595 | * The VFS shouldn't apply the umask to mode bits. We will do | ||
| 2596 | * so ourselves when necessary. | ||
| 2597 | */ | ||
| 2598 | sb->s_flags |= MS_POSIXACL; | ||
| 2599 | sb->s_xattr = old_sb->s_xattr; | ||
| 2600 | nfs_initialise_sb(sb); | ||
| 2601 | } | ||
| 2602 | |||
| 2603 | /* | ||
| 2604 | * Set up an NFS4 superblock | 2584 | * Set up an NFS4 superblock |
| 2605 | */ | 2585 | */ |
| 2606 | static void nfs4_fill_super(struct super_block *sb, | 2586 | static void nfs4_fill_super(struct super_block *sb, |
| @@ -2883,7 +2863,7 @@ nfs4_xdev_mount(struct file_system_type *fs_type, int flags, | |||
| 2883 | const char *dev_name, void *raw_data) | 2863 | const char *dev_name, void *raw_data) |
| 2884 | { | 2864 | { |
| 2885 | struct nfs_mount_info mount_info = { | 2865 | struct nfs_mount_info mount_info = { |
| 2886 | .fill_super = nfs4_clone_super, | 2866 | .fill_super = nfs_clone_super, |
| 2887 | .set_security = nfs_clone_sb_security, | 2867 | .set_security = nfs_clone_sb_security, |
| 2888 | .cloned = raw_data, | 2868 | .cloned = raw_data, |
| 2889 | }; | 2869 | }; |
