aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-10-11 03:41:21 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:46:48 -0500
commit703e1f0fd2edc2978bde3b4536e78b577318c090 (patch)
treecb7e227feb32d010f71512fdef3e8ece49e2f99c
parent64137e56d76a5c05aa4411e2f5d7121593dd9478 (diff)
[XFS] Unwrap xfs_dabuf_global_lock
Un-obfuscate dabuf_global_lock, remove 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:29744a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r--fs/xfs/xfs_da_btree.c13
-rw-r--r--fs/xfs/xfs_vfsops.c2
2 files changed, 6 insertions, 9 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 26d09e2e1a7f..1b446849fb3d 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -2218,7 +2218,7 @@ xfs_da_state_free(xfs_da_state_t *state)
2218 2218
2219#ifdef XFS_DABUF_DEBUG 2219#ifdef XFS_DABUF_DEBUG
2220xfs_dabuf_t *xfs_dabuf_global_list; 2220xfs_dabuf_t *xfs_dabuf_global_list;
2221lock_t xfs_dabuf_global_lock; 2221spinlock_t xfs_dabuf_global_lock;
2222#endif 2222#endif
2223 2223
2224/* 2224/*
@@ -2264,10 +2264,9 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
2264 } 2264 }
2265#ifdef XFS_DABUF_DEBUG 2265#ifdef XFS_DABUF_DEBUG
2266 { 2266 {
2267 SPLDECL(s);
2268 xfs_dabuf_t *p; 2267 xfs_dabuf_t *p;
2269 2268
2270 s = mutex_spinlock(&xfs_dabuf_global_lock); 2269 spin_lock(&xfs_dabuf_global_lock);
2271 for (p = xfs_dabuf_global_list; p; p = p->next) { 2270 for (p = xfs_dabuf_global_list; p; p = p->next) {
2272 ASSERT(p->blkno != dabuf->blkno || 2271 ASSERT(p->blkno != dabuf->blkno ||
2273 p->target != dabuf->target); 2272 p->target != dabuf->target);
@@ -2277,7 +2276,7 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
2277 xfs_dabuf_global_list->prev = dabuf; 2276 xfs_dabuf_global_list->prev = dabuf;
2278 dabuf->next = xfs_dabuf_global_list; 2277 dabuf->next = xfs_dabuf_global_list;
2279 xfs_dabuf_global_list = dabuf; 2278 xfs_dabuf_global_list = dabuf;
2280 mutex_spinunlock(&xfs_dabuf_global_lock, s); 2279 spin_unlock(&xfs_dabuf_global_lock);
2281 } 2280 }
2282#endif 2281#endif
2283 return dabuf; 2282 return dabuf;
@@ -2319,16 +2318,14 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf)
2319 kmem_free(dabuf->data, BBTOB(dabuf->bbcount)); 2318 kmem_free(dabuf->data, BBTOB(dabuf->bbcount));
2320#ifdef XFS_DABUF_DEBUG 2319#ifdef XFS_DABUF_DEBUG
2321 { 2320 {
2322 SPLDECL(s); 2321 spin_lock(&xfs_dabuf_global_lock);
2323
2324 s = mutex_spinlock(&xfs_dabuf_global_lock);
2325 if (dabuf->prev) 2322 if (dabuf->prev)
2326 dabuf->prev->next = dabuf->next; 2323 dabuf->prev->next = dabuf->next;
2327 else 2324 else
2328 xfs_dabuf_global_list = dabuf->next; 2325 xfs_dabuf_global_list = dabuf->next;
2329 if (dabuf->next) 2326 if (dabuf->next)
2330 dabuf->next->prev = dabuf->prev; 2327 dabuf->next->prev = dabuf->prev;
2331 mutex_spinunlock(&xfs_dabuf_global_lock, s); 2328 spin_unlock(&xfs_dabuf_global_lock);
2332 } 2329 }
2333 memset(dabuf, 0, XFS_DA_BUF_SIZE(dabuf->nbuf)); 2330 memset(dabuf, 0, XFS_DA_BUF_SIZE(dabuf->nbuf));
2334#endif 2331#endif
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 57be2f7b034c..f90d95582047 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -67,7 +67,7 @@ xfs_init(void)
67 extern kmem_zone_t *xfs_buf_item_zone; 67 extern kmem_zone_t *xfs_buf_item_zone;
68 extern kmem_zone_t *xfs_dabuf_zone; 68 extern kmem_zone_t *xfs_dabuf_zone;
69#ifdef XFS_DABUF_DEBUG 69#ifdef XFS_DABUF_DEBUG
70 extern lock_t xfs_dabuf_global_lock; 70 extern spinlock_t xfs_dabuf_global_lock;
71 spinlock_init(&xfs_dabuf_global_lock, "xfsda"); 71 spinlock_init(&xfs_dabuf_global_lock, "xfsda");
72#endif 72#endif
73 73