RE: [PATCH 08/11] NFSv4: Simplify the struct nfs4_stateid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




On Mon, 2012-03-05 at 11:31 -0500, Peter Staubach wrote:
> Comment intermixed below...
> 
>  
> 
>  
> 
> -----Original Message-----
> From: linux-nfs-owner@xxxxxxxxxxxxxxx
> [mailto:linux-nfs-owner@xxxxxxxxxxxxxxx] On Behalf Of Trond Myklebust
> Sent: Sunday, March 04, 2012 6:03 PM
> To: linux-nfs@xxxxxxxxxxxxxxx
> Subject: [PATCH 08/11] NFSv4: Simplify the struct nfs4_stateid
> 
>  
> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
> 
> ---
> 
> fs/nfs/nfs4_fs.h     |    4 ++--
> 
> fs/nfs/nfs4proc.c    |    8 ++++----
> 
> fs/nfs/nfs4state.c   |    4 ++--
> 
> fs/nfs/nfs4xdr.c     |    6 +++---
> 
> fs/nfs/pnfs.c        |   10 +++++-----
> 
> include/linux/nfs4.h |    7 ++-----
> 
> 6 files changed, 18 insertions(+), 21 deletions(-)
> 
>  
> 
> diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index
> f4cafab..4b4e48b 100644
> 
> --- a/fs/nfs/nfs4_fs.h
> 
> +++ b/fs/nfs/nfs4_fs.h
> 
> @@ -349,12 +349,12 @@ extern struct svc_version
> nfs4_callback_version4;
> 
>  static inline void nfs4_stateid_copy(nfs4_stateid *dst, const
> nfs4_stateid *src)  {
> 
> -              memcpy(dst->data, src->data, sizeof(dst->data));
> 
> +             memcpy(dst, src, sizeof(*dst));
> 
> }
> 
>  static inline bool nfs4_stateid_match(const nfs4_stateid *dst, const
> nfs4_stateid *src)  {
> 
> -              return memcmp(dst->data, src->data, sizeof(dst->data))
> == 0;
> 
> +             return memcmp(dst, src, sizeof(*dst)) == 0;
> 
> }
> 
>  #else
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index
> 3e65766..5d90dc8 100644
> 
> --- a/fs/nfs/nfs4proc.c
> 
> +++ b/fs/nfs/nfs4proc.c
> 
> @@ -6257,13 +6257,13 @@ static int nfs41_free_stateid(struct
> nfs_server *server, nfs4_stateid *stateid)  static bool
> nfs41_match_stateid(const nfs4_stateid *s1,
> 
>                                const nfs4_stateid *s2)
> 
> {
> 
> -              if (memcmp(s1->stateid.other, s2->stateid.other,
> 
> -                                 sizeof(s1->stateid.other)) != 0)
> 
> +             if (memcmp(s1->other, s2->other,
> 
> +                                sizeof(s1->other)) != 0)
> 
>                                return false;
> 
> -              if (s1->stateid.seqid == s2->stateid.seqid)
> 
> +             if (s1->seqid == s2->seqid)
> 
>                                return true;
> 
> -              if (s1->stateid.seqid == 0 || s1->stateid.seqid == 0)
> 
> +             if (s1->seqid == 0 || s1->seqid == 0)
> 
> > 
> 
> > Is this test correct?  Or should the second s1 be s2?

Oops... Thanks for spotting that! I'll fix it up in v3...

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Photo]     [Yosemite Info]    [Yosemite Photos]    [POF Sucks]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux