aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-10-11 03:42:32 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:47:15 -0500
commit3685c2a1d773781608c9e281a6ff6b4c8ea8f6f9 (patch)
treef3d3a45002e64c8204de0db66bad2db1b73b5844 /fs/xfs/quota
parentba74d0cba51dcaa99e4dc2e4fb62e6e13abbf703 (diff)
[XFS] Unwrap XFS_SB_LOCK.
Un-obfuscate XFS_SB_LOCK, remove XFS_SB_LOCK->mutex_lock->spin_lock macros, call spin_lock directly, remove extraneous cookie holdover from old xfs code, and change lock type to spinlock_t. SGI-PV: 970382 SGI-Modid: xfs-linux-melb:xfs-kern:29746a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r--fs/xfs/quota/xfs_qm.c12
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c19
2 files changed, 13 insertions, 18 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index d488645f833d..08b44758035e 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -310,7 +310,6 @@ xfs_qm_mount_quotas(
310 xfs_mount_t *mp, 310 xfs_mount_t *mp,
311 int mfsi_flags) 311 int mfsi_flags)
312{ 312{
313 unsigned long s;
314 int error = 0; 313 int error = 0;
315 uint sbf; 314 uint sbf;
316 315
@@ -367,13 +366,13 @@ xfs_qm_mount_quotas(
367 366
368 write_changes: 367 write_changes:
369 /* 368 /*
370 * We actually don't have to acquire the SB_LOCK at all. 369 * We actually don't have to acquire the m_sb_lock at all.
371 * This can only be called from mount, and that's single threaded. XXX 370 * This can only be called from mount, and that's single threaded. XXX
372 */ 371 */
373 s = XFS_SB_LOCK(mp); 372 spin_lock(&mp->m_sb_lock);
374 sbf = mp->m_sb.sb_qflags; 373 sbf = mp->m_sb.sb_qflags;
375 mp->m_sb.sb_qflags = mp->m_qflags & XFS_MOUNT_QUOTA_ALL; 374 mp->m_sb.sb_qflags = mp->m_qflags & XFS_MOUNT_QUOTA_ALL;
376 XFS_SB_UNLOCK(mp, s); 375 spin_unlock(&mp->m_sb_lock);
377 376
378 if (sbf != (mp->m_qflags & XFS_MOUNT_QUOTA_ALL)) { 377 if (sbf != (mp->m_qflags & XFS_MOUNT_QUOTA_ALL)) {
379 if (xfs_qm_write_sb_changes(mp, XFS_SB_QFLAGS)) { 378 if (xfs_qm_write_sb_changes(mp, XFS_SB_QFLAGS)) {
@@ -1370,7 +1369,6 @@ xfs_qm_qino_alloc(
1370{ 1369{
1371 xfs_trans_t *tp; 1370 xfs_trans_t *tp;
1372 int error; 1371 int error;
1373 unsigned long s;
1374 int committed; 1372 int committed;
1375 1373
1376 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE); 1374 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE);
@@ -1402,7 +1400,7 @@ xfs_qm_qino_alloc(
1402 * sbfields arg may contain fields other than *QUOTINO; 1400 * sbfields arg may contain fields other than *QUOTINO;
1403 * VERSIONNUM for example. 1401 * VERSIONNUM for example.
1404 */ 1402 */
1405 s = XFS_SB_LOCK(mp); 1403 spin_lock(&mp->m_sb_lock);
1406 if (flags & XFS_QMOPT_SBVERSION) { 1404 if (flags & XFS_QMOPT_SBVERSION) {
1407#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY) 1405#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)
1408 unsigned oldv = mp->m_sb.sb_versionnum; 1406 unsigned oldv = mp->m_sb.sb_versionnum;
@@ -1429,7 +1427,7 @@ xfs_qm_qino_alloc(
1429 mp->m_sb.sb_uquotino = (*ip)->i_ino; 1427 mp->m_sb.sb_uquotino = (*ip)->i_ino;
1430 else 1428 else
1431 mp->m_sb.sb_gquotino = (*ip)->i_ino; 1429 mp->m_sb.sb_gquotino = (*ip)->i_ino;
1432 XFS_SB_UNLOCK(mp, s); 1430 spin_unlock(&mp->m_sb_lock);
1433 xfs_mod_sb(tp, sbfields); 1431 xfs_mod_sb(tp, sbfields);
1434 1432
1435 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) { 1433 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) {
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index ad5579d4eac4..2cc5886cfe85 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -200,7 +200,6 @@ xfs_qm_scall_quotaoff(
200 boolean_t force) 200 boolean_t force)
201{ 201{
202 uint dqtype; 202 uint dqtype;
203 unsigned long s;
204 int error; 203 int error;
205 uint inactivate_flags; 204 uint inactivate_flags;
206 xfs_qoff_logitem_t *qoffstart; 205 xfs_qoff_logitem_t *qoffstart;
@@ -237,9 +236,9 @@ xfs_qm_scall_quotaoff(
237 if ((flags & XFS_ALL_QUOTA_ACCT) == 0) { 236 if ((flags & XFS_ALL_QUOTA_ACCT) == 0) {
238 mp->m_qflags &= ~(flags); 237 mp->m_qflags &= ~(flags);
239 238
240 s = XFS_SB_LOCK(mp); 239 spin_lock(&mp->m_sb_lock);
241 mp->m_sb.sb_qflags = mp->m_qflags; 240 mp->m_sb.sb_qflags = mp->m_qflags;
242 XFS_SB_UNLOCK(mp, s); 241 spin_unlock(&mp->m_sb_lock);
243 mutex_unlock(&(XFS_QI_QOFFLOCK(mp))); 242 mutex_unlock(&(XFS_QI_QOFFLOCK(mp)));
244 243
245 /* XXX what to do if error ? Revert back to old vals incore ? */ 244 /* XXX what to do if error ? Revert back to old vals incore ? */
@@ -415,7 +414,6 @@ xfs_qm_scall_quotaon(
415 uint flags) 414 uint flags)
416{ 415{
417 int error; 416 int error;
418 unsigned long s;
419 uint qf; 417 uint qf;
420 uint accflags; 418 uint accflags;
421 __int64_t sbflags; 419 __int64_t sbflags;
@@ -468,10 +466,10 @@ xfs_qm_scall_quotaon(
468 * Change sb_qflags on disk but not incore mp->qflags 466 * Change sb_qflags on disk but not incore mp->qflags
469 * if this is the root filesystem. 467 * if this is the root filesystem.
470 */ 468 */
471 s = XFS_SB_LOCK(mp); 469 spin_lock(&mp->m_sb_lock);
472 qf = mp->m_sb.sb_qflags; 470 qf = mp->m_sb.sb_qflags;
473 mp->m_sb.sb_qflags = qf | flags; 471 mp->m_sb.sb_qflags = qf | flags;
474 XFS_SB_UNLOCK(mp, s); 472 spin_unlock(&mp->m_sb_lock);
475 473
476 /* 474 /*
477 * There's nothing to change if it's the same. 475 * There's nothing to change if it's the same.
@@ -815,7 +813,6 @@ xfs_qm_log_quotaoff(
815{ 813{
816 xfs_trans_t *tp; 814 xfs_trans_t *tp;
817 int error; 815 int error;
818 unsigned long s;
819 xfs_qoff_logitem_t *qoffi=NULL; 816 xfs_qoff_logitem_t *qoffi=NULL;
820 uint oldsbqflag=0; 817 uint oldsbqflag=0;
821 818
@@ -832,10 +829,10 @@ xfs_qm_log_quotaoff(
832 qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); 829 qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT);
833 xfs_trans_log_quotaoff_item(tp, qoffi); 830 xfs_trans_log_quotaoff_item(tp, qoffi);
834 831
835 s = XFS_SB_LOCK(mp); 832 spin_lock(&mp->m_sb_lock);
836 oldsbqflag = mp->m_sb.sb_qflags; 833 oldsbqflag = mp->m_sb.sb_qflags;
837 mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; 834 mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL;
838 XFS_SB_UNLOCK(mp, s); 835 spin_unlock(&mp->m_sb_lock);
839 836
840 xfs_mod_sb(tp, XFS_SB_QFLAGS); 837 xfs_mod_sb(tp, XFS_SB_QFLAGS);
841 838
@@ -854,9 +851,9 @@ error0:
854 * No one else is modifying sb_qflags, so this is OK. 851 * No one else is modifying sb_qflags, so this is OK.
855 * We still hold the quotaofflock. 852 * We still hold the quotaofflock.
856 */ 853 */
857 s = XFS_SB_LOCK(mp); 854 spin_lock(&mp->m_sb_lock);
858 mp->m_sb.sb_qflags = oldsbqflag; 855 mp->m_sb.sb_qflags = oldsbqflag;
859 XFS_SB_UNLOCK(mp, s); 856 spin_unlock(&mp->m_sb_lock);
860 } 857 }
861 *qoffstartp = qoffi; 858 *qoffstartp = qoffi;
862 return (error); 859 return (error);