Re: [PATCH 0/8] Support btime and other NFSv4 specific attributes

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

 



On Thu, 2022-01-06 at 09:31 +0000, Ondrej Valousek wrote:
> Looks like this should do I guess...
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 5a93a5db4fb0..be47e1dd6da5 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -3265,6 +3265,14 @@ nfsd4_encode_fattr(struct xdr_stream *xdr,
> struct svc_fh *fhp,
>                 p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec);
>                 *p++ = cpu_to_be32(stat.mtime.tv_nsec);
>         }
> +       /* support for btime here */
> +        if (bmval1 & FATTR4_WORD1_TIME_CREATE) {
> +                p = xdr_reserve_space(xdr, 12);
> +                if (!p)
> +                        goto out_resource;
> +                p = xdr_encode_hyper(p, (s64)stat.btime.tv_sec);
> +                *p++ = cpu_to_be32(stat.btime.tv_nsec);
> +        }
>         if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) {
>                 struct kstat parent_stat;
>                 u64 ino = stat.ino;
> 

You also need to update the value of NFSD4_SUPPORTED_ATTRS_WORD1 to
reflect the new support for FATTR4_WORD1_TIME_CREATE.


-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux