[pnfs] [PATCH] Fix compilations errors when CONFIG_PNFS is not set.

Ricardo Labiaga ricardo.labiaga at netapp.com
Thu Oct 18 23:29:26 EDT 2007


---
 fs/nfs/nfs4filelayoutdev.c  |    1 -
 fs/nfs/nfs4xdr.c            |    4 ++++
 fs/nfsd/nfs4filelayoutxdr.c |    4 +++-
 fs/nfsd/nfs4pnfsds.c        |    2 ++
 fs/nfsd/nfs4proc.c          |    2 ++
 fs/nfsd/nfs4state.c         |    2 ++
 include/linux/nfs4.h        |    2 --
 7 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 117ec33..4725976 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -209,7 +209,6 @@ nfs4_pnfs_device_add(struct filelayout_mount_type *mt,
 		     struct nfs4_pnfs_dev_item *dev)
 {
 	struct nfs4_pnfs_dev_item *tmp_dev;
-	int err;
 	struct nfs4_pnfs_dev_hlist *hlist = mt->hlist;
 
 	dprintk("nfs4_pnfs_device_add\n");
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 6af10bd..a84156b 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4167,6 +4167,7 @@ static int verify_attr_len(struct xdr_stream *xdr, __be32 *savep, uint32_t attrl
 	return 0;
 }
 
+#ifdef CONFIG_PNFS
 /*
  * Decode potentially multiple layout types. Currently we only support
  * one layout driver per file system.
@@ -4212,6 +4213,7 @@ static int decode_attr_pnfstype(struct xdr_stream *xdr, uint32_t *bitmap, uint32
         }
         return status;
 }
+#endif /* CONFIG_PNFS */
 
 static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
 {
@@ -4463,7 +4465,9 @@ static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo)
 	if ((status = decode_attr_maxwrite(xdr, bitmap, &fsinfo->wtmax)) != 0)
 		goto xdr_error;
 	fsinfo->wtpref = fsinfo->wtmax;
+#ifdef CONFIG_PNFS
 	if ((status = decode_attr_pnfstype(xdr, bitmap, &fsinfo->layoutclass)) != 0)
+#endif /* CONFIG_PNFS */
 	goto xdr_error;
 
 	status = verify_attr_len(xdr, savep, attrlen);
diff --git a/fs/nfsd/nfs4filelayoutxdr.c b/fs/nfsd/nfs4filelayoutxdr.c
index 88756ed..553e114 100644
--- a/fs/nfsd/nfs4filelayoutxdr.c
+++ b/fs/nfsd/nfs4filelayoutxdr.c
@@ -33,6 +33,8 @@
 *
 *
 */
+
+#if defined (CONFIG_PNFS)
 #include <linux/module.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
@@ -212,4 +214,4 @@ filelayout_free_layout(void *layout)
 	kfree(flp->lg_llist);
 }
 EXPORT_SYMBOL(filelayout_free_layout);
-
+#endif /* CONFIG_PNFS */
diff --git a/fs/nfsd/nfs4pnfsds.c b/fs/nfsd/nfs4pnfsds.c
index fe1a854..3f60fa6 100644
--- a/fs/nfsd/nfs4pnfsds.c
+++ b/fs/nfsd/nfs4pnfsds.c
@@ -151,6 +151,7 @@ find_pnfs_ds_stateid(stateid_t *stid)
 	return NULL;
 }
 
+/*
 static void
 release_mds_id(struct pnfs_mds_id *mdp)
 {
@@ -181,6 +182,7 @@ release_ds_stateid(struct pnfs_ds_stateid *dsp)
 	list_del(&dsp->ds_perclid);
 	kfree (dsp);
 }
+*/
 
 static struct pnfs_mds_id *
 alloc_init_mds_id(struct pnfs_get_state *gsp)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 2874ac4..2fd7d62 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -99,11 +99,13 @@ char *nfsd4_op_names[] = {
         OP(EXCHANGE_ID),
         OP(CREATE_SESSION),
         OP(DESTROY_SESSION),
+#ifdef CONFIG_PNFS
         OP(GETDEVICEINFO),
         OP(GETDEVICELIST),
         OP(LAYOUTCOMMIT),
         OP(LAYOUTGET),
         OP(LAYOUTRETURN),
+#endif /* CONFIG_PNFS */
         OP(SEQUENCE),
 };
 #undef OP
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 21169a6..0483fb4 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1779,6 +1779,7 @@ find_file(struct inode *ino)
 	return NULL;
 }
 
+#if defined(CONFIG_PNFS)
 static struct nfs4_file *
 find_alloc_file(struct inode *ino, struct svc_fh *current_fh)
 {
@@ -1790,6 +1791,7 @@ find_alloc_file(struct inode *ino, struct svc_fh *current_fh)
 
 	return alloc_init_file(ino, current_fh);
 }
+#endif /* CONFIG_PNFS */
 
 #if defined(CONFIG_NFSD_V4_1)
 static int access_valid(u32 x)
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 8634a56..1ba5771 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -185,12 +185,10 @@ enum nfs_opnum4 {
 	OP_CREATE_SESSION = 43,
 	OP_DESTROY_SESSION = 44,
 	OP_GETDEVICEINFO = 47,
-#if defined (CONFIG_PNFS)
 	OP_GETDEVICELIST = 48,
 	OP_LAYOUTCOMMIT = 49,
 	OP_LAYOUTGET = 50,
 	OP_LAYOUTRETURN = 51,
-#endif /* CONFIG_PNFS */
 	OP_SEQUENCE = 53,
 #endif /* CONFIG_NFS_V4_1 */
 	OP_ILLEGAL = 10044,
-- 
1.5.2


More information about the pNFS mailing list