All of lore.kernel.org
 help / color / mirror / Atom feed
From: bjschuma@netapp.com
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2 10/12] NFS: Create a single nfs_clone_super() function
Date: Mon, 16 Jul 2012 16:39:19 -0400	[thread overview]
Message-ID: <1342471161-22452-11-git-send-email-bjschuma@netapp.com> (raw)
In-Reply-To: <1342471161-22452-1-git-send-email-bjschuma@netapp.com>

From: Bryan Schumaker <bjschuma@netapp.com>

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>
---
 fs/nfs/super.c | 32 ++++++--------------------------
 1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 9bad4e7..ca3c0e8 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2218,7 +2218,7 @@ static void nfs_fill_super(struct super_block *sb,
 }
 
 /*
- * Finish setting up a cloned NFS2/3 superblock
+ * Finish setting up a cloned NFS2/3/4 superblock
  */
 static void nfs_clone_super(struct super_block *sb,
 			    struct nfs_mount_info *mount_info)
@@ -2229,16 +2229,17 @@ static void nfs_clone_super(struct super_block *sb,
 	sb->s_blocksize_bits = old_sb->s_blocksize_bits;
 	sb->s_blocksize = old_sb->s_blocksize;
 	sb->s_maxbytes = old_sb->s_maxbytes;
+	sb->s_xattr = old_sb->s_xattr;
+	sb->s_op = old_sb->s_op;
+	sb->s_time_gran = 1;
 
-	if (server->nfs_client->rpc_ops->version == 3) {
+	if (server->nfs_client->rpc_ops->version != 2) {
 		/* The VFS shouldn't apply the umask to mode bits. We will do
 		 * so ourselves when necessary.
 		 */
 		sb->s_flags |= MS_POSIXACL;
-		sb->s_time_gran = 1;
 	}
 
-	sb->s_op = old_sb->s_op;
  	nfs_initialise_sb(sb);
 }
 
@@ -2580,27 +2581,6 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags,
 #ifdef CONFIG_NFS_V4
 
 /*
- * Finish setting up a cloned NFS4 superblock
- */
-static void nfs4_clone_super(struct super_block *sb,
-			     struct nfs_mount_info *mount_info)
-{
-	const struct super_block *old_sb = mount_info->cloned->sb;
-	sb->s_blocksize_bits = old_sb->s_blocksize_bits;
-	sb->s_blocksize = old_sb->s_blocksize;
-	sb->s_maxbytes = old_sb->s_maxbytes;
-	sb->s_time_gran = 1;
-	sb->s_op = old_sb->s_op;
-	/*
-	 * The VFS shouldn't apply the umask to mode bits. We will do
-	 * so ourselves when necessary.
-	 */
-	sb->s_flags  |= MS_POSIXACL;
-	sb->s_xattr  = old_sb->s_xattr;
-	nfs_initialise_sb(sb);
-}
-
-/*
  * Set up an NFS4 superblock
  */
 static void nfs4_fill_super(struct super_block *sb,
@@ -2883,7 +2863,7 @@ nfs4_xdev_mount(struct file_system_type *fs_type, int flags,
 		 const char *dev_name, void *raw_data)
 {
 	struct nfs_mount_info mount_info = {
-		.fill_super = nfs4_clone_super,
+		.fill_super = nfs_clone_super,
 		.set_security = nfs_clone_sb_security,
 		.cloned = raw_data,
 	};
-- 
1.7.11.2


  parent reply	other threads:[~2012-07-16 20:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16 20:39 [PATCH v200/12] NFS: Split out version-specific code bjschuma
2012-07-16 20:39 ` [PATCH v2 01/12] NFS: Split out NFS v2 inode operations bjschuma
2012-07-16 20:39 ` [PATCH v2 02/12] NFS: Split out NFS v3 " bjschuma
2012-07-16 20:39 ` [PATCH v2 03/12] NFS: Split out NFS v4 " bjschuma
2012-07-16 20:39 ` [PATCH v2 04/12] NFS: Create an init_nfs_v4() function bjschuma
2012-07-17 19:11   ` [PATCH v3 " Bryan Schumaker
2012-07-17 19:13     ` Myklebust, Trond
2012-07-16 20:39 ` [PATCH v2 05/12] NFS: Initialize v4 sysctls from nfs_init_v4() bjschuma
2012-07-16 20:39 ` [PATCH v2 06/12] NFS: Split out NFS v4 file operations bjschuma
2012-07-16 20:39 ` [PATCH v2 07/12] NFS: Move the v4 getroot code to nfs4getroot.c bjschuma
2012-07-16 20:39 ` [PATCH v2 08/12] NFS: Initialize the NFS v4 client from init_nfs_v4() bjschuma
2012-07-16 20:39 ` [PATCH v2 09/12] NFS: Split out NFS v4 server creating code bjschuma
2012-07-16 20:39 ` bjschuma [this message]
2012-07-16 20:39 ` [PATCH v2 11/12] NFS: Split out the NFS v4 filesystem types bjschuma
2012-07-16 20:39 ` [PATCH v2 12/12] NFS: Split out NFS v4 client functions bjschuma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342471161-22452-11-git-send-email-bjschuma@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.