aboutsummaryrefslogtreecommitdiffstats
diff options
authorCarlos Maiolino <cem@kernel.org>2024-08-27 12:42:30 +0200
committerCarlos Maiolino <cem@kernel.org>2024-08-27 12:48:05 +0200
commit79490bcfbbdeaa633cfcaac6336ce9adcc65957f (patch)
tree7a1bf2cb14a7e34f4fb7c4070a12298508ca677b
parentd6b992f455971f3491a576d118e94c2c8a315a52 (diff)
downloadxfsprogs-dev-libattr_gone.tar.gz
scrub: Remove libattr dependencylibattr_gone
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>
-rw-r--r--libfrog/attr.h5
-rw-r--r--scrub/Makefile4
-rw-r--r--scrub/phase5.c9
3 files changed, 8 insertions, 10 deletions
diff --git a/libfrog/attr.h b/libfrog/attr.h
index 9110499f2c..f1a10b5aea 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 53e8cb02a9..1e1109048c 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 27fa29be63..2e495643f9 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(