Skip to content

Commit 9c396a0

Browse files
rhvgoyalroot
authored andcommitted
BACKPORT: projectquota: fix build failure with new kernels
Upstream commit: 9ea5071 In kernel version >= v4.5 the project quota ioctl definitions have been made public via the include/uapi/linux/fs.h API, so that ext4 could use the same API. Avoid re-defining the ioctl API if it is already defined in fs.h. Signed-off-by: Amir Goldstein <amir73il@aquasec.com>
1 parent d61a0b1 commit 9c396a0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

daemon/graphdriver/projectquota.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ package graphdriver
1717
#include <linux/fs.h>
1818
#include <linux/quota.h>
1919
#include <linux/dqblk_xfs.h>
20+
21+
#ifndef FS_XFLAG_PROJINHERIT
2022
struct fsxattr {
2123
__u32 fsx_xflags;
2224
__u32 fsx_extsize;
@@ -25,13 +27,26 @@ struct fsxattr {
2527
unsigned char fsx_pad[12];
2628
};
2729
#define FS_XFLAG_PROJINHERIT 0x00000200
30+
#endif
31+
#ifndef FS_IOC_FSGETXATTR
2832
#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
33+
#endif
34+
#ifndef FS_IOC_FSSETXATTR
2935
#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
36+
#endif
3037
38+
#ifndef PRJQUOTA
3139
#define PRJQUOTA 2
40+
#endif
41+
#ifndef XFS_PROJ_QUOTA
3242
#define XFS_PROJ_QUOTA 2
43+
#endif
44+
#ifndef Q_XSETPQLIM
3345
#define Q_XSETPQLIM QCMD(Q_XSETQLIM, PRJQUOTA)
46+
#endif
47+
#ifndef Q_XGETPQUOTA
3448
#define Q_XGETPQUOTA QCMD(Q_XGETQUOTA, PRJQUOTA)
49+
#endif
3550
*/
3651
import "C"
3752
import (

0 commit comments

Comments
 (0)