Skip to content

Commit

Permalink
avoid libattr functions when not enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Moody <moody20@llnl.gov>
  • Loading branch information
adammoody committed Jan 8, 2022
1 parent 3e15ca3 commit 2d17b51
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/mfu_flist_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
#include <getopt.h>
#include <time.h> /* asctime / localtime */
#include <regex.h>

#ifdef HAVE_LIBATTR
#include <attr/libattr.h>
#include <attr/error_context.h>
#endif /* HAVE_LIBATTR */

/* These headers are needed to query the Lustre MDS for stat
* information. This information may be incomplete, but it
Expand Down Expand Up @@ -332,8 +334,6 @@ static int mfu_copy_xattrs(
/* iterate over list and copy values to new object lgetxattr/lsetxattr */
if(got_list) {
char* name = list;
struct error_context ctx;

while(name < list + list_size) {
/* start with a reasonable buffer,
* allocate something bigger as needed */
Expand All @@ -347,9 +347,11 @@ static int mfu_copy_xattrs(

copy_xattr = 1; /* copy unless indicated below not to */
if (copy_opts->copy_xattrs == XATTR_USE_LIBATTR) {
if (attr_copy_action(name, &ctx) == ATTR_ACTION_SKIP) {
#ifdef HAVE_LIBATTR
if (attr_copy_action(name, NULL) == ATTR_ACTION_SKIP) {
copy_xattr = 0;
}
#endif /* HAVE_LIBATTR */
} else if (copy_opts->copy_xattrs == XATTR_SKIP_LUSTRE) {
/* ignore xattrs lustre treats specially */
/* list from lustre source file lustre_idl.h */
Expand Down

0 comments on commit 2d17b51

Please sign in to comment.