]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/gfs2/glock.c
[GFS2] Update copyright date to 2006
[mirror_ubuntu-jammy-kernel.git] / fs / gfs2 / glock.c
index f82ecc0cc8fbbe541ae93045ce8f46e6d61421cb..c041590315384d43fd40ec50cd8e18fe8aa6f06a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -18,7 +18,6 @@
 #include <linux/kref.h>
 #include <linux/kallsyms.h>
 #include <linux/gfs2_ondisk.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include "gfs2.h"
@@ -47,6 +46,8 @@ struct greedy {
 
 typedef void (*glock_examiner) (struct gfs2_glock * gl);
 
+static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
+
 /**
  * relaxed_state_ok - is a requested lock compatible with the current lock mode?
  * @actual: the current state of the lock
@@ -228,8 +229,8 @@ static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
  * Returns: NULL, or the struct gfs2_glock with the requested number
  */
 
-struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
-                                  struct lm_lockname *name)
+static struct gfs2_glock *gfs2_glock_find(struct gfs2_sbd *sdp,
+                                         struct lm_lockname *name)
 {
        struct gfs2_gl_hash_bucket *bucket = &sdp->sd_gl_hash[gl_hash(name)];
        struct gfs2_glock *gl;
@@ -421,8 +422,9 @@ void gfs2_holder_uninit(struct gfs2_holder *gh)
  * Returns: the holder structure, NULL on ENOMEM
  */
 
-struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl, unsigned int state,
-                                   int flags, gfp_t gfp_flags)
+static struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl,
+                                          unsigned int state,
+                                          int flags, gfp_t gfp_flags)
 {
        struct gfs2_holder *gh;
 
@@ -442,7 +444,7 @@ struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl, unsigned int state,
  *
  */
 
-void gfs2_holder_put(struct gfs2_holder *gh)
+static void gfs2_holder_put(struct gfs2_holder *gh)
 {
        gfs2_holder_uninit(gh);
        kfree(gh);
@@ -674,7 +676,7 @@ void gfs2_glmutex_lock(struct gfs2_glock *gl)
  * Returns: 1 if the glock is acquired
  */
 
-int gfs2_glmutex_trylock(struct gfs2_glock *gl)
+static int gfs2_glmutex_trylock(struct gfs2_glock *gl)
 {
        int acquired = 1;
 
@@ -1301,7 +1303,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
  *
  */
 
-void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, int flags)
+static void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state,
+                               int flags)
 {
        struct gfs2_glock_operations *glops = gl->gl_ops;
 
@@ -1324,28 +1327,6 @@ void gfs2_glock_prefetch(struct gfs2_glock *gl, unsigned int state, int flags)
        glops->go_xmote_th(gl, state, flags);
 }
 
-/**
- * gfs2_glock_force_drop - Force a glock to be uncached
- * @gl: the glock
- *
- */
-
-void gfs2_glock_force_drop(struct gfs2_glock *gl)
-{
-       struct gfs2_holder gh;
-
-       gfs2_holder_init(gl, LM_ST_UNLOCKED, 0, &gh);
-       set_bit(HIF_DEMOTE, &gh.gh_iflags);
-
-       spin_lock(&gl->gl_spin);
-       list_add_tail(&gh.gh_list, &gl->gl_waiters2);
-       run_queue(gl);
-       spin_unlock(&gl->gl_spin);
-
-       wait_for_completion(&gh.gh_wait);
-       gfs2_holder_uninit(&gh);
-}
-
 static void greedy_work(void *data)
 {
        struct greedy *gr = data;
@@ -1697,6 +1678,7 @@ void gfs2_lvb_unhold(struct gfs2_glock *gl)
        gfs2_glock_put(gl);
 }
 
+#if 0
 void gfs2_lvb_sync(struct gfs2_glock *gl)
 {
        gfs2_glmutex_lock(gl);
@@ -1707,6 +1689,7 @@ void gfs2_lvb_sync(struct gfs2_glock *gl)
 
        gfs2_glmutex_unlock(gl);
 }
+#endif  /*  0  */
 
 static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,
                        unsigned int state)
@@ -2141,7 +2124,7 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
                mutex_lock(&sdp->sd_invalidate_inodes_mutex);
                invalidate_inodes(sdp->sd_vfs);
                mutex_unlock(&sdp->sd_invalidate_inodes_mutex);
-               yield();
+               msleep(10);
        }
 }
 
@@ -2307,7 +2290,7 @@ static int dump_glock(struct gfs2_glock *gl)
  *
  */
 
-int gfs2_dump_lockstate(struct gfs2_sbd *sdp)
+static int gfs2_dump_lockstate(struct gfs2_sbd *sdp)
 {
        struct gfs2_gl_hash_bucket *bucket;
        struct gfs2_glock *gl;