aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2018-01-05 05:47:18 -0500
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 05:17:51 -0400
commitfb18a57568c2b84cd611e242c0f6fa97b45e4907 (patch)
tree0f447778c8ce55e583cd8cf8eb8e945d38b5c208 /include/linux/ceph
parent08a79102aa373e03ce704621fd84567605214465 (diff)
ceph: quota: add initial infrastructure to support cephfs quotas
This patch adds the infrastructure required to support cephfs quotas as it is currently implemented in the ceph fuse client. Cephfs quotas can be set on any directory, and can restrict the number of bytes or the number of files stored beneath that point in the directory hierarchy. Quotas are set using the extended attributes 'ceph.quota.max_files' and 'ceph.quota.max_bytes', and can be removed by setting these attributes to '0'. Link: http://tracker.ceph.com/issues/22372 Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/ceph_features.h1
-rw-r--r--include/linux/ceph/ceph_fs.h17
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index 59042d5ac520..3901927cf6a0 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -204,6 +204,7 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin
204 CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ 204 CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \
205 CEPH_FEATURE_MSGR_KEEPALIVE2 | \ 205 CEPH_FEATURE_MSGR_KEEPALIVE2 | \
206 CEPH_FEATURE_OSD_POOLRESEND | \ 206 CEPH_FEATURE_OSD_POOLRESEND | \
207 CEPH_FEATURE_MDS_QUOTA | \
207 CEPH_FEATURE_CRUSH_V4 | \ 208 CEPH_FEATURE_CRUSH_V4 | \
208 CEPH_FEATURE_NEW_OSDOP_ENCODING | \ 209 CEPH_FEATURE_NEW_OSDOP_ENCODING | \
209 CEPH_FEATURE_SERVER_JEWEL | \ 210 CEPH_FEATURE_SERVER_JEWEL | \
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 88dd51381aaf..7ecfc88314d8 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -134,6 +134,7 @@ struct ceph_dir_layout {
134#define CEPH_MSG_CLIENT_LEASE 0x311 134#define CEPH_MSG_CLIENT_LEASE 0x311
135#define CEPH_MSG_CLIENT_SNAP 0x312 135#define CEPH_MSG_CLIENT_SNAP 0x312
136#define CEPH_MSG_CLIENT_CAPRELEASE 0x313 136#define CEPH_MSG_CLIENT_CAPRELEASE 0x313
137#define CEPH_MSG_CLIENT_QUOTA 0x314
137 138
138/* pool ops */ 139/* pool ops */
139#define CEPH_MSG_POOLOP_REPLY 48 140#define CEPH_MSG_POOLOP_REPLY 48
@@ -807,4 +808,20 @@ struct ceph_mds_snap_realm {
807} __attribute__ ((packed)); 808} __attribute__ ((packed));
808/* followed by my snap list, then prior parent snap list */ 809/* followed by my snap list, then prior parent snap list */
809 810
811/*
812 * quotas
813 */
814struct ceph_mds_quota {
815 __le64 ino; /* ino */
816 struct ceph_timespec rctime;
817 __le64 rbytes; /* dir stats */
818 __le64 rfiles;
819 __le64 rsubdirs;
820 __u8 struct_v; /* compat */
821 __u8 struct_compat;
822 __le32 struct_len;
823 __le64 max_bytes; /* quota max. bytes */
824 __le64 max_files; /* quota max. files */
825} __attribute__ ((packed));
826
810#endif 827#endif