[PATCH] nfsd: Fix v2-only build regression
From: Daniel Thompson
Date: Mon Feb 16 2015 - 06:36:27 EST
Currently if nfsd is configured as v2 only then the kernel fails to build.
This is a regression introduced by 9cf514ccfacb("nfsd: implement pNFS
operations"). It occurs because inline code from the xdr4.h header is
now included from generic nfsd code (via pnfs.h).
This patch takes the simplest route and makes conditional the problematic
inline function.
Note: I also tried extending the #ifdef CONFIG_NFSD_PNFS to cover almost
all of the pnfs.h header file. That works great too but feels more
invasive. However I can dust this off if that were preferable for
any reason.
Signed-off-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: J. Bruce Fields <bfields@xxxxxxxxxxxx>
---
fs/nfsd/xdr4.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 0bda93e58e1b..960a75d921c0 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -627,6 +627,7 @@ void warn_on_nonidempotent_op(struct nfsd4_op *op);
#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
+#ifdef CONFIG_NFSD_V3
static inline void
set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
{
@@ -642,6 +643,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
}
+#endif
int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/