summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJ. Bruce Fields2018-04-25 19:26:23 +0200
committerJ. Bruce Fields2018-06-17 16:41:31 +0200
commita85857633b04d57f4524cca0a2bfaf87b2543f9f (patch)
tree3ee6fe22387608309977b5cc7576107ddae67ff7 /fs/nfsd/nfs4xdr.c
parentnfsd: fix NFSv4 time_delta attribute (diff)
downloadkernel-qcow2-linux-a85857633b04d57f4524cca0a2bfaf87b2543f9f.tar.gz
kernel-qcow2-linux-a85857633b04d57f4524cca0a2bfaf87b2543f9f.tar.xz
kernel-qcow2-linux-a85857633b04d57f4524cca0a2bfaf87b2543f9f.zip
nfsd4: support change_attr_type attribute
The change attribute is what is used by clients to revalidate their caches. Our server may use i_version or ctime for that purpose. Those choices behave slightly differently, and it may be useful to the client to know which we're using. This attribute tells the client that. The Linux client doesn't yet use this attribute yet, though. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 4161031ae14e..fb4991889f89 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2891,6 +2891,16 @@ out_acl:
goto out;
}
+ if (bmval2 & FATTR4_WORD2_CHANGE_ATTR_TYPE) {
+ p = xdr_reserve_space(xdr, 4);
+ if (!p)
+ goto out_resource;
+ if (IS_I_VERSION(d_inode(dentry)))
+ *p++ = cpu_to_be32(NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR);
+ else
+ *p++ = cpu_to_be32(NFS4_CHANGE_TYPE_IS_TIME_METADATA);
+ }
+
if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) {
status = nfsd4_encode_security_label(xdr, rqstp, context,
contextlen);