Skip to contentSkip to conversation

NFSv4.2: Fix warning unused SSC variables from kernel test robot.

PATCH New Dai Ngo 1 participant 1 message Apr 19, 2021

Subsystems (2)
lore
Share & tools
lore

Dai Ngo

author reviewer
#0 lore raw

PATCH 1/1 NFSv4.2: Fix warning unused SSC variables from kernel test robot.

Compiler warning unused variables when NFS_V4_2 is configured and NFSD_V4 is not:

fs/nfs/super.c:90:40: warning: unused variable 'nfs_ssc_clnt_ops_tbl' static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {

fs/nfs/nfs4file.c:410:41: warning: unused variable 'nfs4_ssc_clnt_ops_tbl' static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {

Fix by moving nfs_ssc_clnt_ops_tbl and nfs4_ssc_clnt_ops_tbl to under NFSD_V4 since they are only used when NFSD_V4 is configured.

---
 fs/nfs/nfs4file.c | 2 ++
 fs/nfs/super.c    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/nfs/nfs4file.c +2 -0
index 441a2fa073c8..400c8db05808 100644
@@ -313,6 +313,7 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
 	return ret < 0 ? ret : count;
 }
 
+#ifdef CONFIG_NFSD_V4
 static int read_name_gen = 1;
 #define SSC_READ_NAME_BODY "ssc_read_%d"
 
@@ -411,6 +412,7 @@ static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {
 	.sco_open = __nfs42_ssc_open,
 	.sco_close = __nfs42_ssc_close,
 };
+#endif	/* CONFIG_NFSD_V4 */
 
 /**
  * nfs42_ssc_register_ops - Wrapper to register NFS_V4 ops in nfs_common
fs/nfs/super.c +1 -1
index 94885c6f8f54..a7af01bad344 100644
@@ -86,7 +86,7 @@ const struct super_operations nfs_sops = {
 };
 EXPORT_SYMBOL_GPL(nfs_sops);
 
-#ifdef CONFIG_NFS_V4_2
+#ifdef CONFIG_NFSD_V4
 static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
 	.sco_sb_deactive = nfs_sb_deactive,
 };
Signature · 1 line
2.9.5