linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bjschuma@netapp.com
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, Bryan Schumaker <bjschuma@netapp.com>
Subject: [PATCH 11/44] NFS: Switch to using the IS_ENABLED macro for CONFIG_NFS_V3
Date: Fri, 13 Jan 2012 15:10:20 -0500	[thread overview]
Message-ID: <1326485453-1350-12-git-send-email-bjschuma@netapp.com> (raw)
In-Reply-To: <1326485453-1350-1-git-send-email-bjschuma@netapp.com>

From: Bryan Schumaker <bjschuma@netapp.com>

Just checking if CONFIG_NFS_V3 is defined will check if v3 is built in
to the kernel.  Instead, we'll want to check if it is either built in OR
a module (CONFIG_NFS_V3_MODULE).  This macro will do both.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/client.c        |    6 +++---
 fs/nfs/dir.c           |    2 +-
 fs/nfs/direct.c        |    2 +-
 fs/nfs/file.c          |    2 +-
 fs/nfs/super.c         |    6 +++---
 fs/nfs/write.c         |    8 ++++----
 include/linux/nfs_fs.h |    6 +++---
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 3f36e6e..20cfc99 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -123,13 +123,13 @@ struct rpc_stat nfs_rpcstat = {
  * Once everything has been converted this function will
  * be removed.
  */
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 static void nfs_module_null_function(void)
 {
 }
 #endif
 
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 static struct nfs_subversion nfs_v3_mod = {
 	.version  = 3,
 	.rpc_vers = &nfs_version3,
@@ -238,7 +238,7 @@ EXPORT_SYMBOL_GPL(unregister_nfs_version);
  */
 void __init nfs_register_versions(void)
 {
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 	register_nfs_version(&nfs_v3_mod);
 #endif
 #ifdef CONFIG_NFS_V4
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index a5e3a36..96bcfa3 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -80,7 +80,7 @@ const struct address_space_operations nfs_dir_aops = {
 	.freepage = nfs_readdir_clear_array,
 };
 
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 const struct inode_operations nfs3_dir_inode_operations = {
 	.create		= nfs_create,
 	.lookup		= nfs_lookup,
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 1940f1a..7aa353c 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -460,7 +460,7 @@ static void nfs_direct_free_writedata(struct nfs_direct_req *dreq)
 	}
 }
 
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
 {
 	struct inode *inode = dreq->inode;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 4ac4dae..d11bb90 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -44,7 +44,7 @@
 
 static const struct vm_operations_struct nfs_file_vm_ops;
 
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 const struct inode_operations nfs3_file_inode_operations = {
 	.permission	= nfs_permission,
 	.getattr	= nfs_getattr,
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index aee7b00..2889a70 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -68,7 +68,7 @@
 
 #define NFSDBG_FACILITY		NFSDBG_VFS
 
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 #define NFS_DEFAULT_VERSION 3
 #else
 #define NFS_DEFAULT_VERSION 2
@@ -1908,7 +1908,7 @@ static int nfs_validate_mount_data(void *options,
 		}
 	}
 
-#ifndef CONFIG_NFS_V3
+#if !IS_ENABLED(CONFIG_NFS_V3)
 	if (args->version == 3)
 		goto out_v3_not_compiled;
 #endif /* !CONFIG_NFS_V3 */
@@ -1928,7 +1928,7 @@ out_no_sec:
 	dfprintk(MOUNT, "NFS: nfs_mount_data version supports only AUTH_SYS\n");
 	return -EINVAL;
 
-#ifndef CONFIG_NFS_V3
+#if !IS_ENABLED(CONFIG_NFS_V3)
 out_v3_not_compiled:
 	dfprintk(MOUNT, "NFS: NFSv3 is not compiled into kernel\n");
 	return -EPROTONOSUPPORT;
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 0c38852..1e92376 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -431,7 +431,7 @@ nfs_mark_request_dirty(struct nfs_page *req)
 	__set_page_dirty_nobuffers(req->wb_page);
 }
 
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 /*
  * Add a request to the inode's commit list.
  */
@@ -516,7 +516,7 @@ int nfs_reschedule_unstable_write(struct nfs_page *req,
 }
 #endif
 
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 static int
 nfs_need_commit(struct nfs_inode *nfsi)
 {
@@ -1238,7 +1238,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
 		return;
 	nfs_add_stats(data->inode, NFSIOS_SERVERWRITTENBYTES, resp->count);
 
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 	if (resp->verf->committed < argp->stable && task->tk_status >= 0) {
 		/* We tried a write call, but the server did not
 		 * commit data to stable storage even though we
@@ -1297,7 +1297,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
 }
 
 
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
 {
 	int ret;
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 92ecf55..666ebea 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -406,7 +406,7 @@ extern __be32 root_nfs_parse_addr(char *name); /*__init*/
  * linux/fs/nfs/file.c
  */
 extern const struct inode_operations nfs_file_inode_operations;
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 extern const struct inode_operations nfs3_file_inode_operations;
 #endif /* CONFIG_NFS_V3 */
 extern const struct file_operations nfs_file_operations;
@@ -464,7 +464,7 @@ extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
  * linux/fs/nfs/dir.c
  */
 extern const struct inode_operations nfs_dir_inode_operations;
-#ifdef CONFIG_NFS_V3
+#if IS_ENABLED(CONFIG_NFS_V3)
 extern const struct inode_operations nfs3_dir_inode_operations;
 #endif /* CONFIG_NFS_V3 */
 extern const struct file_operations nfs_dir_operations;
@@ -524,7 +524,7 @@ extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
 extern int nfs_wb_all(struct inode *inode);
 extern int nfs_wb_page(struct inode *inode, struct page* page);
 extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
-#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+#if IS_ENABLED(CONFIG_NFS_V3) || IS_ENABLED(CONFIG_NFS_V4)
 extern int  nfs_commit_inode(struct inode *, int);
 extern struct nfs_write_data *nfs_commitdata_alloc(void);
 extern void nfs_commit_free(struct nfs_write_data *wdata);
-- 
1.7.8.3


  parent reply	other threads:[~2012-01-13 20:11 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 20:10 [PATCH 00/44] NFS: Create NFS Modules bjschuma
2012-01-13 20:10 ` [PATCH 01/44] NFS: ifndef guard internal.h bjschuma
2012-01-13 20:10 ` [PATCH 02/44] NFS: Relocate the stat_to_errno() function bjschuma
2012-01-13 20:10 ` [PATCH 03/44] NFS: Make v2 configurable bjschuma
2012-01-13 20:10 ` [PATCH 04/44] NFS: Add version registering framework bjschuma
2012-01-13 20:10 ` [PATCH 05/44] NFS: Move v2 to new subdirectory bjschuma
2012-01-13 20:10 ` [PATCH 06/44] NFS: Export symbols needed by a v2 module bjschuma
2012-01-13 20:10 ` [PATCH 07/44] NFS: Convert NFS v2 into a module bjschuma
2012-01-13 20:10 ` [PATCH 08/44] NFS: Created custom init_aclclient() functions bjschuma
2012-01-13 20:10 ` [PATCH 09/44] NFS: Move v3 to its own subdirectory bjschuma
2012-01-13 20:10 ` [PATCH 10/44] NFS: Export symbols needed by a v3 module bjschuma
2012-01-13 20:10 ` bjschuma [this message]
2012-01-13 20:10 ` [PATCH 12/44] NFS: Convert NFS v3 into a module bjschuma
2012-01-13 20:10 ` [PATCH 13/44] NFS: Remove unused code bjschuma
2012-01-13 20:10 ` [PATCH 14/44] NFS: Move v4 to its own subdirectory bjschuma
2012-01-13 20:10 ` [PATCH 15/44] NFS: Move init_aclclient() into the v4 subdirectory bjschuma
2012-01-13 20:10 ` [PATCH 16/44] NFS: Create a version-specific do_submount() function bjschuma
2012-01-13 20:10 ` [PATCH 17/44] NFS: Added in a custom do_clone_mount() function bjschuma
2012-01-13 20:10 ` [PATCH 18/44] NFS: Give versions a custom have_delegation() function bjschuma
2012-01-13 20:10 ` [PATCH 19/44] NFS: Give versions a custom have_delegated_attributes() function bjschuma
2012-01-13 20:10 ` [PATCH 20/44] NFS: Give versions a custom return_delegation() function bjschuma
2012-01-13 20:10 ` [PATCH 21/44] NFS: Add a function to run when shutting down a client bjschuma
2012-01-13 20:10 ` [PATCH 22/44] NFS: Split nfs_fs_mount() into two functions bjschuma
2012-01-13 20:10 ` [PATCH 23/44] NFS: Create a custom try_mount() function for each version bjschuma
2012-01-13 20:10 ` [PATCH 24/44] NFS: Create a separate valadet_text_mount_data() function bjschuma
2012-01-13 20:10 ` [PATCH 25/44] NFS: Create a custom validate_mount_data() function bjschuma
2012-01-13 20:10 ` [PATCH 26/44] NFS: Create an idr_lock to protect the cb_idr bjschuma
2012-01-13 20:10 ` [PATCH 27/44] NFS: Create a custom alloc_client() function bjschuma
2012-01-13 20:10 ` [PATCH 28/44] NFS: Create a custom put_client() function bjschuma
2012-01-13 20:10 ` [PATCH 29/44] NFS: Create the nfs4/module.c file bjschuma
2012-01-13 20:10 ` [PATCH 30/44] NFS: Move over NFS v4 sysctls bjschuma
2012-01-13 20:10 ` [PATCH 31/44] NFS: Move v4 getroot code to the v4 directory bjschuma
2012-01-13 20:10 ` [PATCH 32/44] NFS: Move a v4 block from inode.c bjschuma
2012-01-13 20:10 ` [PATCH 33/44] NFS: Move over the v4_file_operations structure bjschuma
2012-01-13 20:10 ` [PATCH 34/44] NFS: Move v4-only functions from dir.c bjschuma
2012-01-13 20:10 ` [PATCH 35/44] NFS: Register the v4 filesystem type from nfs4/module.c bjschuma
2012-01-13 20:10 ` [PATCH 36/44] NFS: Export functions from super.c bjschuma
2012-01-13 20:10 ` [PATCH 37/44] NFS: Move v4 super code to the nfs4/ directory bjschuma
2012-01-13 20:10 ` [PATCH 38/44] NFS: Only initialize pnfs in the v4.x case bjschuma
2012-01-13 20:10 ` [PATCH 39/44] NFS: Create accessor functions for the nfs_client_list() bjschuma
2012-01-13 20:10 ` [PATCH 40/44] NFS: Export functions from client.c bjschuma
2012-01-13 20:10 ` [PATCH 41/44] NFS: Move v4 client.c code to nfs4/client.c bjschuma
2012-01-13 20:10 ` [PATCH 42/44] NFS: Switch to using IS_ENABLED macro for CONFIG_NFS_V4 bjschuma
2012-01-13 20:10 ` [PATCH 43/44] NFS: Export functions needed by a v4 module bjschuma
2012-01-13 20:48   ` Chuck Lever
2012-01-13 21:05     ` Bryan Schumaker
2012-01-13 21:12       ` Bryan Schumaker
2012-01-13 21:25         ` Chuck Lever
2012-01-13 21:36           ` Bryan Schumaker
2012-01-14  0:55       ` NeilBrown
2012-01-13 20:10 ` [PATCH 44/44] NFS: Convert NFS v4 into a module 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=1326485453-1350-12-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;
as well as URLs for NNTP newsgroup(s).