]> err.no Git - linux-2.6/blobdiff - fs/gfs2/glock.c
[GFS2] Remove unused function from glock.c
[linux-2.6] / fs / gfs2 / glock.c
index 8abfefe4efd4a82b7e5cb29bdc2230c27acfedab..b348053c436351754200e7f39b825eb64d57013a 100644 (file)
@@ -98,7 +98,7 @@ static rwlock_t gl_hash_locks[GL_HASH_LOCK_SZ];
 
 static inline rwlock_t *gl_lock_addr(unsigned int x)
 {
-       return &gl_hash_locks[(x) & (GL_HASH_LOCK_SZ-1)];
+       return &gl_hash_locks[x & (GL_HASH_LOCK_SZ-1)];
 }
 #else /* not SMP, so no spinlocks required */
 static inline rwlock_t *gl_lock_addr(x)
@@ -1494,26 +1494,20 @@ int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
 
 static int glock_compare(const void *arg_a, const void *arg_b)
 {
-       struct gfs2_holder *gh_a = *(struct gfs2_holder **)arg_a;
-       struct gfs2_holder *gh_b = *(struct gfs2_holder **)arg_b;
-       struct lm_lockname *a = &gh_a->gh_gl->gl_name;
-       struct lm_lockname *b = &gh_b->gh_gl->gl_name;
-       int ret = 0;
+       const struct gfs2_holder *gh_a = *(const struct gfs2_holder **)arg_a;
+       const struct gfs2_holder *gh_b = *(const struct gfs2_holder **)arg_b;
+       const struct lm_lockname *a = &gh_a->gh_gl->gl_name;
+       const struct lm_lockname *b = &gh_b->gh_gl->gl_name;
 
        if (a->ln_number > b->ln_number)
-               ret = 1;
-       else if (a->ln_number < b->ln_number)
-               ret = -1;
-       else {
-               if (gh_a->gh_state == LM_ST_SHARED &&
-                   gh_b->gh_state == LM_ST_EXCLUSIVE)
-                       ret = 1;
-               else if (!(gh_a->gh_flags & GL_LOCAL_EXCL) &&
-                        (gh_b->gh_flags & GL_LOCAL_EXCL))
-                       ret = 1;
-       }
-
-       return ret;
+               return 1;
+       if (a->ln_number < b->ln_number)
+               return -1;
+       if (gh_a->gh_state == LM_ST_SHARED && gh_b->gh_state == LM_ST_EXCLUSIVE)
+               return 1;
+       if (!(gh_a->gh_flags & GL_LOCAL_EXCL) && (gh_b->gh_flags & GL_LOCAL_EXCL))
+               return 1;
+       return 0;
 }
 
 /**
@@ -1811,22 +1805,6 @@ void gfs2_glock_cb(void *cb_data, unsigned int type, void *data)
        }
 }
 
-/**
- * gfs2_iopen_go_callback - Try to kick the inode/vnode associated with an
- *                          iopen glock from memory
- * @io_gl: the iopen glock
- * @state: the state into which the glock should be put
- *
- */
-
-void gfs2_iopen_go_callback(struct gfs2_glock *io_gl, unsigned int state)
-{
-
-       if (state != LM_ST_UNLOCKED)
-               return;
-       /* FIXME: remove this? */
-}
-
 /**
  * demote_ok - Check to see if it's ok to unlock a glock
  * @gl: the glock
@@ -2006,10 +1984,8 @@ void gfs2_scand_internal(struct gfs2_sbd *sdp)
 {
        unsigned int x;
 
-       for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
+       for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
                examine_bucket(scan_glock, sdp, x);
-               cond_resched();
-       }
 }
 
 /**