aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-04-28 10:59:12 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-28 10:59:12 -0400
commit08bc2dbc7327e89b9d5b9c8ef9401d1df2622fca (patch)
tree2c16cbd9f5bd856b00ef0a0d9f88b3afa67712ee /fs/gfs2/glock.c
parentc56b39cd2c55d521597f04bbd872a08d1c4373ca (diff)
[GFS2] [-mm patch] fs/gfs2/: possible cleanups
This patch contains the following possible cleanups: - make needlessly global code static - #if 0 unused functions - remove the following global function that was both unused and unimplemented: - super.c: gfs2_do_upgrade() Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index f82ecc0cc8fb..0a5a0e87b0a6 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -47,6 +47,8 @@ struct greedy {
47 47
48typedef void (*glock_examiner) (struct gfs2_glock * gl); 48typedef void (*glock_examiner) (struct gfs2_glock * gl);
49 49
50static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
51
50/** 52/**
51 * relaxed_state_ok - is a requested lock compatible with the current lock mode? 53 * relaxed_state_ok - is a requested lock compatible with the current lock mode?
52 * @actual: the current state of the lock 54 * @actual: the current state of the lock
@@ -228,8 +230,8 @@ static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
228 * Returns: NULL, or the struct gfs2_glock with the requested number 230 * Returns: NULL, or the struct gfs2_glock with the requested number
229 */ 231 */
230 232
231struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp, 233static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
232 struct lm_lockname *name) 234 struct lm_lockname *name)
233{ 235{
234 struct gfs2_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(name)]; 236 struct gfs2_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(name)];
235 struct gfs2_glock *gl; 237 struct gfs2_glock *gl;
@@ -421,8 +423,9 @@ void gfs2_holder_uninit(struct gfs2_holder *gh)
421 * Returns: the holder structure, NULL on ENOMEM 423 * Returns: the holder structure, NULL on ENOMEM
422 */ 424 */
423 425
424struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl, unsigned int state, 426static struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl,
425 int flags, gfp_t gfp_flags) 427 unsigned int state,
428 int flags, gfp_t gfp_flags)
426{ 429{
427 struct gfs2_holder *gh; 430 struct gfs2_holder *gh;
428 431
@@ -442,7 +445,7 @@ struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl, unsigned int state,
442 * 445 *
443 */ 446 */
444 447
445void gfs2_holder_put(struct gfs2_holder *gh) 448static void gfs2_holder_put(struct gfs2_holder *gh)
446{ 449{
447 gfs2_holder_uninit(gh); 450 gfs2_holder_uninit(gh);
448 kfree(gh); 451 kfree(gh);
@@ -674,7 +677,7 @@ void gfs2_glmutex_lock(struct gfs2_glock *gl)
674 * Returns: 1 if the glock is acquired 677 * Returns: 1 if the glock is acquired
675 */ 678 */
676 679
677int gfs2_glmutex_trylock(struct gfs2_glock *gl) 680static int gfs2_glmutex_trylock(struct gfs2_glock *gl)
678{ 681{
679 int acquired = 1; 682 int acquired = 1;
680 683
@@ -1301,7 +1304,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
1301 * 1304 *
1302 */ 1305 */
1303 1306
1304void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, int flags) 1307static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state,
1308 int flags)
1305{ 1309{
1306 struct gfs2_glock_operations *glops = gl->gl_ops; 1310 struct gfs2_glock_operations *glops = gl->gl_ops;
1307 1311
@@ -1329,7 +1333,7 @@ void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, int flags)
1329 * @gl: the glock 1333 * @gl: the glock
1330 * 1334 *
1331 */ 1335 */
1332 1336#if 0
1333void gfs2_glock_force_drop(struct gfs2_glock *gl) 1337void gfs2_glock_force_drop(struct gfs2_glock *gl)
1334{ 1338{
1335 struct gfs2_holder gh; 1339 struct gfs2_holder gh;
@@ -1345,6 +1349,7 @@ void gfs2_glock_force_drop(struct gfs2_glock *gl)
1345 wait_for_completion(&gh.gh_wait); 1349 wait_for_completion(&gh.gh_wait);
1346 gfs2_holder_uninit(&gh); 1350 gfs2_holder_uninit(&gh);
1347} 1351}
1352#endif /* 0 */
1348 1353
1349static void greedy_work(void *data) 1354static void greedy_work(void *data)
1350{ 1355{
@@ -1697,6 +1702,7 @@ void gfs2_lvb_unhold(struct gfs2_glock *gl)
1697 gfs2_glock_put(gl); 1702 gfs2_glock_put(gl);
1698} 1703}
1699 1704
1705#if 0
1700void gfs2_lvb_sync(struct gfs2_glock *gl) 1706void gfs2_lvb_sync(struct gfs2_glock *gl)
1701{ 1707{
1702 gfs2_glmutex_lock(gl); 1708 gfs2_glmutex_lock(gl);
@@ -1707,6 +1713,7 @@ void gfs2_lvb_sync(struct gfs2_glock *gl)
1707 1713
1708 gfs2_glmutex_unlock(gl); 1714 gfs2_glmutex_unlock(gl);
1709} 1715}
1716#endif /* 0 */
1710 1717
1711static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name, 1718static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,
1712 unsigned int state) 1719 unsigned int state)
@@ -2307,7 +2314,7 @@ static int dump_glock(struct gfs2_glock *gl)
2307 * 2314 *
2308 */ 2315 */
2309 2316
2310int gfs2_dump_lockstate(struct gfs2_sbd *sdp) 2317static int gfs2_dump_lockstate(struct gfs2_sbd *sdp)
2311{ 2318{
2312 struct gfs2_gl_hash_bucket *bucket; 2319 struct gfs2_gl_hash_bucket *bucket;
2313 struct gfs2_glock *gl; 2320 struct gfs2_glock *gl;