[lustre-devel] [PATCH 07/27] lustre: quota: default OST Pool Quotas

James Simmons jsimmons at infradead.org
Sun Jun 13 16:11:17 PDT 2021


From: Sergey Cheremencev <sergey.cheremencev at hpe.com>

Patch makes ability to set default quota limits per OST pool.

HPE-bug-id: LUS-9133
WC-bug-id: https://jira.whamcloud.com/browse/LU-13952
Lustre-commit: 25a70a88c9eb35b7 ("LU-13952 quota: default OST Pool Quotas")
Signed-off-by: Sergey Cheremencev <sergey.cheremencev at hpe.com>
Reviewed-on: https://review.whamcloud.com/39873
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff at hpe.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/llite/dir.c                   | 2 ++
 include/uapi/linux/lustre/lustre_user.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 13676c1..d7466f3 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -1096,12 +1096,14 @@ int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
 	case LUSTRE_Q_SETDEFAULT:
 	case LUSTRE_Q_SETQUOTAPOOL:
 	case LUSTRE_Q_SETINFOPOOL:
+	case LUSTRE_Q_SETDEFAULT_POOL:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		break;
 	case Q_GETQUOTA:
 	case LUSTRE_Q_GETDEFAULT:
 	case LUSTRE_Q_GETQUOTAPOOL:
+	case LUSTRE_Q_GETDEFAULT_POOL:
 		if (check_owner(type, id) && !capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		break;
diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h
index 972678f..aae6642 100644
--- a/include/uapi/linux/lustre/lustre_user.h
+++ b/include/uapi/linux/lustre/lustre_user.h
@@ -975,7 +975,8 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen)
 #define LUSTRE_Q_SETQUOTAPOOL	0x800010	/* set user pool quota */
 #define LUSTRE_Q_GETINFOPOOL	0x800011	/* get pool quota info */
 #define LUSTRE_Q_SETINFOPOOL	0x800012	/* set pool quota info */
-
+#define LUSTRE_Q_GETDEFAULT_POOL	0x800013 /* get default pool quota*/
+#define LUSTRE_Q_SETDEFAULT_POOL	0x800014 /* set default pool quota */
 /* In the current Lustre implementation, the grace time is either the time
  * or the timestamp to be used after some quota ID exceeds the soft limt,
  * 48 bits should be enough, its high 16 bits can be used as quota flags.
-- 
1.8.3.1



More information about the lustre-devel mailing list