1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2017-2019 Fujitsu Ltd. 4 * Author: Xiao Yang <yangx.jy@cn.fujitsu.com> 5 * Author: Yang Xu <xuyang2018.jy@cn.jujitsu.com> 6 */ 7 8 #ifndef LAPI_QUOTACTL_H__ 9 #define LAPI_QUOTACTL_H__ 10 11 #include <sys/quota.h> 12 13 #ifdef HAVE_STRUCT_IF_NEXTDQBLK 14 # include <linux/quota.h> 15 #else 16 # include <stdint.h> 17 struct if_nextdqblk { 18 uint64_t dqb_bhardlimit; 19 uint64_t dqb_bsoftlimit; 20 uint64_t dqb_curspace; 21 uint64_t dqb_ihardlimit; 22 uint64_t dqb_isoftlimit; 23 uint64_t dqb_curinodes; 24 uint64_t dqb_btime; 25 uint64_t dqb_itime; 26 uint32_t dqb_valid; 27 uint32_t dqb_id; 28 }; 29 #endif /* HAVE_STRUCT_IF_NEXTDQBLK */ 30 31 #ifndef HAVE_STRUCT_FS_QUOTA_STATV 32 # include <stdint.h> 33 struct fs_qfilestatv { 34 uint64_t qfs_ino; 35 uint64_t qfs_nblks; 36 uint32_t qfs_nextents; 37 uint32_t qfs_pad; 38 }; 39 40 struct fs_quota_statv { 41 int8_t qs_version; 42 uint8_t qs_pad1; 43 uint16_t qs_flags; 44 uint32_t qs_incoredqs; 45 struct fs_qfilestatv qs_uquota; 46 struct fs_qfilestatv qs_gquota; 47 struct fs_qfilestatv qs_pquota; 48 int32_t qs_btimelimit; 49 int32_t qs_itimelimit; 50 int32_t qs_rtbtimelimit; 51 uint16_t qs_bwarnlimit; 52 uint16_t qs_iwarnlimit; 53 uint64_t qs_pad2[8]; 54 }; 55 # define FS_QSTATV_VERSION1 1 56 #endif /* HAVE_STRUCT_FS_QUOTA_STATV */ 57 58 #ifndef PRJQUOTA 59 # define PRJQUOTA 2 60 #endif 61 62 #ifndef Q_XGETQSTATV 63 # define Q_XGETQSTATV XQM_CMD(8) 64 #endif 65 66 #ifndef Q_XGETNEXTQUOTA 67 # define Q_XGETNEXTQUOTA XQM_CMD(9) 68 #endif 69 70 #ifndef Q_GETNEXTQUOTA 71 # define Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */ 72 #endif 73 74 #endif /* LAPI_QUOTACTL_H__ */ 75