[lxc-devel] [lxd/master] lxd/storage/quota: Build on older systems

stgraber on Github lxc-bot at linuxcontainers.org
Fri Apr 12 17:58:49 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190412/7c616a8a/attachment.bin>
-------------- next part --------------
From 44c7d5d8094483f83d3055332e9688ad00ee5a88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 12 Apr 2019 13:52:46 -0400
Subject: [PATCH] lxd/storage/quota: Build on older systems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5658

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 lxd/storage/quota/projectquota.go | 42 +++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/lxd/storage/quota/projectquota.go b/lxd/storage/quota/projectquota.go
index bc47ca68c8..994921f753 100644
--- a/lxd/storage/quota/projectquota.go
+++ b/lxd/storage/quota/projectquota.go
@@ -21,6 +21,48 @@ import (
 #include <stdint.h>
 #include <stdlib.h>
 
+#ifndef FS_XFLAG_PROJINHERIT
+struct fsxattr {
+	__u32		fsx_xflags;
+	__u32		fsx_extsize;
+	__u32		fsx_nextents;
+	__u32		fsx_projid;
+	unsigned char	fsx_pad[12];
+};
+
+struct if_dqinfo {
+	__u64 dqi_bgrace;
+	__u64 dqi_igrace;
+	__u32 dqi_flags;
+	__u32 dqi_valid;
+};
+
+struct if_dqblk {
+	__u64 dqb_bhardlimit;
+	__u64 dqb_bsoftlimit;
+	__u64 dqb_curspace;
+	__u64 dqb_ihardlimit;
+	__u64 dqb_isoftlimit;
+	__u64 dqb_curinodes;
+	__u64 dqb_btime;
+	__u64 dqb_itime;
+	__u32 dqb_valid;
+};
+#define FS_XFLAG_PROJINHERIT 0x00000200
+#endif
+
+#ifndef FS_IOC_FSGETXATTR
+#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
+#endif
+
+#ifndef FS_IOC_FSSETXATTR
+#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
+#endif
+
+#ifndef PRJQUOTA
+#define PRJQUOTA 2
+#endif
+
 int quota_supported(char *dev_path) {
 	struct if_dqinfo dqinfo;
 


More information about the lxc-devel mailing list