Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


dqblk_xfs.h
001: /*
002:  * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc.  All Rights Reserved.
003:  *
004:  * This program is free software; you can redistribute it and/or
005:  * modify it under the terms of the GNU Lesser General Public License
006:  * as published by the Free Software Foundation.
007:  *
008:  * This program is distributed in the hope that it will be useful,
009:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011:  * GNU Lesser General Public License for more details.
012:  *
013:  * You should have received a copy of the GNU Lesset General Public License
014:  * along with this program; if not, write to the Free Software Foundation,
015:  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
016:  */
017: #ifndef _LINUX_DQBLK_XFS_H
018: #define _LINUX_DQBLK_XFS_H
019: 
020: #include <linux/types.h>
021: 
022: /*
023:  * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
024:  */
025: 
026: #define XQM_CMD(x)      (('X'<<8)+(x))  /* note: forms first QCMD argument */
027: #define XQM_COMMAND(x)  (((x) & (0xff<<8)) == ('X'<<8)) /* test if for XFS */
028: 
029: #define XQM_USRQUOTA    0       /* system call user quota type */
030: #define XQM_GRPQUOTA    1       /* system call group quota type */
031: #define XQM_PRJQUOTA    2       /* system call project quota type */
032: #define XQM_MAXQUOTAS   3
033: 
034: #define Q_XQUOTAON      XQM_CMD(1)      /* enable accounting/enforcement */
035: #define Q_XQUOTAOFF     XQM_CMD(2)      /* disable accounting/enforcement */
036: #define Q_XGETQUOTA     XQM_CMD(3)      /* get disk limits and usage */
037: #define Q_XSETQLIM      XQM_CMD(4)      /* set disk limits */
038: #define Q_XGETQSTAT     XQM_CMD(5)      /* get quota subsystem status */
039: #define Q_XQUOTARM      XQM_CMD(6)      /* free disk space used by dquots */
040: #define Q_XQUOTASYNC    XQM_CMD(7)      /* delalloc flush, updates dquots */
041: 
042: /*
043:  * fs_disk_quota structure:
044:  *
045:  * This contains the current quota information regarding a user/proj/group.
046:  * It is 64-bit aligned, and all the blk units are in BBs (Basic Blocks) of
047:  * 512 bytes.
048:  */
049: #define FS_DQUOT_VERSION        1       /* fs_disk_quota.d_version */
050: typedef struct fs_disk_quota {
051:         __s8            d_version;      /* version of this structure */
052:         __s8            d_flags;        /* FS_{USER,PROJ,GROUP}_QUOTA */
053:         __u16           d_fieldmask;    /* field specifier */
054:         __u32           d_id;           /* user, project, or group ID */
055:         __u64           d_blk_hardlimit;/* absolute limit on disk blks */
056:         __u64           d_blk_softlimit;/* preferred limit on disk blks */
057:         __u64           d_ino_hardlimit;/* maximum # allocated inodes */
058:         __u64           d_ino_softlimit;/* preferred inode limit */
059:         __u64           d_bcount;       /* # disk blocks owned by the user */
060:         __u64           d_icount;       /* # inodes owned by the user */
061:         __s32           d_itimer;       /* zero if within inode limits */
062:                                         /* if not, we refuse service */
063:         __s32           d_btimer;       /* similar to above; for disk blocks */
064:         __u16           d_iwarns;       /* # warnings issued wrt num inodes */
065:         __u16           d_bwarns;       /* # warnings issued wrt disk blocks */
066:         __s32           d_padding2;     /* padding2 - for future use */
067:         __u64           d_rtb_hardlimit;/* absolute limit on realtime blks */
068:         __u64           d_rtb_softlimit;/* preferred limit on RT disk blks */
069:         __u64           d_rtbcount;     /* # realtime blocks owned */
070:         __s32           d_rtbtimer;     /* similar to above; for RT disk blks */
071:         __u16           d_rtbwarns;     /* # warnings issued wrt RT disk blks */
072:         __s16           d_padding3;     /* padding3 - for future use */ 
073:         char            d_padding4[8];  /* yet more padding */
074: } fs_disk_quota_t;
075: 
076: /*
077:  * These fields are sent to Q_XSETQLIM to specify fields that need to change.
078:  */
079: #define FS_DQ_ISOFT     (1<<0)
080: #define FS_DQ_IHARD     (1<<1)
081: #define FS_DQ_BSOFT     (1<<2)
082: #define FS_DQ_BHARD     (1<<3)
083: #define FS_DQ_RTBSOFT   (1<<4)
084: #define FS_DQ_RTBHARD   (1<<5)
085: #define FS_DQ_LIMIT_MASK        (FS_DQ_ISOFT | FS_DQ_IHARD | FS_DQ_BSOFT | \
086:                                  FS_DQ_BHARD | FS_DQ_RTBSOFT | FS_DQ_RTBHARD)
087: /*
088:  * These timers can only be set in super user's dquot. For others, timers are
089:  * automatically started and stopped. Superusers timer values set the limits
090:  * for the rest.  In case these values are zero, the DQ_{F,B}TIMELIMIT values
091:  * defined below are used. 
092:  * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
093:  */
094: #define FS_DQ_BTIMER    (1<<6)
095: #define FS_DQ_ITIMER    (1<<7)
096: #define FS_DQ_RTBTIMER  (1<<8)
097: #define FS_DQ_TIMER_MASK        (FS_DQ_BTIMER | FS_DQ_ITIMER | FS_DQ_RTBTIMER)
098: 
099: /*
100:  * Warning counts are set in both super user's dquot and others. For others,
101:  * warnings are set/cleared by the administrators (or automatically by going
102:  * below the soft limit).  Superusers warning values set the warning limits
103:  * for the rest.  In case these values are zero, the DQ_{F,B}WARNLIMIT values
104:  * defined below are used. 
105:  * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
106:  */
107: #define FS_DQ_BWARNS    (1<<9)
108: #define FS_DQ_IWARNS    (1<<10)
109: #define FS_DQ_RTBWARNS  (1<<11)
110: #define FS_DQ_WARNS_MASK        (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS)
111: 
112: /*
113:  * Accounting values.  These can only be set for filesystem with
114:  * non-transactional quotas that require quotacheck(8) in userspace.
115:  */
116: #define FS_DQ_BCOUNT            (1<<12)
117: #define FS_DQ_ICOUNT            (1<<13)
118: #define FS_DQ_RTBCOUNT          (1<<14)
119: #define FS_DQ_ACCT_MASK         (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT)
120: 
121: /*
122:  * Various flags related to quotactl(2).
123:  */
124: #define FS_QUOTA_UDQ_ACCT       (1<<0)  /* user quota accounting */
125: #define FS_QUOTA_UDQ_ENFD       (1<<1)  /* user quota limits enforcement */
126: #define FS_QUOTA_GDQ_ACCT       (1<<2)  /* group quota accounting */
127: #define FS_QUOTA_GDQ_ENFD       (1<<3)  /* group quota limits enforcement */
128: #define FS_QUOTA_PDQ_ACCT       (1<<4)  /* project quota accounting */
129: #define FS_QUOTA_PDQ_ENFD       (1<<5)  /* project quota limits enforcement */
130: 
131: #define FS_USER_QUOTA           (1<<0)  /* user quota type */
132: #define FS_PROJ_QUOTA           (1<<1)  /* project quota type */
133: #define FS_GROUP_QUOTA          (1<<2)  /* group quota type */
134: 
135: /*
136:  * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
137:  * Provides a centralized way to get meta information about the quota subsystem.
138:  * eg. space taken up for user and group quotas, number of dquots currently
139:  * incore.
140:  */
141: #define FS_QSTAT_VERSION        1       /* fs_quota_stat.qs_version */
142: 
143: /*
144:  * Some basic information about 'quota files'.
145:  */
146: typedef struct fs_qfilestat {
147:         __u64           qfs_ino;        /* inode number */
148:         __u64           qfs_nblks;      /* number of BBs 512-byte-blks */
149:         __u32           qfs_nextents;   /* number of extents */
150: } fs_qfilestat_t;
151: 
152: typedef struct fs_quota_stat {
153:         __s8            qs_version;     /* version number for future changes */
154:         __u16           qs_flags;       /* FS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
155:         __s8            qs_pad;         /* unused */
156:         fs_qfilestat_t  qs_uquota;      /* user quota storage information */
157:         fs_qfilestat_t  qs_gquota;      /* group quota storage information */
158:         __u32           qs_incoredqs;   /* number of dquots incore */
159:         __s32           qs_btimelimit;  /* limit for blks timer */      
160:         __s32           qs_itimelimit;  /* limit for inodes timer */    
161:         __s32           qs_rtbtimelimit;/* limit for rt blks timer */   
162:         __u16           qs_bwarnlimit;  /* limit for num warnings */
163:         __u16           qs_iwarnlimit;  /* limit for num warnings */
164: } fs_quota_stat_t;
165: 
166: #endif  /* _LINUX_DQBLK_XFS_H */
167: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/