2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2005-11-02 10:58:39 +07:00
|
|
|
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
|
|
|
* All Rights Reserved.
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
2005-11-02 10:58:39 +07:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
2005-04-17 05:20:36 +07:00
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
2005-11-02 10:58:39 +07:00
|
|
|
* This program is distributed in the hope that it would be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
2005-11-02 10:58:39 +07:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
|
|
|
#ifndef __XFS_QUOTA_H__
|
|
|
|
#define __XFS_QUOTA_H__
|
|
|
|
|
2009-02-09 14:47:34 +07:00
|
|
|
struct xfs_trans;
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2006-03-29 05:55:14 +07:00
|
|
|
* Even though users may not have quota limits occupying all 64-bits,
|
2005-04-17 05:20:36 +07:00
|
|
|
* they may need 64-bit accounting. Hence, 64-bit quota-counters,
|
|
|
|
* and quota-limits. This is a waste in the common case, but hey ...
|
|
|
|
*/
|
|
|
|
typedef __uint64_t xfs_qcnt_t;
|
|
|
|
typedef __uint16_t xfs_qwarncnt_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flags for q_flags field in the dquot.
|
|
|
|
*/
|
|
|
|
#define XFS_DQ_USER 0x0001 /* a user quota */
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_DQ_PROJ 0x0002 /* project quota */
|
2005-04-17 05:20:36 +07:00
|
|
|
#define XFS_DQ_GROUP 0x0004 /* a group quota */
|
2008-12-03 18:20:30 +07:00
|
|
|
#define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */
|
2011-12-07 04:58:18 +07:00
|
|
|
#define XFS_DQ_FREEING 0x0010 /* dquot is beeing torn down */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP)
|
|
|
|
|
2009-12-15 06:14:59 +07:00
|
|
|
#define XFS_DQ_FLAGS \
|
|
|
|
{ XFS_DQ_USER, "USER" }, \
|
|
|
|
{ XFS_DQ_PROJ, "PROJ" }, \
|
|
|
|
{ XFS_DQ_GROUP, "GROUP" }, \
|
2011-12-07 04:58:18 +07:00
|
|
|
{ XFS_DQ_DIRTY, "DIRTY" }, \
|
|
|
|
{ XFS_DQ_FREEING, "FREEING" }
|
2009-12-15 06:14:59 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
xfs: dquot log reservations are too small
During review of the separate project quota inode patches, it became
obvious that the dquot log reservation calculation underestimated
the number dquots that can be modified in a transaction. This has
it's roots way back in the Irix quota implementation.
That is, when quotas were first implemented in XFS, it only
supported user and project quotas as Irix did not have group quotas.
Hence the worst case operation involving dquot modification was
calculated to involve 2 user dquots and 1 project dquot or 1 user
dequot and 2 project dquots. i.e. 3 dquots. This was determined back
in 1996, and has remained unchanged ever since.
However, back in 2001, the Linux XFS port dropped all support for
project quota and implmented group quotas over the top. This was
effectively done with a search-and-replace of project with group,
and as such the log reservation was not changed. However, with the
advent of group quotas, chmod and rename now could modify more than
3 dquots in a single transaction - both could modify 4 dquots. Hence
this log reservation has been wrong for a long time.
In 2005, project quota support was reintroduced into Linux, but it
was implemented to be mutually exclusive to group quotas and so this
didn't add any new changes to the dquot log reservation. Hence when
project quotas were in use (rather than group quotas) the log
reservation was again valid, just like in the Irix days.
Now, with the addition of the separate project quota inode, group
and project quotas are no longer mutually exclusive, and hence
operations can now modify three dquots per inode where previously it
was only two. The worst case here is the rename transaction, which
can allocate/free space on two different directory inodes, and if
they have different uid/gid/prid configurations and are world
writeable, then rename can actually modify 6 different dquots now.
Further, the dquot log reservation doesn't take into account the
space used by the dquot log format structure that precedes the dquot
that is logged, and hence further underestimates the worst case
log space required by dquots during a transaction. This has been
missing since the first commit in 1996.
Hence the worst case log reservation needs to be increased from 3 to
6, and it needs to take into account a log format header for each of
those dquots.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-10 04:04:01 +07:00
|
|
|
* We have the possibility of all three quota types being active at once, and
|
|
|
|
* hence free space modification requires modification of all three current
|
|
|
|
* dquots in a single transaction. For this case we need to have a reservation
|
|
|
|
* of at least 3 dquots.
|
|
|
|
*
|
|
|
|
* However, a chmod operation can change both UID and GID in a single
|
|
|
|
* transaction, resulting in requiring {old, new} x {uid, gid} dquots to be
|
|
|
|
* modified. Hence for this case we need to reserve space for at least 4 dquots.
|
|
|
|
*
|
|
|
|
* And in the worst case, there's a rename operation that can be modifying up to
|
|
|
|
* 4 inodes with dquots attached to them. In reality, the only inodes that can
|
|
|
|
* have their dquots modified are the source and destination directory inodes
|
|
|
|
* due to directory name creation and removal. That can require space allocation
|
|
|
|
* and/or freeing on both directory inodes, and hence all three dquots on each
|
|
|
|
* inode can be modified. And if the directories are world writeable, all the
|
|
|
|
* dquots can be unique and so 6 dquots can be modified....
|
|
|
|
*
|
|
|
|
* And, of course, we also need to take into account the dquot log format item
|
|
|
|
* used to describe each dquot.
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
xfs: dquot log reservations are too small
During review of the separate project quota inode patches, it became
obvious that the dquot log reservation calculation underestimated
the number dquots that can be modified in a transaction. This has
it's roots way back in the Irix quota implementation.
That is, when quotas were first implemented in XFS, it only
supported user and project quotas as Irix did not have group quotas.
Hence the worst case operation involving dquot modification was
calculated to involve 2 user dquots and 1 project dquot or 1 user
dequot and 2 project dquots. i.e. 3 dquots. This was determined back
in 1996, and has remained unchanged ever since.
However, back in 2001, the Linux XFS port dropped all support for
project quota and implmented group quotas over the top. This was
effectively done with a search-and-replace of project with group,
and as such the log reservation was not changed. However, with the
advent of group quotas, chmod and rename now could modify more than
3 dquots in a single transaction - both could modify 4 dquots. Hence
this log reservation has been wrong for a long time.
In 2005, project quota support was reintroduced into Linux, but it
was implemented to be mutually exclusive to group quotas and so this
didn't add any new changes to the dquot log reservation. Hence when
project quotas were in use (rather than group quotas) the log
reservation was again valid, just like in the Irix days.
Now, with the addition of the separate project quota inode, group
and project quotas are no longer mutually exclusive, and hence
operations can now modify three dquots per inode where previously it
was only two. The worst case here is the rename transaction, which
can allocate/free space on two different directory inodes, and if
they have different uid/gid/prid configurations and are world
writeable, then rename can actually modify 6 different dquots now.
Further, the dquot log reservation doesn't take into account the
space used by the dquot log format structure that precedes the dquot
that is logged, and hence further underestimates the worst case
log space required by dquots during a transaction. This has been
missing since the first commit in 1996.
Hence the worst case log reservation needs to be increased from 3 to
6, and it needs to take into account a log format header for each of
those dquots.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-10 04:04:01 +07:00
|
|
|
#define XFS_DQUOT_LOGRES(mp) \
|
|
|
|
((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-09-05 05:24:10 +07:00
|
|
|
#define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
|
|
|
|
#define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT)
|
|
|
|
#define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT)
|
|
|
|
#define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT)
|
2007-05-08 10:49:33 +07:00
|
|
|
#define XFS_IS_UQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD)
|
2013-06-28 05:25:10 +07:00
|
|
|
#define XFS_IS_GQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_GQUOTA_ENFD)
|
|
|
|
#define XFS_IS_PQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_PQUOTA_ENFD)
|
2005-09-05 05:24:10 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Incore only flags for quotaoff - these bits get cleared when quota(s)
|
|
|
|
* are in the process of getting turned off. These flags are in m_qflags but
|
|
|
|
* never in sb_qflags.
|
|
|
|
*/
|
2013-06-28 05:25:10 +07:00
|
|
|
#define XFS_UQUOTA_ACTIVE 0x1000 /* uquotas are being turned off */
|
|
|
|
#define XFS_GQUOTA_ACTIVE 0x2000 /* gquotas are being turned off */
|
|
|
|
#define XFS_PQUOTA_ACTIVE 0x4000 /* pquotas are being turned off */
|
2012-01-24 00:31:43 +07:00
|
|
|
#define XFS_ALL_QUOTA_ACTIVE \
|
2013-06-28 05:25:10 +07:00
|
|
|
(XFS_UQUOTA_ACTIVE | XFS_GQUOTA_ACTIVE | XFS_PQUOTA_ACTIVE)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees
|
|
|
|
* quota will be not be switched off as long as that inode lock is held.
|
|
|
|
*/
|
|
|
|
#define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & (XFS_UQUOTA_ACTIVE | \
|
2005-06-21 12:38:48 +07:00
|
|
|
XFS_GQUOTA_ACTIVE | \
|
|
|
|
XFS_PQUOTA_ACTIVE))
|
|
|
|
#define XFS_IS_OQUOTA_ON(mp) ((mp)->m_qflags & (XFS_GQUOTA_ACTIVE | \
|
|
|
|
XFS_PQUOTA_ACTIVE))
|
2005-04-17 05:20:36 +07:00
|
|
|
#define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE)
|
|
|
|
#define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE)
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Flags to tell various functions what to do. Not all of these are meaningful
|
|
|
|
* to a single function. None of these XFS_QMOPT_* flags are meant to have
|
|
|
|
* persistent values (ie. their values can and will change between versions)
|
|
|
|
*/
|
|
|
|
#define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */
|
|
|
|
#define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */
|
2005-04-17 05:20:36 +07:00
|
|
|
#define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */
|
|
|
|
#define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num */
|
2006-03-31 10:04:49 +07:00
|
|
|
#define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed */
|
|
|
|
#define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */
|
2006-03-31 10:04:49 +07:00
|
|
|
#define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* flags to xfs_trans_mod_dquot to indicate which field needs to be
|
|
|
|
* modified.
|
|
|
|
*/
|
|
|
|
#define XFS_QMOPT_RES_REGBLKS 0x0010000
|
|
|
|
#define XFS_QMOPT_RES_RTBLKS 0x0020000
|
|
|
|
#define XFS_QMOPT_BCOUNT 0x0040000
|
|
|
|
#define XFS_QMOPT_ICOUNT 0x0080000
|
|
|
|
#define XFS_QMOPT_RTBCOUNT 0x0100000
|
|
|
|
#define XFS_QMOPT_DELBCOUNT 0x0200000
|
|
|
|
#define XFS_QMOPT_DELRTBCOUNT 0x0400000
|
|
|
|
#define XFS_QMOPT_RES_INOS 0x0800000
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flags for dqalloc.
|
|
|
|
*/
|
2010-02-04 05:48:58 +07:00
|
|
|
#define XFS_QMOPT_INHERIT 0x1000000
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* flags to xfs_trans_mod_dquot.
|
|
|
|
*/
|
|
|
|
#define XFS_TRANS_DQ_RES_BLKS XFS_QMOPT_RES_REGBLKS
|
|
|
|
#define XFS_TRANS_DQ_RES_RTBLKS XFS_QMOPT_RES_RTBLKS
|
|
|
|
#define XFS_TRANS_DQ_RES_INOS XFS_QMOPT_RES_INOS
|
|
|
|
#define XFS_TRANS_DQ_BCOUNT XFS_QMOPT_BCOUNT
|
|
|
|
#define XFS_TRANS_DQ_DELBCOUNT XFS_QMOPT_DELBCOUNT
|
|
|
|
#define XFS_TRANS_DQ_ICOUNT XFS_QMOPT_ICOUNT
|
|
|
|
#define XFS_TRANS_DQ_RTBCOUNT XFS_QMOPT_RTBCOUNT
|
|
|
|
#define XFS_TRANS_DQ_DELRTBCOUNT XFS_QMOPT_DELRTBCOUNT
|
|
|
|
|
|
|
|
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_QMOPT_QUOTALL \
|
|
|
|
(XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA)
|
2005-04-17 05:20:36 +07:00
|
|
|
#define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS)
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
/*
|
|
|
|
* This check is done typically without holding the inode lock;
|
2006-03-29 05:55:14 +07:00
|
|
|
* that may seem racy, but it is harmless in the context that it is used.
|
2005-04-17 05:20:36 +07:00
|
|
|
* 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.
|
|
|
|
*/
|
2013-07-11 12:00:40 +07:00
|
|
|
#define XFS_NOT_DQATTACHED(mp, ip) \
|
|
|
|
((XFS_IS_UQUOTA_ON(mp) && (ip)->i_udquot == NULL) || \
|
|
|
|
(XFS_IS_GQUOTA_ON(mp) && (ip)->i_gdquot == NULL) || \
|
|
|
|
(XFS_IS_PQUOTA_ON(mp) && (ip)->i_pdquot == NULL))
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_QM_NEED_QUOTACHECK(mp) \
|
|
|
|
((XFS_IS_UQUOTA_ON(mp) && \
|
|
|
|
(mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \
|
|
|
|
(XFS_IS_GQUOTA_ON(mp) && \
|
2013-06-28 05:25:10 +07:00
|
|
|
(mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD) == 0) || \
|
2005-06-21 12:38:48 +07:00
|
|
|
(XFS_IS_PQUOTA_ON(mp) && \
|
2013-06-28 05:25:10 +07:00
|
|
|
(mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0))
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-06-21 12:38:48 +07:00
|
|
|
#define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
|
2013-06-28 05:25:10 +07:00
|
|
|
XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
|
|
|
|
XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\
|
|
|
|
XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD|\
|
|
|
|
XFS_PQUOTA_CHKD)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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_blk_res_used; /* blks used from the reservation */
|
|
|
|
ulong qt_ino_res; /* inode reserved on a dquot */
|
|
|
|
ulong qt_ino_res_used; /* inodes used from the reservation */
|
|
|
|
long qt_bcount_delta; /* dquot blk count changes */
|
|
|
|
long qt_delbcnt_delta; /* delayed dquot blk count changes */
|
|
|
|
long qt_icount_delta; /* dquot inode count changes */
|
|
|
|
ulong qt_rtblk_res; /* # blks reserved on a dquot */
|
|
|
|
ulong qt_rtblk_res_used;/* # blks used from reservation */
|
|
|
|
long qt_rtbcount_delta;/* dquot realtime blk changes */
|
|
|
|
long qt_delrtb_delta; /* delayed RT blk count changes */
|
|
|
|
} xfs_dqtrx_t;
|
|
|
|
|
2009-06-08 20:33:32 +07:00
|
|
|
#ifdef CONFIG_XFS_QUOTA
|
|
|
|
extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *);
|
|
|
|
extern void xfs_trans_free_dqinfo(struct xfs_trans *);
|
|
|
|
extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *,
|
|
|
|
uint, long);
|
|
|
|
extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *);
|
|
|
|
extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *);
|
|
|
|
extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *,
|
|
|
|
struct xfs_inode *, long, long, uint);
|
|
|
|
extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
|
|
|
|
struct xfs_mount *, struct xfs_dquot *,
|
2013-07-11 12:00:40 +07:00
|
|
|
struct xfs_dquot *, struct xfs_dquot *, long, long, uint);
|
2009-06-08 20:33:32 +07:00
|
|
|
|
|
|
|
extern int xfs_qm_vop_dqalloc(struct xfs_inode *, uid_t, gid_t, prid_t, uint,
|
2013-07-11 12:00:40 +07:00
|
|
|
struct xfs_dquot **, struct xfs_dquot **, struct xfs_dquot **);
|
2009-06-08 20:33:32 +07:00
|
|
|
extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode *,
|
2013-07-11 12:00:40 +07:00
|
|
|
struct xfs_dquot *, struct xfs_dquot *, struct xfs_dquot *);
|
2009-06-08 20:33:32 +07:00
|
|
|
extern int xfs_qm_vop_rename_dqattach(struct xfs_inode **);
|
|
|
|
extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *,
|
|
|
|
struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *);
|
|
|
|
extern int xfs_qm_vop_chown_reserve(struct xfs_trans *, struct xfs_inode *,
|
2013-07-11 12:00:40 +07:00
|
|
|
struct xfs_dquot *, struct xfs_dquot *,
|
|
|
|
struct xfs_dquot *, uint);
|
2009-06-08 20:33:32 +07:00
|
|
|
extern int xfs_qm_dqattach(struct xfs_inode *, uint);
|
|
|
|
extern int xfs_qm_dqattach_locked(struct xfs_inode *, uint);
|
|
|
|
extern void xfs_qm_dqdetach(struct xfs_inode *);
|
|
|
|
extern void xfs_qm_dqrele(struct xfs_dquot *);
|
|
|
|
extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *);
|
|
|
|
extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *);
|
|
|
|
extern void xfs_qm_mount_quotas(struct xfs_mount *);
|
|
|
|
extern void xfs_qm_unmount(struct xfs_mount *);
|
|
|
|
extern void xfs_qm_unmount_quotas(struct xfs_mount *);
|
|
|
|
|
|
|
|
#else
|
2009-06-12 22:34:55 +07:00
|
|
|
static inline int
|
|
|
|
xfs_qm_vop_dqalloc(struct xfs_inode *ip, uid_t uid, gid_t gid, prid_t prid,
|
2013-07-11 12:00:40 +07:00
|
|
|
uint flags, struct xfs_dquot **udqp, struct xfs_dquot **gdqp,
|
|
|
|
struct xfs_dquot **pdqp)
|
2009-06-12 22:34:55 +07:00
|
|
|
{
|
|
|
|
*udqp = NULL;
|
|
|
|
*gdqp = NULL;
|
2013-07-11 12:00:40 +07:00
|
|
|
*pdqp = NULL;
|
2009-06-12 22:34:55 +07:00
|
|
|
return 0;
|
|
|
|
}
|
2009-06-08 20:33:32 +07:00
|
|
|
#define xfs_trans_dup_dqinfo(tp, tp2)
|
|
|
|
#define xfs_trans_free_dqinfo(tp)
|
|
|
|
#define xfs_trans_mod_dquot_byino(tp, ip, fields, delta)
|
|
|
|
#define xfs_trans_apply_dquot_deltas(tp)
|
|
|
|
#define xfs_trans_unreserve_and_mod_dquots(tp)
|
2010-11-06 18:42:56 +07:00
|
|
|
static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp,
|
|
|
|
struct xfs_inode *ip, long nblks, long ninos, uint flags)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
|
|
|
|
struct xfs_mount *mp, struct xfs_dquot *udqp,
|
2013-07-11 12:00:40 +07:00
|
|
|
struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
|
|
|
|
long nblks, long nions, uint flags)
|
2010-11-06 18:42:56 +07:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2013-07-11 12:00:40 +07:00
|
|
|
#define xfs_qm_vop_create_dqattach(tp, ip, u, g, p)
|
2009-06-08 20:33:32 +07:00
|
|
|
#define xfs_qm_vop_rename_dqattach(it) (0)
|
|
|
|
#define xfs_qm_vop_chown(tp, ip, old, new) (NULL)
|
2013-07-11 12:00:40 +07:00
|
|
|
#define xfs_qm_vop_chown_reserve(tp, ip, u, g, p, fl) (0)
|
2009-06-08 20:33:32 +07:00
|
|
|
#define xfs_qm_dqattach(ip, fl) (0)
|
|
|
|
#define xfs_qm_dqattach_locked(ip, fl) (0)
|
|
|
|
#define xfs_qm_dqdetach(ip)
|
|
|
|
#define xfs_qm_dqrele(d)
|
|
|
|
#define xfs_qm_statvfs(ip, s)
|
|
|
|
#define xfs_qm_newmount(mp, a, b) (0)
|
|
|
|
#define xfs_qm_mount_quotas(mp)
|
|
|
|
#define xfs_qm_unmount(mp)
|
2010-11-06 18:42:56 +07:00
|
|
|
#define xfs_qm_unmount_quotas(mp)
|
2009-06-08 20:33:32 +07:00
|
|
|
#endif /* CONFIG_XFS_QUOTA */
|
|
|
|
|
|
|
|
#define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \
|
|
|
|
xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags)
|
2013-07-11 12:00:40 +07:00
|
|
|
#define xfs_trans_reserve_quota(tp, mp, ud, gd, pd, nb, ni, f) \
|
|
|
|
xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, pd, nb, ni, \
|
2005-04-17 05:20:36 +07:00
|
|
|
f | XFS_QMOPT_RES_REGBLKS)
|
|
|
|
|
2011-03-07 06:01:35 +07:00
|
|
|
extern int xfs_qm_dqcheck(struct xfs_mount *, xfs_disk_dquot_t *,
|
|
|
|
xfs_dqid_t, uint, uint, char *);
|
2005-09-05 05:24:10 +07:00
|
|
|
extern int xfs_mount_reset_sbqflags(struct xfs_mount *);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2013-04-03 12:11:16 +07:00
|
|
|
extern const struct xfs_buf_ops xfs_dquot_buf_ops;
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* __XFS_QUOTA_H__ */
|