xref: /kernel/linux/linux-5.10/fs/quota/quotaio_v1.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _LINUX_QUOTAIO_V1_H
38c2ecf20Sopenharmony_ci#define _LINUX_QUOTAIO_V1_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/types.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/*
88c2ecf20Sopenharmony_ci * The following constants define the amount of time given a user
98c2ecf20Sopenharmony_ci * before the soft limits are treated as hard limits (usually resulting
108c2ecf20Sopenharmony_ci * in an allocation failure). The timer is started when the user crosses
118c2ecf20Sopenharmony_ci * their soft limit, it is reset when they go below their soft limit.
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci#define MAX_IQ_TIME  604800	/* (7*24*60*60) 1 week */
148c2ecf20Sopenharmony_ci#define MAX_DQ_TIME  604800	/* (7*24*60*60) 1 week */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * The following structure defines the format of the disk quota file
188c2ecf20Sopenharmony_ci * (as it appears on disk) - the file is an array of these structures
198c2ecf20Sopenharmony_ci * indexed by user or group number.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_cistruct v1_disk_dqblk {
228c2ecf20Sopenharmony_ci	__u32 dqb_bhardlimit;	/* absolute limit on disk blks alloc */
238c2ecf20Sopenharmony_ci	__u32 dqb_bsoftlimit;	/* preferred limit on disk blks */
248c2ecf20Sopenharmony_ci	__u32 dqb_curblocks;	/* current block count */
258c2ecf20Sopenharmony_ci	__u32 dqb_ihardlimit;	/* absolute limit on allocated inodes */
268c2ecf20Sopenharmony_ci	__u32 dqb_isoftlimit;	/* preferred inode limit */
278c2ecf20Sopenharmony_ci	__u32 dqb_curinodes;	/* current # allocated inodes */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	/* below fields differ in length on 32-bit vs 64-bit architectures */
308c2ecf20Sopenharmony_ci	unsigned long dqb_btime; /* time limit for excessive disk use */
318c2ecf20Sopenharmony_ci	unsigned long dqb_itime; /* time limit for excessive inode use */
328c2ecf20Sopenharmony_ci};
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define v1_dqoff(UID)      ((loff_t)((UID) * sizeof (struct v1_disk_dqblk)))
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#endif	/* _LINUX_QUOTAIO_V1_H */
37