diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2007-10-11 03:38:18 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 00:44:50 -0500 |
commit | 869b906078720b68711569b68de0acca6b73b675 (patch) | |
tree | be6241b9697ca7bb8b8417296c6e46f21bc7fd27 /fs/xfs/quota | |
parent | c8b5ea289fed15a7d7a4d6e911987ff16499aed7 (diff) |
[XFS] Unwrap XFS_DQ_PINUNLOCK.
Un-obfuscate DQ_PINLOCK, remove DQ_PINLOCK->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:29742a
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_dquot.h | 5 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot_item.c | 16 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.h | 2 |
3 files changed, 7 insertions, 16 deletions
diff --git a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/quota/xfs_dquot.h index 78d3ab95c5fd..5c371a92e3e2 100644 --- a/fs/xfs/quota/xfs_dquot.h +++ b/fs/xfs/quota/xfs_dquot.h | |||
@@ -123,11 +123,6 @@ XFS_DQ_IS_LOCKED(xfs_dquot_t *dqp) | |||
123 | vsema(&((dqp)->q_flock)); \ | 123 | vsema(&((dqp)->q_flock)); \ |
124 | (dqp)->dq_flags &= ~(XFS_DQ_FLOCKED); } | 124 | (dqp)->dq_flags &= ~(XFS_DQ_FLOCKED); } |
125 | 125 | ||
126 | #define XFS_DQ_PINLOCK(dqp) mutex_spinlock( \ | ||
127 | &(XFS_DQ_TO_QINF(dqp)->qi_pinlock)) | ||
128 | #define XFS_DQ_PINUNLOCK(dqp, s) mutex_spinunlock( \ | ||
129 | &(XFS_DQ_TO_QINF(dqp)->qi_pinlock), s) | ||
130 | |||
131 | #define XFS_DQ_IS_FLUSH_LOCKED(dqp) (issemalocked(&((dqp)->q_flock))) | 126 | #define XFS_DQ_IS_FLUSH_LOCKED(dqp) (issemalocked(&((dqp)->q_flock))) |
132 | #define XFS_DQ_IS_ON_FREELIST(dqp) ((dqp)->dq_flnext != (dqp)) | 127 | #define XFS_DQ_IS_ON_FREELIST(dqp) ((dqp)->dq_flnext != (dqp)) |
133 | #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) | 128 | #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) |
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index a00b71b05a37..1800e8d1f646 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -94,14 +94,13 @@ STATIC void | |||
94 | xfs_qm_dquot_logitem_pin( | 94 | xfs_qm_dquot_logitem_pin( |
95 | xfs_dq_logitem_t *logitem) | 95 | xfs_dq_logitem_t *logitem) |
96 | { | 96 | { |
97 | unsigned long s; | ||
98 | xfs_dquot_t *dqp; | 97 | xfs_dquot_t *dqp; |
99 | 98 | ||
100 | dqp = logitem->qli_dquot; | 99 | dqp = logitem->qli_dquot; |
101 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 100 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
102 | s = XFS_DQ_PINLOCK(dqp); | 101 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
103 | dqp->q_pincount++; | 102 | dqp->q_pincount++; |
104 | XFS_DQ_PINUNLOCK(dqp, s); | 103 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
105 | } | 104 | } |
106 | 105 | ||
107 | /* | 106 | /* |
@@ -115,17 +114,16 @@ xfs_qm_dquot_logitem_unpin( | |||
115 | xfs_dq_logitem_t *logitem, | 114 | xfs_dq_logitem_t *logitem, |
116 | int stale) | 115 | int stale) |
117 | { | 116 | { |
118 | unsigned long s; | ||
119 | xfs_dquot_t *dqp; | 117 | xfs_dquot_t *dqp; |
120 | 118 | ||
121 | dqp = logitem->qli_dquot; | 119 | dqp = logitem->qli_dquot; |
122 | ASSERT(dqp->q_pincount > 0); | 120 | ASSERT(dqp->q_pincount > 0); |
123 | s = XFS_DQ_PINLOCK(dqp); | 121 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
124 | dqp->q_pincount--; | 122 | dqp->q_pincount--; |
125 | if (dqp->q_pincount == 0) { | 123 | if (dqp->q_pincount == 0) { |
126 | sv_broadcast(&dqp->q_pinwait); | 124 | sv_broadcast(&dqp->q_pinwait); |
127 | } | 125 | } |
128 | XFS_DQ_PINUNLOCK(dqp, s); | 126 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
129 | } | 127 | } |
130 | 128 | ||
131 | /* ARGSUSED */ | 129 | /* ARGSUSED */ |
@@ -189,8 +187,6 @@ void | |||
189 | xfs_qm_dqunpin_wait( | 187 | xfs_qm_dqunpin_wait( |
190 | xfs_dquot_t *dqp) | 188 | xfs_dquot_t *dqp) |
191 | { | 189 | { |
192 | SPLDECL(s); | ||
193 | |||
194 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 190 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
195 | if (dqp->q_pincount == 0) { | 191 | if (dqp->q_pincount == 0) { |
196 | return; | 192 | return; |
@@ -200,9 +196,9 @@ xfs_qm_dqunpin_wait( | |||
200 | * Give the log a push so we don't wait here too long. | 196 | * Give the log a push so we don't wait here too long. |
201 | */ | 197 | */ |
202 | xfs_log_force(dqp->q_mount, (xfs_lsn_t)0, XFS_LOG_FORCE); | 198 | xfs_log_force(dqp->q_mount, (xfs_lsn_t)0, XFS_LOG_FORCE); |
203 | s = XFS_DQ_PINLOCK(dqp); | 199 | spin_lock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
204 | if (dqp->q_pincount == 0) { | 200 | if (dqp->q_pincount == 0) { |
205 | XFS_DQ_PINUNLOCK(dqp, s); | 201 | spin_unlock(&(XFS_DQ_TO_QINF(dqp)->qi_pinlock)); |
206 | return; | 202 | return; |
207 | } | 203 | } |
208 | sv_wait(&(dqp->q_pinwait), PINOD, | 204 | sv_wait(&(dqp->q_pinwait), PINOD, |
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h index 23ccaa5fceaf..023400aa55a3 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/quota/xfs_qm.h | |||
@@ -106,7 +106,7 @@ typedef struct xfs_qm { | |||
106 | typedef struct xfs_quotainfo { | 106 | typedef struct xfs_quotainfo { |
107 | xfs_inode_t *qi_uquotaip; /* user quota inode */ | 107 | xfs_inode_t *qi_uquotaip; /* user quota inode */ |
108 | xfs_inode_t *qi_gquotaip; /* group quota inode */ | 108 | xfs_inode_t *qi_gquotaip; /* group quota inode */ |
109 | lock_t qi_pinlock; /* dquot pinning mutex */ | 109 | spinlock_t qi_pinlock; /* dquot pinning lock */ |
110 | xfs_dqlist_t qi_dqlist; /* all dquots in filesys */ | 110 | xfs_dqlist_t qi_dqlist; /* all dquots in filesys */ |
111 | int qi_dqreclaims; /* a change here indicates | 111 | int qi_dqreclaims; /* a change here indicates |
112 | a removal in the dqlist */ | 112 | a removal in the dqlist */ |