From 1bc58d9361602943b9f729d7ea01ef3c88d6b172 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 25 Oct 2016 15:14:31 -0700 Subject: [PATCH] libxfs: add fsxattr flags and fields for cowextsize Add the cowextsize field and flag to each platform's struct fsxattr definitions. We can compile these definitions into the xfsprogs utilities if we don't pick them up from the system headers, such as on kernels prior to 4.9. Signed-off-by: Darrick J. Wong --- include/darwin.h | 7 ++++++- include/freebsd.h | 6 +++++- include/irix.h | 6 +++++- include/linux.h | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/darwin.h b/include/darwin.h index 4132bfd66..6c9f87ac9 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -292,7 +292,8 @@ struct fsxattr { __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ - unsigned char fsx_pad[12]; + __u32 fsx_cowextsize; /* cow extsize field value (get/set) */ + unsigned char fsx_pad[8]; }; /* @@ -320,4 +321,8 @@ struct fsxattr { #endif +#ifndef FS_XFLAG_COWEXTSIZE +#define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */ +#endif + #endif /* __XFS_DARWIN_H__ */ diff --git a/include/freebsd.h b/include/freebsd.h index 32268efc2..72935ec8f 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -181,7 +181,8 @@ struct fsxattr { __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ - unsigned char fsx_pad[12]; + __u32 fsx_cowextsize; /* cow extsize field value (get/set) */ + unsigned char fsx_pad[8]; }; /* @@ -209,5 +210,8 @@ struct fsxattr { #endif +#ifndef FS_XFLAG_COWEXTSIZE +#define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */ +#endif #endif /* __XFS_FREEBSD_H__ */ diff --git a/include/irix.h b/include/irix.h index 6094b8a22..8bbcbd856 100644 --- a/include/irix.h +++ b/include/irix.h @@ -427,7 +427,8 @@ struct fsxattr { __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ - unsigned char fsx_pad[12]; + __u32 fsx_cowextsize; /* cow extsize field value (get/set) */ + unsigned char fsx_pad[8]; }; /* @@ -455,6 +456,9 @@ struct fsxattr { #endif +#ifndef FS_XFLAG_COWEXTSIZE +#define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */ +#endif /** * Abstraction of mountpoints. diff --git a/include/linux.h b/include/linux.h index 06f1af42d..ddc053e0e 100644 --- a/include/linux.h +++ b/include/linux.h @@ -181,7 +181,8 @@ struct fsxattr { __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ - unsigned char fsx_pad[12]; + __u32 fsx_cowextsize; /* cow extsize field value (get/set) */ + unsigned char fsx_pad[8]; }; /* @@ -209,4 +210,8 @@ struct fsxattr { #endif +#ifndef FS_XFLAG_COWEXTSIZE +#define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */ +#endif + #endif /* __XFS_LINUX_H__ */ -- 2.47.2