aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-10-08 05:52:52 -0400
committerJan Kara <jack@suse.cz>2015-01-21 13:21:32 -0500
commitfbf64b3df34e6640fbbc89d6daa5f79833036890 (patch)
treecb50ece1759e62074f200e31b03519bc4e917fd2 /fs
parent8a2fdd4a49d40017b3fca42beb2e1c8c0174a743 (diff)
xfs: Remove some useless flags tests
'flags' have XFS_ALL_QUOTA_ACCT cleared immediately on function entry. There's no point in checking these bits later in the function. Also because we check something is going to change, we know some enforcement bits are being added and thus there's no point in testing that later. Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_qm_syscalls.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 74fca68e43b6..b7a8f5665d7b 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -330,22 +330,16 @@ xfs_qm_scall_quotaon(
330 return -EINVAL; 330 return -EINVAL;
331 } 331 }
332 332
333 /* No fs can turn on quotas with a delayed effect */
334 ASSERT((flags & XFS_ALL_QUOTA_ACCT) == 0);
335
336 /* 333 /*
337 * Can't enforce without accounting. We check the superblock 334 * Can't enforce without accounting. We check the superblock
338 * qflags here instead of m_qflags because rootfs can have 335 * qflags here instead of m_qflags because rootfs can have
339 * quota acct on ondisk without m_qflags' knowing. 336 * quota acct on ondisk without m_qflags' knowing.
340 */ 337 */
341 if (((flags & XFS_UQUOTA_ACCT) == 0 && 338 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&
342 (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&
343 (flags & XFS_UQUOTA_ENFD)) || 339 (flags & XFS_UQUOTA_ENFD)) ||
344 ((flags & XFS_GQUOTA_ACCT) == 0 && 340 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&
345 (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&
346 (flags & XFS_GQUOTA_ENFD)) || 341 (flags & XFS_GQUOTA_ENFD)) ||
347 ((flags & XFS_PQUOTA_ACCT) == 0 && 342 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 &&
348 (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 &&
349 (flags & XFS_PQUOTA_ENFD))) { 343 (flags & XFS_PQUOTA_ENFD))) {
350 xfs_debug(mp, 344 xfs_debug(mp,
351 "%s: Can't enforce without acct, flags=%x sbflags=%x", 345 "%s: Can't enforce without acct, flags=%x sbflags=%x",
@@ -384,8 +378,7 @@ xfs_qm_scall_quotaon(
384 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) != 378 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) !=
385 (mp->m_qflags & XFS_PQUOTA_ACCT)) || 379 (mp->m_qflags & XFS_PQUOTA_ACCT)) ||
386 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) != 380 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) !=
387 (mp->m_qflags & XFS_GQUOTA_ACCT)) || 381 (mp->m_qflags & XFS_GQUOTA_ACCT)))
388 (flags & XFS_ALL_QUOTA_ENFD) == 0)
389 return 0; 382 return 0;
390 383
391 if (! XFS_IS_QUOTA_RUNNING(mp)) 384 if (! XFS_IS_QUOTA_RUNNING(mp))