From: Jeff Layton <jlayton@kernel.org>
To: Calum Mackay <calum.mackay@oracle.com>
Cc: linux-nfs@vger.kernel.org, Jeff Layton <jlayton@kernel.org>
Subject: [PATCH pynfs v2 6/7] nfs4.1: add support for the "delstid" draft
Date: Mon, 14 Oct 2024 16:50:26 -0400 [thread overview]
Message-ID: <20241014-cb_getattr-v2-6-3782e0d7c598@kernel.org> (raw)
In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org>
Add the new .x snippet to nfs4.x, and the necessary info about the new
attributes.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/nfs4lib.py | 3 +
nfs4.1/server41tests/environment.py | 3 +
nfs4.1/xdrdef/nfs4.x | 111 ++++++++++++++++++++++++++++++++++--
3 files changed, 113 insertions(+), 4 deletions(-)
diff --git a/nfs4.1/nfs4lib.py b/nfs4.1/nfs4lib.py
index b1a247b02f66a529da7f2bd98ec436f168b30873..d3a1550f1ce1e135b124a59fa1518c9ff89fd502 100644
--- a/nfs4.1/nfs4lib.py
+++ b/nfs4.1/nfs4lib.py
@@ -731,5 +731,8 @@ attr_info = { FATTR4_SUPPORTED_ATTRS : A("r", "fs"),
FATTR4_MODE_SET_MASKED : A("w", "obj"),
FATTR4_FS_CHARSET_CAP : A("r", "fs"),
FATTR4_XATTR_SUPPORT : A("r", "obj"),
+ FATTR4_TIME_DELEG_ACCESS : A("w", "obj"),
+ FATTR4_TIME_DELEG_MODIFY : A("w", "obj"),
+ FATTR4_OPEN_ARGUMENTS : A("r", "fs"),
}
del A
diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 0b7c976d8582a0e4ef5bd1d21ce34247f26899e4..48284e029634fff60b7690e058cd4131bfea9b08 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -108,6 +108,9 @@ class Environment(testmod.Environment):
AttrInfo('time_modify_set', 'w', settime4(0)),
AttrInfo('mounted_on_fileid', 'r', 0),
AttrInfo('xattr_support', 'r', False),
+ AttrInfo('time_deleg_access', 'r', nfstime4(0, 0)),
+ AttrInfo('time_deleg_modify', 'r', nfstime4(0, 0)),
+ AttrInfo('open_arguments', 'r', open_arguments4()),
]
home = property(lambda s: use_obj(s.opts.home))
diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
index 7b4e755369d749c2570a624895c234b1454df0cb..ee3da8aa7a342e4d3829f4b1b1f82543275199c5 100644
--- a/nfs4.1/xdrdef/nfs4.x
+++ b/nfs4.1/xdrdef/nfs4.x
@@ -1742,10 +1742,12 @@ const
= 0x20000;
enum open_delegation_type4 {
- OPEN_DELEGATE_NONE = 0,
- OPEN_DELEGATE_READ = 1,
- OPEN_DELEGATE_WRITE = 2,
- OPEN_DELEGATE_NONE_EXT = 3 /* new to v4.1 */
+ OPEN_DELEGATE_NONE = 0,
+ OPEN_DELEGATE_READ = 1,
+ OPEN_DELEGATE_WRITE = 2,
+ OPEN_DELEGATE_NONE_EXT = 3, /* new to v4.1 */
+ OPEN_DELEGATE_READ_ATTRS_DELEG = 4,
+ OPEN_DELEGATE_WRITE_ATTRS_DELEG = 5
};
enum open_claim_type4 {
@@ -1921,8 +1923,10 @@ switch (open_delegation_type4 delegation_type) {
case OPEN_DELEGATE_NONE:
void;
case OPEN_DELEGATE_READ:
+ case OPEN_DELEGATE_READ_ATTRS_DELEG:
open_read_delegation4 read;
case OPEN_DELEGATE_WRITE:
+ case OPEN_DELEGATE_WRITE_ATTRS_DELEG:
open_write_delegation4 write;
case OPEN_DELEGATE_NONE_EXT: /* new to v4.1 */
open_none_delegation4 od_whynone;
@@ -3949,3 +3953,102 @@ program NFS4_CALLBACK {
CB_COMPOUND(CB_COMPOUND4args) = 1;
} = 1;
} = 0x40000000;
+
+/*
+ * The following content was extracted from draft-ietf-nfsv4-delstid
+ */
+
+typedef bool fattr4_offline;
+
+
+const FATTR4_OFFLINE = 83;
+
+
+struct open_arguments4 {
+ bitmap4 oa_share_access;
+ bitmap4 oa_share_deny;
+ bitmap4 oa_share_access_want;
+ bitmap4 oa_open_claim;
+ bitmap4 oa_create_mode;
+};
+
+
+enum open_args_share_access4 {
+ OPEN_ARGS_SHARE_ACCESS_READ = 1,
+ OPEN_ARGS_SHARE_ACCESS_WRITE = 2,
+ OPEN_ARGS_SHARE_ACCESS_BOTH = 3
+};
+
+
+enum open_args_share_deny4 {
+ OPEN_ARGS_SHARE_DENY_NONE = 0,
+ OPEN_ARGS_SHARE_DENY_READ = 1,
+ OPEN_ARGS_SHARE_DENY_WRITE = 2,
+ OPEN_ARGS_SHARE_DENY_BOTH = 3
+};
+
+
+enum open_args_share_access_want4 {
+ OPEN_ARGS_SHARE_ACCESS_WANT_ANY_DELEG = 3,
+ OPEN_ARGS_SHARE_ACCESS_WANT_NO_DELEG = 4,
+ OPEN_ARGS_SHARE_ACCESS_WANT_CANCEL = 5,
+ OPEN_ARGS_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL
+ = 17,
+ OPEN_ARGS_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED
+ = 18,
+ OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 20,
+ OPEN_ARGS_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 21
+};
+
+
+enum open_args_open_claim4 {
+ OPEN_ARGS_OPEN_CLAIM_NULL = 0,
+ OPEN_ARGS_OPEN_CLAIM_PREVIOUS = 1,
+ OPEN_ARGS_OPEN_CLAIM_DELEGATE_CUR = 2,
+ OPEN_ARGS_OPEN_CLAIM_DELEGATE_PREV = 3,
+ OPEN_ARGS_OPEN_CLAIM_FH = 4,
+ OPEN_ARGS_OPEN_CLAIM_DELEG_CUR_FH = 5,
+ OPEN_ARGS_OPEN_CLAIM_DELEG_PREV_FH = 6
+};
+
+
+enum open_args_createmode4 {
+ OPEN_ARGS_CREATEMODE_UNCHECKED4 = 0,
+ OPEN_ARGS_CREATE_MODE_GUARDED = 1,
+ OPEN_ARGS_CREATEMODE_EXCLUSIVE4 = 2,
+ OPEN_ARGS_CREATE_MODE_EXCLUSIVE4_1 = 3
+};
+
+
+typedef open_arguments4 fattr4_open_arguments;
+
+
+%/*
+% * Determine what OPEN supports.
+% */
+const FATTR4_OPEN_ARGUMENTS = 86;
+
+
+const OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION = 0x200000;
+
+
+const OPEN4_RESULT_NO_OPEN_STATEID = 0x00000010;
+
+
+/*
+ * attributes for the delegation times being
+ * cached and served by the "client"
+ */
+typedef nfstime4 fattr4_time_deleg_access;
+typedef nfstime4 fattr4_time_deleg_modify;
+
+
+%/*
+% * New RECOMMENDED Attribute for
+% * delegation caching of times
+% */
+const FATTR4_TIME_DELEG_ACCESS = 84;
+const FATTR4_TIME_DELEG_MODIFY = 85;
+
+
+const OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS = 0x100000;
--
2.47.0
next prev parent reply other threads:[~2024-10-14 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 20:50 [PATCH pynfs v2 0/7] pynfs: add CB_GETATTR tests and tests for delegated timestamps Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 1/7] WRT18: have it also check the ctime between writes Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 2/7] DELEG2: fix write delegation test to open the file RW Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 3/7] pynfs: update maintainer info Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 4/7] nfs4.1: add two CB_GETATTR tests Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 5/7] nfs4.1: default to minorversion 2 Jeff Layton
2024-10-15 13:43 ` Chuck Lever III
2024-10-15 14:23 ` Jeff Layton
2024-10-15 19:20 ` Chuck Lever III
2024-10-14 20:50 ` Jeff Layton [this message]
2024-10-14 20:50 ` [PATCH pynfs v2 7/7] st_deleg: test delegated timestamps in CB_GETATTR Jeff Layton
2024-10-14 21:24 ` [PATCH pynfs v2 0/7] pynfs: add CB_GETATTR tests and tests for delegated timestamps Calum Mackay
2024-10-22 21:56 ` Calum Mackay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014-cb_getattr-v2-6-3782e0d7c598@kernel.org \
--to=jlayton@kernel.org \
--cc=calum.mackay@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox