Source
extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode *,
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* All Rights Reserved.
*/
/*
* Kernel only quota definitions and functions
*/
struct xfs_trans;
/*
* This check is done typically without holding the inode lock;
* that may seem racy, but it is harmless in the context that it is used.
* The inode cannot go inactive as long a reference is kept, and
* therefore if dquot(s) were attached, they'll stay consistent.
* If, for example, the ownership of the inode changes while
* we didn't have the inode locked, the appropriate dquot(s) will be
* attached atomically.
*/
static inline uint
xfs_quota_chkd_flag(
uint dqtype)
{
switch (dqtype) {
case XFS_DQ_USER:
return XFS_UQUOTA_CHKD;
case XFS_DQ_GROUP:
return XFS_GQUOTA_CHKD;
case XFS_DQ_PROJ:
return XFS_PQUOTA_CHKD;
default:
return 0;
}
}
/*
* The structure kept inside the xfs_trans_t keep track of dquot changes
* within a transaction and apply them later.
*/
typedef struct xfs_dqtrx {
struct xfs_dquot *qt_dquot; /* the dquot this refers to */
ulong qt_blk_res; /* blks reserved on a dquot */
ulong qt_ino_res; /* inode reserved on a dquot */
ulong qt_ino_res_used; /* inodes used from the reservation */