xfs
[Top] [All Lists]

[PATCH] xfsprogs: guard fsxattr definition for newer kernels

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfsprogs: guard fsxattr definition for newer kernels
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 9 Feb 2016 11:40:57 -0600
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
After 334e580,
fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion

the file include/linux/fs.h now defines struct fsxattr.

It defines FS_IOC_FSGETXATTR as well, so use that to wrap
our local definition, and skip it if the kernel is providing
it so that we don't get multiple definitions.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

Should the kernel also #define HAVE_FSXATTR to help existing
xfsprogs-devel installations?

(And what if headers are included in the other order?  Should
we try to guard on the kernel side or no?)

diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index d8b733a..f4858df 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -37,8 +37,10 @@ struct dioattr {
 
 /*
  * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR.
+ * If FS_IOC_FSGETXATTR is defined, the kernel is now providing
+ * this structure definition.
  */
-#ifndef HAVE_FSXATTR
+#if (!defined(HAVE_FSXATTR) && !defined(FS_IOC_FSGETXATTR))
 struct fsxattr {
        __u32           fsx_xflags;     /* xflags field value (get/set) */
        __u32           fsx_extsize;    /* extsize field value (get/set)*/

<Prev in Thread] Current Thread [Next in Thread>