[PATCH 3/3] scrub: Remove libattr dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Carlos Maiolino <cem@xxxxxxxxxx>

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

Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
---
 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





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux