@@ -21,6 +21,7 @@ crc32.c \
file_exchange.c \
fsgeom.c \
fsproperties.c \
+fsprops.c \
getparents.c \
histogram.c \
list_sort.c \
@@ -49,6 +50,7 @@ div64.h \
file_exchange.h \
fsgeom.h \
fsproperties.h \
+fsprops.h \
getparents.h \
histogram.h \
logging.h \
@@ -62,11 +64,6 @@ workqueue.h
LSRCFILES += gen_crc32table.c
-ifeq ($(HAVE_LIBATTR),yes)
-CFILES+=fsprops.c
-HFILES+=fsprops.h
-endif
-
LDIRT = gen_crc32table crc32table.h
default: ltdepend $(LTLIBRARY)
new file mode 100644
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2024 Red Hat, Inc. All Rights Reserved.
+ * Author: Carlos Maiolino <cmaiolino@redhat.com>
+ */
+#ifndef __LIBFROG_ATTR_H__
+#define __LIBFROG_ATTR_H__
+
+/*
+ * Those definitions come from libattr
+ *
+ * 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] ])
+
+#endif /* __LIBFROG_ATTR_H__ */
@@ -10,8 +10,7 @@
#include "libfrog/bulkstat.h"
#include "libfrog/fsprops.h"
#include "libfrog/fsproperties.h"
-
-#include <attr/attributes.h>
+#include "libfrog/attr.h"
/*
* Given an xfd and a mount table path, get us the handle for the root dir so
@@ -70,7 +69,7 @@ fsprops_walk_names(
{
struct xfs_attrlist_cursor cur = { };
char attrbuf[XFS_XATTR_LIST_MAX];
- struct attrlist *attrlist = (struct attrlist *)attrbuf;
+ struct xfs_attrlist *attrlist = (struct xfs_attrlist *)attrbuf;
int ret;
memset(attrbuf, 0, XFS_XATTR_LIST_MAX);
@@ -81,7 +80,7 @@ fsprops_walk_names(
unsigned int i;
for (i = 0; i < attrlist->al_count; i++) {
- struct attrlist_ent *ent = ATTR_ENTRY(attrlist, i);
+ struct xfs_attrlist_ent *ent = ATTR_ENTRY(attrlist, i);
const char *p =
attr_name_to_fsprop_name(ent->a_name);