#include "field.h"
#include "inode.h"
#include "listxattr.h"
+#include "libfrog/file_attr.h"
#include <sys/xattr.h>
#include <linux/xattr.h>
const struct destdir *destdir,
const struct pathbuf *pbuf)
{
+ struct file_attr fa = {
+ .fa_extsize = ip->i_extsize,
+ .fa_projid = ip->i_projid,
+ .fa_cowextsize = ip->i_cowextsize,
+ .fa_xflags = xfs_ip2xflags(ip),
+ };
int ret;
ret = fchmodat(destdir->fd, pbuf->path, VFS_I(ip)->i_mode & ~S_IFMT,
return 1;
}
- /* Cannot copy fsxattrs until setfsxattrat gets merged */
+ ret = xfrog_file_setattr(destdir->fd, pbuf->path, NULL, &fa,
+ AT_SYMLINK_NOFOLLOW);
+ if (ret) {
+ if (errno == EOPNOTSUPP || errno == EPERM || errno == ENOTTY)
+ lost_mask |= LOST_FSXATTR;
+ else
+ dbprintf(_("%s%s%s: xfrog_file_setattr %s\n"),
+ destdir->path, destdir->sep, pbuf->path,
+ strerror(errno));
+ if (strict_errors)
+ return 1;
+ }
return 0;
}