On 5/16/16, 16:55, "Anna Schumaker" <Anna.Schumaker@xxxxxxxxxx> wrote: >Hi Trond, > >On 05/16/2016 02:47 PM, Trond Myklebust wrote: >> In order to more easily distinguish what kind of stateid we are dealing >> with, introduce a type that can be used to label the stateid structure. >> >> The label will be useful both for debugging, but also when dealing with >> operations like SETATTR, READ and WRITE that can take several different >> types of stateid as arguments. >> >> Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> >> --- >> fs/nfs/callback_xdr.c | 18 ++++++++++--- >> fs/nfs/flexfilelayout/flexfilelayout.c | 7 +++--- >> fs/nfs/flexfilelayout/flexfilelayoutdev.c | 3 ++- >> fs/nfs/nfs4_fs.h | 7 ++++-- >> fs/nfs/nfs4proc.c | 3 +++ >> fs/nfs/nfs4state.c | 5 +++- >> fs/nfs/nfs4xdr.c | 42 ++++++++++++++++++++++++------- >> include/linux/nfs4.h | 25 ++++++++++++++---- >> 8 files changed, 86 insertions(+), 24 deletions(-) >> >> diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c >> index 976c90608e56..3a1dcee29861 100644 > ><snip> > > >> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c >> index 88474a4fc669..7a24c92d1672 100644 >> --- a/fs/nfs/nfs4xdr.c >> +++ b/fs/nfs/nfs4xdr.c >> @@ -4270,6 +4270,30 @@ static int decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) >> return decode_opaque_fixed(xdr, stateid, NFS4_STATEID_SIZE); >> } >> >> +static int decode_open_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) >> +{ >> + stateid->type = NFS4_OPEN_STATEID_TYPE; >> + return decode_stateid(xdr, stateid); >> +} >> + >> +static int decode_lock_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) >> +{ >> + stateid->type = NFS4_LOCK_STATEID_TYPE; >> + return decode_stateid(xdr, stateid); >> +} >> + >> +static int decode_delegation_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) >> +{ >> + stateid->type = NFS4_DELEGATION_STATEID_TYPE; >> + return decode_stateid(xdr, stateid); >> +} >> + >> +static int decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) >> +{ >> + stateid->type = NFS4_LAYOUT_STATEID_TYPE; >> + return decode_stateid(xdr, stateid); >> +} > >Can you wrap decode_layout_stateid() in an #ifdef CONFIG_NFS_V4_1 check? Otherwise I get warnings when I compile without v4.1 enabled: > > > CC [M] fs/nfs/nfs3acl.o > LD [M] fs/nfs/nfsv3.o > CC [M] fs/nfs/nfs4proc.o > CC [M] fs/nfs/nfs4xdr.o >fs/nfs/nfs4xdr.c:4291:12: warning: 'decode_layout_stateid' defined but not used [-Wunused-function] > static int decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) > ^~~~~~~~~~~~~~~~~~~~~ > CC [M] fs/nfs/nfs4state.o > CC [M] fs/nfs/nfs4renewd.o > CC [M] fs/nfs/nfs4super.o > CC [M] fs/nfs/nfs4file.o > CC [M] fs/nfs/delegation.o > CC [M] fs/nfs/nfs4idmap.o > CC [M] fs/nfs/callback.o > CC [M] fs/nfs/callback_xdr.o >fs/nfs/callback_xdr.c:159:15: warning: 'decode_layout_stateid' defined but not used [-Wunused-function] > static __be32 decode_layout_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) > ^~~~~~~~~~~~~~~~~~~~~ > CC [M] fs/nfs/callback_proc.o > CC [M] fs/nfs/nfs4namespace.o > Duh… Please look for the v2 series. Thanks Trond ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥