aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_qm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/quota/xfs_qm.c')
-rw-r--r--fs/xfs/quota/xfs_qm.c51
1 files changed, 4 insertions, 47 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 6ff0f4de1630..b5f91281b707 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -288,45 +288,6 @@ xfs_qm_rele_quotafs_ref(
288} 288}
289 289
290/* 290/*
291 * This is called at mount time from xfs_mountfs to initialize the quotainfo
292 * structure and start the global quota manager (xfs_Gqm) if it hasn't done
293 * so already. Note that the superblock has not been read in yet.
294 */
295void
296xfs_qm_mount_quotainit(
297 xfs_mount_t *mp,
298 uint flags)
299{
300 /*
301 * User, projects or group quotas has to be on.
302 */
303 ASSERT(flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA));
304
305 /*
306 * Initialize the flags in the mount structure. From this point
307 * onwards we look at m_qflags to figure out if quotas's ON/OFF, etc.
308 * Note that we enforce nothing if accounting is off.
309 * ie. XFSMNT_*QUOTA must be ON for XFSMNT_*QUOTAENF.
310 * It isn't necessary to take the quotaoff lock to do this; this is
311 * called from mount.
312 */
313 if (flags & XFSMNT_UQUOTA) {
314 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE);
315 if (flags & XFSMNT_UQUOTAENF)
316 mp->m_qflags |= XFS_UQUOTA_ENFD;
317 }
318 if (flags & XFSMNT_GQUOTA) {
319 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE);
320 if (flags & XFSMNT_GQUOTAENF)
321 mp->m_qflags |= XFS_OQUOTA_ENFD;
322 } else if (flags & XFSMNT_PQUOTA) {
323 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE);
324 if (flags & XFSMNT_PQUOTAENF)
325 mp->m_qflags |= XFS_OQUOTA_ENFD;
326 }
327}
328
329/*
330 * Just destroy the quotainfo structure. 291 * Just destroy the quotainfo structure.
331 */ 292 */
332void 293void
@@ -1039,7 +1000,7 @@ xfs_qm_dqdetach(
1039int 1000int
1040xfs_qm_sync( 1001xfs_qm_sync(
1041 xfs_mount_t *mp, 1002 xfs_mount_t *mp,
1042 short flags) 1003 int flags)
1043{ 1004{
1044 int recl, restarts; 1005 int recl, restarts;
1045 xfs_dquot_t *dqp; 1006 xfs_dquot_t *dqp;
@@ -1717,7 +1678,6 @@ xfs_qm_get_rtblks(
1717 xfs_extnum_t idx; /* extent record index */ 1678 xfs_extnum_t idx; /* extent record index */
1718 xfs_ifork_t *ifp; /* inode fork pointer */ 1679 xfs_ifork_t *ifp; /* inode fork pointer */
1719 xfs_extnum_t nextents; /* number of extent entries */ 1680 xfs_extnum_t nextents; /* number of extent entries */
1720 xfs_bmbt_rec_t *ep; /* pointer to an extent entry */
1721 int error; 1681 int error;
1722 1682
1723 ASSERT(XFS_IS_REALTIME_INODE(ip)); 1683 ASSERT(XFS_IS_REALTIME_INODE(ip));
@@ -1728,10 +1688,8 @@ xfs_qm_get_rtblks(
1728 } 1688 }
1729 rtblks = 0; 1689 rtblks = 0;
1730 nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); 1690 nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
1731 for (idx = 0; idx < nextents; idx++) { 1691 for (idx = 0; idx < nextents; idx++)
1732 ep = xfs_iext_get_ext(ifp, idx); 1692 rtblks += xfs_bmbt_get_blockcount(xfs_iext_get_ext(ifp, idx));
1733 rtblks += xfs_bmbt_get_blockcount(ep);
1734 }
1735 *O_rtblks = (xfs_qcnt_t)rtblks; 1693 *O_rtblks = (xfs_qcnt_t)rtblks;
1736 return 0; 1694 return 0;
1737} 1695}
@@ -2459,8 +2417,7 @@ xfs_qm_vop_dqalloc(
2459 lockflags = XFS_ILOCK_EXCL; 2417 lockflags = XFS_ILOCK_EXCL;
2460 xfs_ilock(ip, lockflags); 2418 xfs_ilock(ip, lockflags);
2461 2419
2462 if ((flags & XFS_QMOPT_INHERIT) && 2420 if ((flags & XFS_QMOPT_INHERIT) && XFS_INHERIT_GID(ip))
2463 XFS_INHERIT_GID(ip, XFS_MTOVFS(mp)))
2464 gid = ip->i_d.di_gid; 2421 gid = ip->i_d.di_gid;
2465 2422
2466 /* 2423 /*