summaryrefslogtreecommitdiff
path: root/fs/nfsd/state.h
diff options
context:
space:
mode:
authorDai Ngo <dai.ngo@oracle.com>2023-09-13 16:38:20 -0700
committerChuck Lever <chuck.lever@oracle.com>2023-10-16 12:44:08 -0400
commit738401a9bd1ac34ccd5723d69640a4adbb1a4bc0 (patch)
tree3c6cc4f0f2f87b7feb4f7b794c92d0ebb4ccdd2a /fs/nfsd/state.h
parent15d39883ee7dfc023d8a24f5d4b58100e1d04ad9 (diff)
NFSD: add support for CB_GETATTR callback
Includes: . CB_GETATTR proc for nfs4_cb_procedures[] . XDR encoding and decoding function for CB_GETATTR request/reply . add nfs4_cb_fattr to nfs4_delegation for sending CB_GETATTR and store file attributes from client's reply. Signed-off-by: Dai Ngo <dai.ngo@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r--fs/nfsd/state.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index cbddcf484dba..82718d42f3b2 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -117,6 +117,16 @@ struct nfs4_cpntf_state {
time64_t cpntf_time; /* last time stateid used */
};
+struct nfs4_cb_fattr {
+ struct nfsd4_callback ncf_getattr;
+ u32 ncf_cb_status;
+ u32 ncf_cb_bmap[1];
+
+ /* from CB_GETATTR reply */
+ u64 ncf_cb_change;
+ u64 ncf_cb_fsize;
+};
+
/*
* Represents a delegation stateid. The nfs4_client holds references to these
* and they are put when it is being destroyed or when the delegation is
@@ -150,6 +160,9 @@ struct nfs4_delegation {
int dl_retries;
struct nfsd4_callback dl_recall;
bool dl_recalled;
+
+ /* for CB_GETATTR */
+ struct nfs4_cb_fattr dl_cb_fattr;
};
#define cb_to_delegation(cb) \
@@ -642,6 +655,7 @@ enum nfsd4_cb_op {
NFSPROC4_CLNT_CB_SEQUENCE,
NFSPROC4_CLNT_CB_NOTIFY_LOCK,
NFSPROC4_CLNT_CB_RECALL_ANY,
+ NFSPROC4_CLNT_CB_GETATTR,
};
/* Returns true iff a is later than b: */