public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: rick.macklem@gmail.com
To: linux-nfs@vger.kernel.org
Cc: Rick Macklem <rmacklem@uoguelph.ca>
Subject: [PATCH v2 3/8] Add new entries for handling POSIX draft ACLs
Date: Sat,  3 Jan 2026 15:40:27 -0800	[thread overview]
Message-ID: <20260103234033.1256-4-rick.macklem@gmail.com> (raw)
In-Reply-To: <20260103234033.1256-1-rick.macklem@gmail.com>

From: Rick Macklem <rmacklem@uoguelph.ca>

Add structures and definitions for the handling
of POSIX draft ACLs for the NFS client.

Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
---
 include/linux/nfs_xdr.h | 57 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 79fe2dfb470f..e787de158fd9 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1622,6 +1622,54 @@ struct nfs42_removexattrres {
 	struct nfs4_change_info		cinfo;
 };
 
+struct nfs42_getposixaclargs {
+	struct nfs4_sequence_args 	seq_args;
+	struct nfs_fh *			fh;
+	int				mask;
+	struct page **			pages;
+};
+
+struct nfs42_getposixaclres {
+	struct nfs4_sequence_res	seq_res;
+	const struct nfs_server *	server;
+	int				mask;
+	unsigned int			acl_access_count;
+	unsigned int			acl_default_count;
+	struct posix_acl *		acl_access;
+	struct posix_acl *		acl_default;
+};
+
+struct nfs42_setposixaclargs {
+	struct nfs4_sequence_args 	seq_args;
+	struct nfs_fh *			fh;
+	const struct nfs_server *	server;
+	struct inode *			inode;
+	int				mask;
+	struct posix_acl *		acl_access;
+	struct posix_acl *		acl_default;
+	size_t				len;
+	struct page **			pages;
+};
+
+struct nfs42_setposixaclres {
+	struct nfs4_sequence_res	seq_res;
+	const struct nfs_server *	server;
+};
+
+/*
+ * An NFSv4.2 POSIX draft ACL consists of:
+ * - an ACE cnt
+ * - 4 basic ACEs, which usually have a who string of 0 length
+ * - additional ACEs with who strings of up to IDMAP_NAMESZ
+ * - the above are 4byte quantities.
+ * All of the above is multiplied by 2, for the case where a directory
+ * has both a default and access ACL.
+ */
+#define	NFS4_ACL_INLINE_BUFSIZE	(2*(((1+NFS_ACL_MAX_ENTRIES_INLINE*3)*4)+	\
+				 (NFS_ACL_MAX_ENTRIES_INLINE-4)*IDMAP_NAMESZ))
+#define NFS4_ACL_MAXPAGES	(((2*(4+(3*4+IDMAP_NAMESZ)*			\
+				 NFS_ACL_MAX_ENTRIES))+PAGE_SIZE-1)>>PAGE_SHIFT)
+
 #endif /* CONFIG_NFS_V4_2 */
 
 struct nfs_page;
@@ -1765,6 +1813,15 @@ struct nfs_renamedata {
 	bool cancelled;
 };
 
+struct nfs_xdr_putpage_desc {
+	struct page	**pages;
+	void		*p;
+	void		*endp;
+	size_t		npages;
+	size_t		page_pos;
+	size_t		max_npages;
+};
+
 struct nfs_access_entry;
 struct nfs_client;
 struct rpc_timeout;
-- 
2.49.0


  parent reply	other threads:[~2026-01-03 23:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-03 23:40 [PATCH v2 0/8] Add NFSv4.2 POSIX ACL support to the client rick.macklem
2026-01-03 23:40 ` [PATCH v2 1/8] Add definitions for the POSIX draft ACL attributes rick.macklem
2026-01-03 23:40 ` [PATCH v2 2/8] Add entries to the predefined client operations enum rick.macklem
2026-01-03 23:40 ` rick.macklem [this message]
2026-01-03 23:40 ` [PATCH v2 4/8] Make posix_acl_from_nfsacl() global rick.macklem
2026-01-03 23:40 ` [PATCH v2 5/8] Make three functions global and move them to acl.c rick.macklem
2026-01-03 23:40 ` [PATCH v2 6/8] Make nfs4_server_supports_acls() global rick.macklem
2026-01-03 23:40 ` [PATCH v2 7/8] Set SB_POSIXACL if the server supports the extension rick.macklem
2026-01-05 22:00   ` Anna Schumaker
2026-01-05 23:56     ` Rick Macklem
2026-01-03 23:40 ` [PATCH v2 8/8] Add support for the NFSv4.2 POSIX draft ACL attributes rick.macklem

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=20260103234033.1256-4-rick.macklem@gmail.com \
    --to=rick.macklem@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rmacklem@uoguelph.ca \
    /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