All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allison Collins <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v8 15/39] xfsprogs: move the legacy xfs_attr_list to xfs_ioctl.c
Date: Fri,  3 Apr 2020 15:09:34 -0700	[thread overview]
Message-ID: <20200403220958.4944-16-allison.henderson@oracle.com> (raw)
In-Reply-To: <20200403220958.4944-1-allison.henderson@oracle.com>

The old xfs_attr_list code is only used by the attrlist by handle
ioctl.  Move it to xfs_ioctl.c with its user.  Also move the
attrlist and attrlist_ent structure to xfs_fs.h, as they are exposed
user ABIs.  They are used through libattr headers with the same name
by at least xfsdump.  Also document this relation so that it doesn't
require a research project to figure out.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Allison Collins <allison.henderson@oracle.com>
---
 libxfs/xfs_attr.h | 23 -----------------------
 libxfs/xfs_fs.h   | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h
index 31c0ffd..0e3c213 100644
--- a/libxfs/xfs_attr.h
+++ b/libxfs/xfs_attr.h
@@ -49,27 +49,6 @@ struct xfs_attr_list_context;
 #define	ATTR_MAX_VALUELEN	(64*1024)	/* max length of a value */
 
 /*
- * Define how lists of attribute names are returned to the user from
- * the attr_list() call.  A large, 32bit aligned, buffer is passed in
- * along with its size.  We put an array of offsets at the top that each
- * reference an attrlist_ent_t and pack the attrlist_ent_t's at the bottom.
- */
-typedef struct attrlist {
-	__s32	al_count;	/* number of entries in attrlist */
-	__s32	al_more;	/* T/F: more attrs (do call again) */
-	__s32	al_offset[1];	/* byte offsets of attrs [var-sized] */
-} attrlist_t;
-
-/*
- * Show the interesting info about one attribute.  This is what the
- * al_offset[i] entry points to.
- */
-typedef struct attrlist_ent {	/* data from attr_list() */
-	__u32	a_valuelen;	/* number bytes in value of attr */
-	char	a_name[1];	/* attr name (NULL terminated) */
-} attrlist_ent_t;
-
-/*
  * Kernel-internal version of the attrlist cursor.
  */
 typedef struct attrlist_cursor_kern {
@@ -131,8 +110,6 @@ int xfs_attr_get(struct xfs_da_args *args);
 int xfs_attr_set(struct xfs_da_args *args);
 int xfs_attr_set_args(struct xfs_da_args *args);
 int xfs_attr_remove_args(struct xfs_da_args *args);
-int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize,
-		  int flags, struct attrlist_cursor_kern *cursor);
 bool xfs_attr_namecheck(const void *name, size_t length);
 
 #endif	/* __XFS_ATTR_H__ */
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index e362fc8..51a688f 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -593,6 +593,26 @@ typedef struct xfs_attrlist_cursor {
 	__u32		opaque[4];
 } xfs_attrlist_cursor_t;
 
+/*
+ * Define how lists of attribute names are returned to userspace from the
+ * XFS_IOC_ATTRLIST_BY_HANDLE ioctl.  struct xfs_attrlist is the header at the
+ * beginning of the returned buffer, and a each entry in al_offset contains the
+ * relative offset of an xfs_attrlist_ent containing the actual entry.
+ *
+ * NOTE: struct xfs_attrlist must match struct attrlist defined in libattr, and
+ * struct xfs_attrlist_ent must match struct attrlist_ent defined in libattr.
+ */
+struct xfs_attrlist {
+	__s32	al_count;	/* number of entries in attrlist */
+	__s32	al_more;	/* T/F: more attrs (do call again) */
+	__s32	al_offset[1];	/* byte offsets of attrs [var-sized] */
+};
+
+struct xfs_attrlist_ent {	/* data from attr_list() */
+	__u32	a_valuelen;	/* number bytes in value of attr */
+	char	a_name[1];	/* attr name (NULL terminated) */
+};
+
 typedef struct xfs_fsop_attrlist_handlereq {
 	struct xfs_fsop_handlereq	hreq; /* handle interface structure */
 	struct xfs_attrlist_cursor	pos; /* opaque cookie, list offset */
-- 
2.7.4


  parent reply	other threads:[~2020-04-03 22:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 22:09 [PATCH v8 00/39] xfsprogs: Delay Ready Attributes Allison Collins
2020-04-03 22:09 ` [PATCH v8 01/39] xfsprogs: remove the ATTR_INCOMPLETE flag Allison Collins
2020-04-03 22:09 ` [PATCH v8 02/39] xfsprogs: merge xfs_attr_remove into xfs_attr_set Allison Collins
2020-04-03 22:09 ` [PATCH v8 03/39] xfsprogs: remove the name == NULL check from xfs_attr_args_init Allison Collins
2020-04-03 22:09 ` [PATCH v8 04/39] xfsprogs: remove the MAXNAMELEN " Allison Collins
2020-04-03 22:09 ` [PATCH v8 05/39] xfsprogs: turn xfs_da_args.value into a void pointer Allison Collins
2020-04-03 22:09 ` [PATCH v8 06/39] xfsprogs: pass an initialized xfs_da_args structure to xfs_attr_set Allison Collins
2020-04-03 22:09 ` [PATCH v8 07/39] xfsprogs: pass an initialized xfs_da_args to xfs_attr_get Allison Collins
2020-04-03 22:09 ` [PATCH v8 08/39] xfsprogs: remove the xfs_inode argument to xfs_attr_get_ilocked Allison Collins
2020-04-03 22:09 ` [PATCH v8 09/39] xfsprogs: remove ATTR_KERNOVAL Allison Collins
2020-04-03 22:09 ` [PATCH v8 10/39] xfsprogs: remove ATTR_ALLOC and XFS_DA_OP_ALLOCVAL Allison Collins
2020-04-03 22:09 ` [PATCH v8 11/39] xfsprogs: replace ATTR_KERNOTIME with XFS_DA_OP_NOTIME Allison Collins
2020-04-03 22:09 ` [PATCH v8 12/39] xfsprogs: factor out a xfs_attr_match helper Allison Collins
2020-04-03 22:09 ` [PATCH v8 13/39] xfsprogs: cleanup struct xfs_attr_list_context Allison Collins
2020-04-03 22:09 ` [PATCH v8 14/39] xfsprogs: remove the unused ATTR_ENTRY macro Allison Collins
2020-04-03 22:09 ` Allison Collins [this message]
2020-04-03 22:09 ` [PATCH v8 16/39] xfsprogs: rename xfs_attr_list_int to xfs_attr_list Allison Collins
2020-04-03 22:09 ` [PATCH v8 17/39] xfsprogs: clean up the ATTR_REPLACE checks Allison Collins
2020-04-03 22:09 ` [PATCH v8 18/39] xfsprogs: clean up the attr flag confusion Allison Collins
2020-04-03 22:09 ` [PATCH v8 19/39] xfsprogs: embedded the attrlist cursor into struct xfs_attr_list_context Allison Collins
2020-04-03 22:09 ` [PATCH v8 20/39] xfsprogs: Add xfs_has_attr and subroutines Allison Collins
2020-04-03 22:09 ` [PATCH v8 21/39] xfsprogs: Check for -ENOATTR or -EEXIST Allison Collins
2020-04-03 22:09 ` [PATCH v8 22/39] xfsprogs: Factor out new helper functions xfs_attr_rmtval_set Allison Collins
2020-04-03 22:09 ` [PATCH v8 23/39] xfsprogs: Pull up trans handling in xfs_attr3_leaf_flipflags Allison Collins
2020-04-03 22:09 ` [PATCH v8 24/39] xfsprogs: Split apart xfs_attr_leaf_addname Allison Collins
2020-04-03 22:09 ` [PATCH v8 25/39] xfsprogs: Refactor xfs_attr_try_sf_addname Allison Collins
2020-04-03 22:09 ` [PATCH v8 26/39] xfsprogs: Pull up trans roll from xfs_attr3_leaf_setflag Allison Collins
2020-04-03 22:09 ` [PATCH v8 27/39] xfsprogs: Factor out xfs_attr_rmtval_invalidate Allison Collins
2020-04-03 22:09 ` [PATCH v8 28/39] xfsprogs: Pull up trans roll in xfs_attr3_leaf_clearflag Allison Collins
2020-04-03 22:09 ` [PATCH v8 29/39] xfsprogs: Add helper function __xfs_attr_rmtval_remove Allison Collins
2020-04-03 22:09 ` [PATCH v8 30/39] xfsprogs: Add helper function xfs_attr_node_shrink Allison Collins
2020-04-03 22:09 ` [PATCH v8 31/39] xfsprogs: Removed unneeded xfs_trans_roll_inode calls Allison Collins
2020-04-03 22:09 ` [PATCH v8 32/39] xfsprogs: Add helpers xfs_attr_is_shortform and xfs_attr_set_shortform Allison Collins
2020-04-03 22:09 ` [PATCH v8 33/39] xfsprogs: Add helper function xfs_attr_leaf_mark_incomplete Allison Collins
2020-04-03 22:09 ` [PATCH v8 34/39] xfsprogs: Add remote block helper functions Allison Collins
2020-04-03 22:09 ` [PATCH v8 35/39] xfsprogs: Add helper function xfs_attr_node_removename_setup Allison Collins
2020-04-03 22:09 ` [PATCH v8 36/39] xfsprogs: Add helper function xfs_attr_node_removename_rmt Allison Collins
2020-04-03 22:09 ` [PATCH v8 37/39] xfsprogs: Add delay ready attr remove routines Allison Collins
2020-04-03 22:09 ` [PATCH v8 38/39] xfsprogs: Add delay ready attr set routines Allison Collins
2020-04-03 22:09 ` [PATCH v8 39/39] xfsprogs: Rename __xfs_attr_rmtval_remove Allison Collins

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=20200403220958.4944-16-allison.henderson@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.