NFSv4: add declaration of current_stateid
diff mbox series

Message ID 20191015121953.14905-1-ben.dooks@codethink.co.uk
State New
Headers show
Series
  • NFSv4: add declaration of current_stateid
Related show

Commit Message

Ben Dooks (Codethink) Oct. 15, 2019, 12:19 p.m. UTC
The current_stateid is exported from nfs4state.c but not
declared in any of the headers. Add to nfs4_fs.h to
remove the following warning:

fs/nfs/nfs4state.c:80:20: warning: symbol 'current_stateid' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 fs/nfs/nfs4_fs.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Oct. 15, 2019, 4:31 p.m. UTC | #1
On Tue, Oct 15, 2019 at 01:19:53PM +0100, Ben Dooks wrote:
> The current_stateid is exported from nfs4state.c but not
> declared in any of the headers. Add to nfs4_fs.h to
> remove the following warning:

I think you also need to remove the extern in pnfs.c as well.

Also nfs4_stateid_is_current has a local variable with the same name,
so you might want to rename that so that we don't get symbol shadowing
warnings.
Ben Dooks (Codethink) Oct. 16, 2019, 4:27 p.m. UTC | #2
On 15/10/2019 17:31, Christoph Hellwig wrote:
> On Tue, Oct 15, 2019 at 01:19:53PM +0100, Ben Dooks wrote:
>> The current_stateid is exported from nfs4state.c but not
>> declared in any of the headers. Add to nfs4_fs.h to
>> remove the following warning:
> 
> I think you also need to remove the extern in pnfs.c as well.

ok, thanks, will sort.

> Also nfs4_stateid_is_current has a local variable with the same name,
> so you might want to rename that so that we don't get symbol shadowing
> warnings.
> 
ok, will do.

Patch
diff mbox series

diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 16b2e5cc3e94..330f45268060 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -445,6 +445,8 @@  extern void nfs4_set_lease_period(struct nfs_client *clp,
 
 
 /* nfs4state.c */
+extern const nfs4_stateid current_stateid;
+
 const struct cred *nfs4_get_clid_cred(struct nfs_client *clp);
 const struct cred *nfs4_get_machine_cred(struct nfs_client *clp);
 const struct cred *nfs4_get_renew_cred(struct nfs_client *clp);