public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: cem@kernel.org
To: linux-xfs@vger.kernel.org
Cc: djwong@kernel.org, hch@lst.de, hch@infradead.org
Subject: [PATCH 1/3] libhandle: Remove libattr dependency
Date: Tue, 27 Aug 2024 13:50:22 +0200	[thread overview]
Message-ID: <20240827115032.406321-2-cem@kernel.org> (raw)
In-Reply-To: <20240827115032.406321-1-cem@kernel.org>

From: Carlos Maiolino <cem@kernel.org>

Aiming torwards removing xfsprogs libattr dependency, getting rid of
libattr_cursor is the first step.

libxfs already has our own definition of xfs_libattr_cursor, so we can
simply use it.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 include/handle.h   |  3 +--
 include/jdm.h      |  5 ++---
 libfrog/fsprops.c  |  8 ++++----
 libhandle/handle.c |  2 +-
 libhandle/jdm.c    | 14 +++++++-------
 scrub/phase5.c     |  2 +-
 6 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/include/handle.h b/include/handle.h
index ba0650051..991bd5d01 100644
--- a/include/handle.h
+++ b/include/handle.h
@@ -11,7 +11,6 @@ extern "C" {
 #endif
 
 struct fsdmidata;
-struct attrlist_cursor;
 struct parent;
 
 extern int  path_to_handle (char *__path, void **__hanp, size_t *__hlen);
@@ -29,7 +28,7 @@ extern int  attr_multi_by_handle (void *__hanp, size_t __hlen, void *__buf,
 				  int __rtrvcnt, int __flags);
 extern int  attr_list_by_handle (void *__hanp, size_t __hlen, void *__buf,
 				 size_t __bufsize, int __flags,
-				 struct attrlist_cursor *__cursor);
+				 struct xfs_attrlist_cursor *__cursor);
 extern int  parents_by_handle(void *__hanp, size_t __hlen,
 			      struct parent *__buf, size_t __bufsize,
 			      unsigned int *__count);
diff --git a/include/jdm.h b/include/jdm.h
index 50c2296b4..669ee75ce 100644
--- a/include/jdm.h
+++ b/include/jdm.h
@@ -12,7 +12,6 @@ typedef void	jdm_filehandle_t;	/* filehandle */
 
 struct xfs_bstat;
 struct xfs_bulkstat;
-struct attrlist_cursor;
 struct parent;
 
 extern jdm_fshandle_t *
@@ -60,11 +59,11 @@ extern intgen_t
 jdm_attr_list(	jdm_fshandle_t *fshp,
 		struct xfs_bstat *statp,
 		char *bufp, size_t bufsz, int flags,
-		struct attrlist_cursor *cursor);
+		struct xfs_attrlist_cursor *cursor);
 
 intgen_t jdm_attr_list_v5(jdm_fshandle_t *fshp, struct xfs_bulkstat *statp,
 		char *bufp, size_t bufsz, int flags,
-		struct attrlist_cursor *cursor);
+		struct xfs_attrlist_cursor *cursor);
 
 extern int
 jdm_parents( jdm_fshandle_t *fshp,
diff --git a/libfrog/fsprops.c b/libfrog/fsprops.c
index 88046b7a0..05a584a56 100644
--- a/libfrog/fsprops.c
+++ b/libfrog/fsprops.c
@@ -68,10 +68,10 @@ fsprops_walk_names(
 	fsprops_name_walk_fn	walk_fn,
 	void			*priv)
 {
-	struct attrlist_cursor	cur = { };
-	char			attrbuf[XFS_XATTR_LIST_MAX];
-	struct attrlist		*attrlist = (struct attrlist *)attrbuf;
-	int			ret;
+	struct xfs_attrlist_cursor	cur = { };
+	char				attrbuf[XFS_XATTR_LIST_MAX];
+	struct attrlist			*attrlist = (struct attrlist *)attrbuf;
+	int				ret;
 
 	memset(attrbuf, 0, XFS_XATTR_LIST_MAX);
 
diff --git a/libhandle/handle.c b/libhandle/handle.c
index 1e8fe9ac5..a9a9f9534 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -381,7 +381,7 @@ attr_list_by_handle(
 	void		*buf,
 	size_t		bufsize,
 	int		flags,
-	struct attrlist_cursor *cursor)
+	struct		xfs_attrlist_cursor *cursor)
 {
 	int		error, fd;
 	char		*path;
diff --git a/libhandle/jdm.c b/libhandle/jdm.c
index e21aff2b2..9ce605ad3 100644
--- a/libhandle/jdm.c
+++ b/libhandle/jdm.c
@@ -221,7 +221,7 @@ int
 jdm_attr_list(	jdm_fshandle_t *fshp,
 		struct xfs_bstat *statp,
 		char *bufp, size_t bufsz, int flags,
-		struct attrlist_cursor *cursor)
+		struct xfs_attrlist_cursor *cursor)
 {
 	fshandle_t *fshandlep = ( fshandle_t * )fshp;
 	filehandle_t filehandle;
@@ -240,12 +240,12 @@ jdm_attr_list(	jdm_fshandle_t *fshp,
 
 int
 jdm_attr_list_v5(
-	jdm_fshandle_t		*fshp,
-	struct xfs_bulkstat	*statp,
-	char			*bufp,
-	size_t			bufsz,
-	int			flags,
-	struct attrlist_cursor	*cursor)
+	jdm_fshandle_t			*fshp,
+	struct xfs_bulkstat		*statp,
+	char				*bufp,
+	size_t				bufsz,
+	int				flags,
+	struct xfs_attrlist_cursor	*cursor)
 {
 	struct fshandle		*fshandlep = (struct fshandle *)fshp;
 	struct filehandle	filehandle;
diff --git a/scrub/phase5.c b/scrub/phase5.c
index f6c295c64..27fa29be6 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -190,7 +190,7 @@ check_xattr_ns_names(
 	struct xfs_bulkstat		*bstat,
 	const struct attrns_decode	*attr_ns)
 {
-	struct attrlist_cursor		cur;
+	struct xfs_attrlist_cursor	cur;
 	char				attrbuf[XFS_XATTR_LIST_MAX];
 	char				keybuf[XATTR_NAME_MAX + 1];
 	struct attrlist			*attrlist = (struct attrlist *)attrbuf;
-- 
2.46.0


  reply	other threads:[~2024-08-27 11:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 11:50 [PATCH 0/3] Get rid of libattr dependency cem
2024-08-27 11:50 ` cem [this message]
2024-08-27 12:12   ` [PATCH 1/3] libhandle: Remove " Christoph Hellwig
2024-08-27 14:44     ` Darrick J. Wong
2024-08-28  4:33       ` Christoph Hellwig
2024-08-27 14:41   ` Darrick J. Wong
2024-08-28  4:34     ` Christoph Hellwig
2024-08-29 13:18       ` Carlos Maiolino
2024-08-27 11:50 ` [PATCH 2/3] libfrog: remove " cem
2024-08-27 12:15   ` Christoph Hellwig
2024-08-27 12:24     ` Carlos Maiolino
2024-08-27 11:50 ` [PATCH 3/3] scrub: Remove " cem
2024-08-27 12:16   ` Christoph Hellwig
2024-08-27 12:27     ` Carlos Maiolino
2024-08-27 14:36       ` Darrick J. Wong
2024-08-28  4:35         ` Christoph Hellwig

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=20240827115032.406321-2-cem@kernel.org \
    --to=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox