linux/include/uapi/linux/dqblk_xfs.h

/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
/*
 * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc.  All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesset General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#ifndef _LINUX_DQBLK_XFS_H
#define _LINUX_DQBLK_XFS_H

#include <linux/types.h>

/*
 * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
 */

#define XQM_CMD(x)
#define XQM_COMMAND(x)

#define XQM_USRQUOTA
#define XQM_GRPQUOTA
#define XQM_PRJQUOTA
#define XQM_MAXQUOTAS

#define Q_XQUOTAON
#define Q_XQUOTAOFF
#define Q_XGETQUOTA
#define Q_XSETQLIM
#define Q_XGETQSTAT
#define Q_XQUOTARM
#define Q_XQUOTASYNC
#define Q_XGETQSTATV
#define Q_XGETNEXTQUOTA

/*
 * fs_disk_quota structure:
 *
 * This contains the current quota information regarding a user/proj/group.
 * It is 64-bit aligned, and all the blk units are in BBs (Basic Blocks) of
 * 512 bytes.
 */
#define FS_DQUOT_VERSION
fs_disk_quota_t;

/*
 * These fields are sent to Q_XSETQLIM to specify fields that need to change.
 */
#define FS_DQ_ISOFT
#define FS_DQ_IHARD
#define FS_DQ_BSOFT
#define FS_DQ_BHARD
#define FS_DQ_RTBSOFT
#define FS_DQ_RTBHARD
#define FS_DQ_LIMIT_MASK
/*
 * These timers can only be set in super user's dquot. For others, timers are
 * automatically started and stopped. Superusers timer values set the limits
 * for the rest.  In case these values are zero, the DQ_{F,B}TIMELIMIT values
 * defined below are used. 
 * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
 */
#define FS_DQ_BTIMER
#define FS_DQ_ITIMER
#define FS_DQ_RTBTIMER
#define FS_DQ_TIMER_MASK

/*
 * Warning counts are set in both super user's dquot and others. For others,
 * warnings are set/cleared by the administrators (or automatically by going
 * below the soft limit).  Superusers warning values set the warning limits
 * for the rest.  In case these values are zero, the DQ_{F,B}WARNLIMIT values
 * defined below are used. 
 * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
 */
#define FS_DQ_BWARNS
#define FS_DQ_IWARNS
#define FS_DQ_RTBWARNS
#define FS_DQ_WARNS_MASK

/*
 * Accounting values.  These can only be set for filesystem with
 * non-transactional quotas that require quotacheck(8) in userspace.
 */
#define FS_DQ_BCOUNT
#define FS_DQ_ICOUNT
#define FS_DQ_RTBCOUNT
#define FS_DQ_ACCT_MASK

/*
 * Quota expiration timestamps are 40-bit signed integers, with the upper 8
 * bits encoded in the _hi fields.
 */
#define FS_DQ_BIGTIME

/*
 * Various flags related to quotactl(2).
 */
#define FS_QUOTA_UDQ_ACCT
#define FS_QUOTA_UDQ_ENFD
#define FS_QUOTA_GDQ_ACCT
#define FS_QUOTA_GDQ_ENFD
#define FS_QUOTA_PDQ_ACCT
#define FS_QUOTA_PDQ_ENFD

#define FS_USER_QUOTA
#define FS_PROJ_QUOTA
#define FS_GROUP_QUOTA

/*
 * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
 * Provides a centralized way to get meta information about the quota subsystem.
 * eg. space taken up for user and group quotas, number of dquots currently
 * incore.
 */
#define FS_QSTAT_VERSION

/*
 * Some basic information about 'quota files'.
 */
fs_qfilestat_t;

fs_quota_stat_t;

/*
 * fs_quota_statv is used by Q_XGETQSTATV for a given file system. It provides
 * a centralized way to get meta information about the quota subsystem. eg.
 * space taken up for user, group, and project quotas, number of dquots
 * currently incore.
 *
 * This version has proper versioning support with appropriate padding for
 * future expansions, and ability to expand for future without creating any
 * backward compatibility issues.
 *
 * Q_XGETQSTATV uses the passed in value of the requested version via
 * fs_quota_statv.qs_version to determine the return data layout of
 * fs_quota_statv.  The kernel will fill the data fields relevant to that
 * version.
 *
 * If kernel does not support user space caller specified version, EINVAL will
 * be returned. User space caller can then reduce the version number and retry
 * the same command.
 */
#define FS_QSTATV_VERSION1
/*
 * Some basic information about 'quota files' for Q_XGETQSTATV command
 */
struct fs_qfilestatv {};

struct fs_quota_statv {};

#endif	/* _LINUX_DQBLK_XFS_H */