All of lore.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 3/3] scrub: Remove libattr dependency
Date: Tue, 27 Aug 2024 13:50:24 +0200	[thread overview]
Message-ID: <20240827115032.406321-4-cem@kernel.org> (raw)
In-Reply-To: <20240827115032.406321-1-cem@kernel.org>

From: Carlos Maiolino <cem@kernel.org>

Rename all attrlist usage to xfs_attrlist, and add a couple more
definitions to libfrog/attr.h

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 libfrog/attr.h | 5 +++++
 scrub/Makefile | 4 ----
 scrub/phase5.c | 9 +++------
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/libfrog/attr.h b/libfrog/attr.h
index 9110499f2..f1a10b5ae 100644
--- a/libfrog/attr.h
+++ b/libfrog/attr.h
@@ -11,8 +11,13 @@
  *
  * We are redifining here so we don't need to keep libattr as a dependency anymore
  */
+
 #define ATTR_ENTRY(buffer, index)		\
 	((struct xfs_attrlist_ent *)		\
 	 &((char *)buffer)[ ((struct xfs_attrlist *)(buffer))->al_offset[index] ])
 
+/* Attr flags used within xfsprogs, must match the definitions from libattr */
+#define ATTR_ROOT	0x0002	/* use root namespace attributes in op */
+#define ATTR_SECURE	0x0008	/* use security namespaces attributes in op */
+
 #endif /* __LIBFROG_ATTR_H__ */
diff --git a/scrub/Makefile b/scrub/Makefile
index 53e8cb02a..1e1109048 100644
--- a/scrub/Makefile
+++ b/scrub/Makefile
@@ -100,10 +100,6 @@ ifeq ($(HAVE_MALLINFO2),yes)
 LCFLAGS += -DHAVE_MALLINFO2
 endif
 
-ifeq ($(HAVE_LIBATTR),yes)
-LCFLAGS += -DHAVE_LIBATTR
-endif
-
 ifeq ($(HAVE_LIBICU),yes)
 CFILES += unicrash.c
 LCFLAGS += -DHAVE_LIBICU $(LIBICU_CFLAGS)
diff --git a/scrub/phase5.c b/scrub/phase5.c
index 27fa29be6..2e495643f 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -20,6 +20,7 @@
 #include "libfrog/scrub.h"
 #include "libfrog/bitmap.h"
 #include "libfrog/bulkstat.h"
+#include "libfrog/attr.h"
 #include "xfs_scrub.h"
 #include "common.h"
 #include "inodes.h"
@@ -164,7 +165,6 @@ out_unicrash:
 	return ret;
 }
 
-#ifdef HAVE_LIBATTR
 /* Routines to scan all of an inode's xattrs for name problems. */
 struct attrns_decode {
 	int			flags;
@@ -193,8 +193,8 @@ check_xattr_ns_names(
 	struct xfs_attrlist_cursor	cur;
 	char				attrbuf[XFS_XATTR_LIST_MAX];
 	char				keybuf[XATTR_NAME_MAX + 1];
-	struct attrlist			*attrlist = (struct attrlist *)attrbuf;
-	struct attrlist_ent		*ent;
+	struct xfs_attrlist		*attrlist = (struct xfs_attrlist *)attrbuf;
+	struct xfs_attrlist_ent		*ent;
 	struct unicrash			*uc = NULL;
 	int				i;
 	int				error;
@@ -267,9 +267,6 @@ check_xattr_names(
 	}
 	return ret;
 }
-#else
-# define check_xattr_names(c, d, h, b)	(0)
-#endif /* HAVE_LIBATTR */
 
 static int
 render_ino_from_handle(
-- 
2.46.0


  parent 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 ` [PATCH 1/3] libhandle: Remove " cem
2024-08-27 12:12   ` 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 ` cem [this message]
2024-08-27 12:16   ` [PATCH 3/3] scrub: Remove " 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-4-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 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.