Skip to contentSkip to conversation

nfs: provide pnfs_report_layoutstat when NFS42 is disabled

PATCH New Peng Tao 1 participant 1 message Jun 25, 2015

Subsystems (2)
lore
Share & tools
lore

Peng Tao

author
#0 lore raw

PATCH 1/1 nfs: provide pnfs_report_layoutstat when NFS42 is disabled

kbuild test robot reported:
fs/built-in.o: In function `pnfs_report_layoutstat':

Quoted 1 line
Quoted 1 line

(.text+0x151a1c): undefined reference to `nfs42_proc_layoutstats_generic'

---
 fs/nfs/pnfs.c |  2 ++
 fs/nfs/pnfs.h | 12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
fs/nfs/pnfs.c +2 -0
index e5bd626..546cbbe 100644
@@ -2249,6 +2249,7 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void)
 	return thp;
 }
 
+#if IS_ENABLED(CONFIG_NFS_V4_2)
 int
 pnfs_report_layoutstat(struct inode *inode)
 {
@@ -2303,3 +2304,4 @@ out_put:
 	goto out;
 }
 EXPORT_SYMBOL_GPL(pnfs_report_layoutstat);
+#endif
fs/nfs/pnfs.h +10 -2
index 0a47239..3e6ab7b 100644
@@ -292,8 +292,6 @@ int pnfs_write_done_resend_to_mds(struct nfs_pgio_header *);
 struct nfs4_threshold *pnfs_mdsthreshold_alloc(void);
 void pnfs_error_mark_layout_for_return(struct inode *inode,
 				       struct pnfs_layout_segment *lseg);
-int pnfs_report_layoutstat(struct inode *inode);
-
 /* nfs4_deviceid_flags */
 enum {
 	NFS_DEVICEID_INVALID = 0,       /* set when MDS clientid recalled */
@@ -692,4 +690,14 @@ static inline void nfs4_pnfs_v3_ds_connect_unload(void)
 
 #endif /* CONFIG_NFS_V4_1 */
 
+#if IS_ENABLED(CONFIG_NFS_V4_2)
+int pnfs_report_layoutstat(struct inode *inode);
+#else
+static inline int
+pnfs_report_layoutstat(struct inode *inode)
+{
+	return 0;
+}
+#endif
+
 #endif /* FS_NFS_PNFS_H */
Signature · 1 line
1.8.3.1