Linux NFS development
 help / color / mirror / Atom feed
From: bjschuma@netapp.com
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2 03/12] NFS: Split out NFS v4 inode operations
Date: Mon, 16 Jul 2012 16:39:12 -0400	[thread overview]
Message-ID: <1342471161-22452-4-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>

The NFS v4 file inode operations are already already in nfs4proc.c, so
this patch just needs to move the directory operations to the same file.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/dir.c      | 33 +++------------------------------
 fs/nfs/nfs4_fs.h  |  5 ++++-
 fs/nfs/nfs4proc.c | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e75f2aa..d49f1b9 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -63,33 +63,6 @@ const struct address_space_operations nfs_dir_aops = {
 	.freepage = nfs_readdir_clear_array,
 };
 
-#ifdef CONFIG_NFS_V4
-
-static int nfs_atomic_open(struct inode *, struct dentry *,
-			   struct file *, unsigned, umode_t,
-			   int *);
-const struct inode_operations nfs4_dir_inode_operations = {
-	.create		= nfs_create,
-	.lookup		= nfs_lookup,
-	.atomic_open	= nfs_atomic_open,
-	.link		= nfs_link,
-	.unlink		= nfs_unlink,
-	.symlink	= nfs_symlink,
-	.mkdir		= nfs_mkdir,
-	.rmdir		= nfs_rmdir,
-	.mknod		= nfs_mknod,
-	.rename		= nfs_rename,
-	.permission	= nfs_permission,
-	.getattr	= nfs_getattr,
-	.setattr	= nfs_setattr,
-	.getxattr	= generic_getxattr,
-	.setxattr	= generic_setxattr,
-	.listxattr	= generic_listxattr,
-	.removexattr	= generic_removexattr,
-};
-
-#endif /* CONFIG_NFS_V4 */
-
 static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir, struct rpc_cred *cred)
 {
 	struct nfs_open_dir_context *ctx;
@@ -1352,9 +1325,9 @@ out:
 	return err;
 }
 
-static int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
-			    struct file *file, unsigned open_flags,
-			    umode_t mode, int *opened)
+int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
+		    struct file *file, unsigned open_flags,
+		    umode_t mode, int *opened)
 {
 	struct nfs_open_context *ctx;
 	struct dentry *res;
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 3696ca7..e2c4c72 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -200,7 +200,10 @@ struct nfs4_state_maintenance_ops {
 };
 
 extern const struct dentry_operations nfs4_dentry_operations;
-extern const struct inode_operations nfs4_dir_inode_operations;
+
+/* dir.c */
+int nfs_atomic_open(struct inode *, struct dentry *, struct file *,
+		    unsigned, umode_t, int *);
 
 /* write.c */
 int nfs4_write_inode(struct inode *, struct writeback_control *);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 80bb505..689cb43 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6813,6 +6813,26 @@ const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] = {
 #endif
 };
 
+const struct inode_operations nfs4_dir_inode_operations = {
+	.create		= nfs_create,
+	.lookup		= nfs_lookup,
+	.atomic_open	= nfs_atomic_open,
+	.link		= nfs_link,
+	.unlink		= nfs_unlink,
+	.symlink	= nfs_symlink,
+	.mkdir		= nfs_mkdir,
+	.rmdir		= nfs_rmdir,
+	.mknod		= nfs_mknod,
+	.rename		= nfs_rename,
+	.permission	= nfs_permission,
+	.getattr	= nfs_getattr,
+	.setattr	= nfs_setattr,
+	.getxattr	= generic_getxattr,
+	.setxattr	= generic_setxattr,
+	.listxattr	= generic_listxattr,
+	.removexattr	= generic_removexattr,
+};
+
 static const struct inode_operations nfs4_file_inode_operations = {
 	.permission	= nfs_permission,
 	.getattr	= nfs_getattr,
-- 
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 ` bjschuma [this message]
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 ` [PATCH v2 10/12] NFS: Create a single nfs_clone_super() function bjschuma
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-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox