Loading fs/nfsd/nfs4xdr.c +26 −20 Original line number Diff line number Diff line Loading @@ -2541,6 +2541,20 @@ static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode, return p; } static __be32 nfsd4_encode_nfstime4(struct xdr_stream *xdr, struct timespec64 *tv) { __be32 *p; p = xdr_reserve_space(xdr, XDR_UNIT * 3); if (!p) return nfserr_resource; p = xdr_encode_hyper(p, (s64)tv->tv_sec); *p = cpu_to_be32(tv->tv_nsec); return nfs_ok; } /* * ctime (in NFSv4, time_metadata) is not writeable, and the client * doesn't really care what resolution could theoretically be stored by Loading Loading @@ -3352,11 +3366,9 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p = xdr_encode_hyper(p, dummy64); } if (bmval1 & FATTR4_WORD1_TIME_ACCESS) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.atime.tv_sec); *p++ = cpu_to_be32(stat.atime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.atime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_TIME_DELTA) { p = xdr_reserve_space(xdr, 12); Loading @@ -3365,25 +3377,19 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p = encode_time_delta(p, d_inode(dentry)); } if (bmval1 & FATTR4_WORD1_TIME_METADATA) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.ctime.tv_sec); *p++ = cpu_to_be32(stat.ctime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.ctime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_TIME_MODIFY) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec); *p++ = cpu_to_be32(stat.mtime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.mtime); if (status) goto out; } 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); status = nfsd4_encode_nfstime4(xdr, &stat.btime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) { u64 ino = stat.ino; Loading Loading
fs/nfsd/nfs4xdr.c +26 −20 Original line number Diff line number Diff line Loading @@ -2541,6 +2541,20 @@ static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode, return p; } static __be32 nfsd4_encode_nfstime4(struct xdr_stream *xdr, struct timespec64 *tv) { __be32 *p; p = xdr_reserve_space(xdr, XDR_UNIT * 3); if (!p) return nfserr_resource; p = xdr_encode_hyper(p, (s64)tv->tv_sec); *p = cpu_to_be32(tv->tv_nsec); return nfs_ok; } /* * ctime (in NFSv4, time_metadata) is not writeable, and the client * doesn't really care what resolution could theoretically be stored by Loading Loading @@ -3352,11 +3366,9 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p = xdr_encode_hyper(p, dummy64); } if (bmval1 & FATTR4_WORD1_TIME_ACCESS) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.atime.tv_sec); *p++ = cpu_to_be32(stat.atime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.atime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_TIME_DELTA) { p = xdr_reserve_space(xdr, 12); Loading @@ -3365,25 +3377,19 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p = encode_time_delta(p, d_inode(dentry)); } if (bmval1 & FATTR4_WORD1_TIME_METADATA) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.ctime.tv_sec); *p++ = cpu_to_be32(stat.ctime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.ctime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_TIME_MODIFY) { p = xdr_reserve_space(xdr, 12); if (!p) goto out_resource; p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec); *p++ = cpu_to_be32(stat.mtime.tv_nsec); status = nfsd4_encode_nfstime4(xdr, &stat.mtime); if (status) goto out; } 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); status = nfsd4_encode_nfstime4(xdr, &stat.btime); if (status) goto out; } if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) { u64 ino = stat.ino; Loading