diff options
author | Christoph Hellwig <hch@lst.de> | 2009-02-09 02:38:39 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-02-09 02:38:39 -0500 |
commit | e249458220c9799fe94573abd341d29c83579671 (patch) | |
tree | 109a54c3609a44d1a7a55e062531ac55a9a3ead2 /fs/xfs/quota | |
parent | 517b5e8c8516a25a0df3b530fd183eb493a96698 (diff) |
xfs: remove XFS_QM_LOCK/XFS_QM_UNLOCK/XFS_QM_HOLD/XFS_QM_RELE
Remove these macros which only obsfucated the code in rather nast ways.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 13 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.h | 5 |
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index fd0b383d72a5..246790ad9589 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -219,7 +219,7 @@ xfs_qm_hold_quotafs_ref( | |||
219 | * the structure could disappear between the entry to this routine and | 219 | * the structure could disappear between the entry to this routine and |
220 | * a HOLD operation if not locked. | 220 | * a HOLD operation if not locked. |
221 | */ | 221 | */ |
222 | XFS_QM_LOCK(xfs_Gqm); | 222 | mutex_lock(&xfs_Gqm_lock); |
223 | 223 | ||
224 | if (xfs_Gqm == NULL) | 224 | if (xfs_Gqm == NULL) |
225 | xfs_Gqm = xfs_Gqm_init(); | 225 | xfs_Gqm = xfs_Gqm_init(); |
@@ -228,8 +228,8 @@ xfs_qm_hold_quotafs_ref( | |||
228 | * debugging and statistical purposes, but ... | 228 | * debugging and statistical purposes, but ... |
229 | * Just take a reference and get out. | 229 | * Just take a reference and get out. |
230 | */ | 230 | */ |
231 | XFS_QM_HOLD(xfs_Gqm); | 231 | xfs_Gqm->qm_nrefs++; |
232 | XFS_QM_UNLOCK(xfs_Gqm); | 232 | mutex_unlock(&xfs_Gqm_lock); |
233 | 233 | ||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
@@ -277,13 +277,12 @@ xfs_qm_rele_quotafs_ref( | |||
277 | * Destroy the entire XQM. If somebody mounts with quotaon, this'll | 277 | * Destroy the entire XQM. If somebody mounts with quotaon, this'll |
278 | * be restarted. | 278 | * be restarted. |
279 | */ | 279 | */ |
280 | XFS_QM_LOCK(xfs_Gqm); | 280 | mutex_lock(&xfs_Gqm_lock); |
281 | XFS_QM_RELE(xfs_Gqm); | 281 | if (--xfs_Gqm->qm_nrefs == 0) { |
282 | if (xfs_Gqm->qm_nrefs == 0) { | ||
283 | xfs_qm_destroy(xfs_Gqm); | 282 | xfs_qm_destroy(xfs_Gqm); |
284 | xfs_Gqm = NULL; | 283 | xfs_Gqm = NULL; |
285 | } | 284 | } |
286 | XFS_QM_UNLOCK(xfs_Gqm); | 285 | mutex_unlock(&xfs_Gqm_lock); |
287 | } | 286 | } |
288 | 287 | ||
289 | /* | 288 | /* |
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h index ddf09166387c..d48c4dbe1428 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/quota/xfs_qm.h | |||
@@ -158,11 +158,6 @@ typedef struct xfs_dquot_acct { | |||
158 | #define XFS_QM_IWARNLIMIT 5 | 158 | #define XFS_QM_IWARNLIMIT 5 |
159 | #define XFS_QM_RTBWARNLIMIT 5 | 159 | #define XFS_QM_RTBWARNLIMIT 5 |
160 | 160 | ||
161 | #define XFS_QM_LOCK(xqm) (mutex_lock(&xqm##_lock)) | ||
162 | #define XFS_QM_UNLOCK(xqm) (mutex_unlock(&xqm##_lock)) | ||
163 | #define XFS_QM_HOLD(xqm) ((xqm)->qm_nrefs++) | ||
164 | #define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) | ||
165 | |||
166 | extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); | 161 | extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); |
167 | extern void xfs_qm_mount_quotas(xfs_mount_t *); | 162 | extern void xfs_qm_mount_quotas(xfs_mount_t *); |
168 | extern int xfs_qm_quotacheck(xfs_mount_t *); | 163 | extern int xfs_qm_quotacheck(xfs_mount_t *); |