diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2021-05-08 00:30:56 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2021-05-08 00:30:56 +0000 |
commit | dd02d9d605b6d8849e858d7644bb84b45c606b46 (patch) | |
tree | ba002a822879e5159e94fe6dba82b4192b7f9649 /sys/fs/nfsserver/nfs_nfsdserv.c | |
parent | 5a4333a5378f7afe4f8cab293a987865ae0c32c4 (diff) | |
download | src-dd02d9d605b6d8849e858d7644bb84b45c606b46.tar.gz src-dd02d9d605b6d8849e858d7644bb84b45c606b46.zip |
nfscl: Add support for va_birthtime to NFSv4
There is a NFSv4 file attribute called TimeCreate
that can be used for va_birthtime.
r362175 added some support for use of TimeCreate.
This patch completes support of va_birthtime by adding
support for setting this attribute to the server.
It also eanbles the client to
acquire and set the attribute for a NFSv4
server that supports the attribute.
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30156
Diffstat (limited to 'sys/fs/nfsserver/nfs_nfsdserv.c')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdserv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 0c4fcebb8e05..8aa39e5018d9 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -492,6 +492,15 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram, } } if (!nd->nd_repstat && + NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_TIMECREATE)) { + NFSVNO_ATTRINIT(&nva2); + NFSVNO_SETATTRVAL(&nva2, btime, nva.na_btime); + nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p, + exp); + if (!nd->nd_repstat) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_TIMECREATE); + } + if (!nd->nd_repstat && (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE) || NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))) { NFSVNO_ATTRINIT(&nva2); |