rpms/kernel/devel linux-2.6-gfs2-dlm.patch,1.17,1.18
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Sep 12 10:04:55 UTC 2006
Author: dwmw2
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv10972
Modified Files:
linux-2.6-gfs2-dlm.patch
Log Message:
gfs2 update
linux-2.6-gfs2-dlm.patch:
CREDITS | 6
Documentation/filesystems/gfs2.txt | 43
MAINTAINERS | 18
fs/Kconfig | 2
fs/Makefile | 2
fs/configfs/item.c | 2
fs/dlm/Kconfig | 21
fs/dlm/Makefile | 19
fs/dlm/ast.c | 173 +
fs/dlm/ast.h | 26
fs/dlm/config.c | 789 +++++++
fs/dlm/config.h | 42
fs/dlm/debug_fs.c | 387 +++
fs/dlm/dir.c | 423 ++++
fs/dlm/dir.h | 30
fs/dlm/dlm_internal.h | 543 +++++
fs/dlm/lock.c | 3871 +++++++++++++++++++++++++++++++++++++
fs/dlm/lock.h | 62
fs/dlm/lockspace.c | 717 ++++++
fs/dlm/lockspace.h | 25
fs/dlm/lowcomms.c | 1238 +++++++++++
fs/dlm/lowcomms.h | 26
fs/dlm/lvb_table.h | 18
fs/dlm/main.c | 97
fs/dlm/member.c | 327 +++
fs/dlm/member.h | 24
fs/dlm/memory.c | 116 +
fs/dlm/memory.h | 29
fs/dlm/midcomms.c | 140 +
fs/dlm/midcomms.h | 21
fs/dlm/rcom.c | 472 ++++
fs/dlm/rcom.h | 24
fs/dlm/recover.c | 765 +++++++
fs/dlm/recover.h | 34
fs/dlm/recoverd.c | 290 ++
fs/dlm/recoverd.h | 24
fs/dlm/requestqueue.c | 184 +
fs/dlm/requestqueue.h | 22
fs/dlm/user.c | 788 +++++++
fs/dlm/user.h | 16
fs/dlm/util.c | 161 +
fs/dlm/util.h | 22
fs/gfs2/Kconfig | 44
fs/gfs2/Makefile | 10
fs/gfs2/acl.c | 309 ++
fs/gfs2/acl.h | 39
fs/gfs2/bmap.c | 1221 +++++++++++
fs/gfs2/bmap.h | 31
fs/gfs2/daemon.c | 196 +
fs/gfs2/daemon.h | 19
fs/gfs2/dir.c | 1966 ++++++++++++++++++
fs/gfs2/dir.h | 79
fs/gfs2/eaops.c | 230 ++
fs/gfs2/eaops.h | 30
fs/gfs2/eattr.c | 1502 ++++++++++++++
fs/gfs2/eattr.h | 100
fs/gfs2/gfs2.h | 31
fs/gfs2/glock.c | 2241 +++++++++++++++++++++
fs/gfs2/glock.h | 153 +
fs/gfs2/glops.c | 559 +++++
fs/gfs2/glops.h | 25
fs/gfs2/incore.h | 638 ++++++
fs/gfs2/inode.c | 1340 ++++++++++++
fs/gfs2/inode.h | 56
fs/gfs2/lm.c | 217 ++
fs/gfs2/lm.h | 42
fs/gfs2/lm_interface.h | 273 ++
fs/gfs2/locking.c | 185 +
fs/gfs2/locking/dlm/Makefile | 3
fs/gfs2/locking/dlm/lock.c | 524 +++++
fs/gfs2/locking/dlm/lock_dlm.h | 187 +
fs/gfs2/locking/dlm/main.c | 64
fs/gfs2/locking/dlm/mount.c | 255 ++
fs/gfs2/locking/dlm/plock.c | 301 ++
fs/gfs2/locking/dlm/sysfs.c | 226 ++
fs/gfs2/locking/dlm/thread.c | 359 +++
fs/gfs2/locking/nolock/Makefile | 3
fs/gfs2/locking/nolock/main.c | 247 ++
fs/gfs2/log.c | 593 +++++
fs/gfs2/log.h | 65
fs/gfs2/lops.c | 810 +++++++
fs/gfs2/lops.h | 99
fs/gfs2/main.c | 150 +
fs/gfs2/meta_io.c | 778 +++++++
fs/gfs2/meta_io.h | 78
fs/gfs2/mount.c | 214 ++
fs/gfs2/mount.h | 17
fs/gfs2/ondisk.c | 308 ++
fs/gfs2/ops_address.c | 820 +++++++
fs/gfs2/ops_address.h | 22
fs/gfs2/ops_dentry.c | 119 +
fs/gfs2/ops_dentry.h | 17
fs/gfs2/ops_export.c | 298 ++
fs/gfs2/ops_export.h | 22
fs/gfs2/ops_file.c | 811 +++++++
fs/gfs2/ops_file.h | 24
fs/gfs2/ops_fstype.c | 943 +++++++++
fs/gfs2/ops_fstype.h | 18
fs/gfs2/ops_inode.c | 1151 +++++++++++
fs/gfs2/ops_inode.h | 20
fs/gfs2/ops_super.c | 468 ++++
fs/gfs2/ops_super.h | 17
fs/gfs2/ops_vm.c | 184 +
fs/gfs2/ops_vm.h | 18
fs/gfs2/quota.c | 1232 +++++++++++
fs/gfs2/quota.h | 35
fs/gfs2/recovery.c | 573 +++++
fs/gfs2/recovery.h | 34
fs/gfs2/rgrp.c | 1514 ++++++++++++++
fs/gfs2/rgrp.h | 69
fs/gfs2/super.c | 977 +++++++++
fs/gfs2/super.h | 54
fs/gfs2/sys.c | 582 +++++
fs/gfs2/sys.h | 27
fs/gfs2/trans.c | 184 +
fs/gfs2/trans.h | 39
fs/gfs2/util.c | 245 ++
fs/gfs2/util.h | 170 +
include/linux/Kbuild | 33
include/linux/dlm.h | 302 ++
include/linux/dlm_device.h | 86
include/linux/fs.h | 3
include/linux/gfs2_ondisk.h | 443 ++++
include/linux/iflags.h | 102
include/linux/kernel.h | 1
include/linux/lock_dlm_plock.h | 41
mm/filemap.c | 3
mm/readahead.c | 1
128 files changed, 40537 insertions(+), 21 deletions(-)
Index: linux-2.6-gfs2-dlm.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-gfs2-dlm.patch,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- linux-2.6-gfs2-dlm.patch 7 Sep 2006 20:18:27 -0000 1.17
+++ linux-2.6-gfs2-dlm.patch 12 Sep 2006 10:04:53 -0000 1.18
@@ -2664,10 +2664,10 @@
+
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
new file mode 100644
-index 0000000..67247f0
+index 0000000..af2f2f0
--- /dev/null
+++ b/fs/dlm/lock.c
-@@ -0,0 +1,3869 @@
+@@ -0,0 +1,3871 @@
+/******************************************************************************
+*******************************************************************************
+**
@@ -5953,6 +5953,8 @@
+ hold_rsb(r);
+ lock_rsb(r);
+ _request_lock(r, lkb);
++ if (is_master(r))
++ confirm_master(r, 0);
+ unlock_rsb(r);
+ put_rsb(r);
+ break;
@@ -18228,7 +18230,7 @@
+
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
new file mode 100644
-index 0000000..87b37fe
+index 0000000..cf54b0b
--- /dev/null
+++ b/fs/gfs2/glock.c
@@ -0,0 +1,2241 @@
@@ -18252,6 +18254,7 @@
+#include <linux/kref.h>
+#include <linux/kallsyms.h>
+#include <linux/gfs2_ondisk.h>
++#include <linux/list.h>
+#include <asm/uaccess.h>
+
+#include "gfs2.h"
@@ -18267,24 +18270,75 @@
+#include "super.h"
+#include "util.h"
+
-+/* Must be kept in sync with the beginning of struct gfs2_glock */
-+struct glock_plug {
-+ struct list_head gl_list;
-+ unsigned long gl_flags;
-+};
-+
+struct greedy {
+ struct gfs2_holder gr_gh;
+ struct work_struct gr_work;
+};
+
++struct gfs2_gl_hash_bucket {
++ struct hlist_head hb_list;
++};
++
+typedef void (*glock_examiner) (struct gfs2_glock * gl);
+
+static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
+static int dump_glock(struct gfs2_glock *gl);
++static int dump_inode(struct gfs2_inode *ip);
++
++#define GFS2_GL_HASH_SHIFT 15
++#define GFS2_GL_HASH_SIZE (1 << GFS2_GL_HASH_SHIFT)
++#define GFS2_GL_HASH_MASK (GFS2_GL_HASH_SIZE - 1)
+
+static struct gfs2_gl_hash_bucket gl_hash_table[GFS2_GL_HASH_SIZE];
+
++/*
++ * Despite what you might think, the numbers below are not arbitrary :-)
++ * They are taken from the ipv4 routing hash code, which is well tested
++ * and thus should be nearly optimal. Later on we might tweek the numbers
++ * but for now this should be fine.
++ *
++ * The reason for putting the locks in a separate array from the list heads
++ * is that we can have fewer locks than list heads and save memory. We use
++ * the same hash function for both, but with a different hash mask.
++ */
++#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \
++ defined(CONFIG_PROVE_LOCKING)
++
++#ifdef CONFIG_LOCKDEP
++# define GL_HASH_LOCK_SZ 256
++#else
++# if NR_CPUS >= 32
++# define GL_HASH_LOCK_SZ 4096
++# elif NR_CPUS >= 16
++# define GL_HASH_LOCK_SZ 2048
++# elif NR_CPUS >= 8
++# define GL_HASH_LOCK_SZ 1024
++# elif NR_CPUS >= 4
++# define GL_HASH_LOCK_SZ 512
++# else
++# define GL_HASH_LOCK_SZ 256
++# endif
++#endif
++
++/* We never want more locks than chains */
++#if GFS2_GL_HASH_SIZE < GL_HASH_LOCK_SZ
++# undef GL_HASH_LOCK_SZ
++# define GL_HASH_LOCK_SZ GFS2_GL_HASH_SIZE
++#endif
++
++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)];
++}
++#else /* not SMP, so no spinlocks required */
++static inline rwlock_t *gl_lock_addr(x)
++{
++ return NULL;
++}
++#endif
++
+/**
+ * relaxed_state_ok - is a requested lock compatible with the current lock mode?
+ * @actual: the current state of the lock
@@ -18388,19 +18442,18 @@
+
+int gfs2_glock_put(struct gfs2_glock *gl)
+{
-+ struct gfs2_gl_hash_bucket *bucket = gl->gl_bucket;
+ int rv = 0;
+
-+ write_lock(&bucket->hb_lock);
++ write_lock(gl_lock_addr(gl->gl_hash));
+ if (kref_put(&gl->gl_ref, kill_glock)) {
-+ list_del_init(&gl->gl_list);
-+ write_unlock(&bucket->hb_lock);
++ hlist_del(&gl->gl_list);
++ write_unlock(gl_lock_addr(gl->gl_hash));
+ BUG_ON(spin_is_locked(&gl->gl_spin));
+ glock_free(gl);
+ rv = 1;
+ goto out;
+ }
-+ write_unlock(&bucket->hb_lock);
++ write_unlock(gl_lock_addr(gl->gl_hash));
+out:
+ return rv;
+}
@@ -18437,15 +18490,14 @@
+ * Returns: NULL, or the struct gfs2_glock with the requested number
+ */
+
-+static struct gfs2_glock *search_bucket(struct gfs2_gl_hash_bucket *bucket,
++static struct gfs2_glock *search_bucket(unsigned int hash,
+ const struct gfs2_sbd *sdp,
+ const struct lm_lockname *name)
+{
+ struct gfs2_glock *gl;
++ struct hlist_node *h;
+
-+ list_for_each_entry(gl, &bucket->hb_list, gl_list) {
-+ if (test_bit(GLF_PLUG, &gl->gl_flags))
-+ continue;
++ hlist_for_each_entry(gl, h, &gl_hash_table[hash].hb_list, gl_list) {
+ if (!lm_name_equal(&gl->gl_name, name))
+ continue;
+ if (gl->gl_sbd != sdp)
@@ -18470,12 +18522,12 @@
+static struct gfs2_glock *gfs2_glock_find(const struct gfs2_sbd *sdp,
+ const struct lm_lockname *name)
+{
-+ struct gfs2_gl_hash_bucket *bucket = &gl_hash_table[gl_hash(sdp, name)];
++ unsigned int hash = gl_hash(sdp, name);
+ struct gfs2_glock *gl;
+
-+ read_lock(&bucket->hb_lock);
-+ gl = search_bucket(bucket, sdp, name);
-+ read_unlock(&bucket->hb_lock);
++ read_lock(gl_lock_addr(hash));
++ gl = search_bucket(hash, sdp, name);
++ read_unlock(gl_lock_addr(hash));
+
+ return gl;
+}
@@ -18497,18 +18549,14 @@
+ const struct gfs2_glock_operations *glops, int create,
+ struct gfs2_glock **glp)
+{
-+ struct lm_lockname name;
++ struct lm_lockname name = { .ln_number = number, .ln_type = glops->go_type };
+ struct gfs2_glock *gl, *tmp;
-+ struct gfs2_gl_hash_bucket *bucket;
++ unsigned int hash = gl_hash(sdp, &name);
+ int error;
+
-+ name.ln_number = number;
-+ name.ln_type = glops->go_type;
-+ bucket = &gl_hash_table[gl_hash(sdp, &name)];
-+
-+ read_lock(&bucket->hb_lock);
-+ gl = search_bucket(bucket, sdp, &name);
-+ read_unlock(&bucket->hb_lock);
++ read_lock(gl_lock_addr(hash));
++ gl = search_bucket(hash, sdp, &name);
++ read_unlock(gl_lock_addr(hash));
+
+ if (gl || !create) {
+ *glp = gl;
@@ -18523,6 +18571,7 @@
+ gl->gl_name = name;
+ kref_init(&gl->gl_ref);
+ gl->gl_state = LM_ST_UNLOCKED;
++ gl->gl_hash = hash;
+ gl->gl_owner = NULL;
+ gl->gl_ip = 0;
+ gl->gl_ops = glops;
@@ -18531,7 +18580,6 @@
+ gl->gl_vn = 0;
+ gl->gl_stamp = jiffies;
+ gl->gl_object = NULL;
-+ gl->gl_bucket = bucket;
+ gl->gl_sbd = sdp;
+ gl->gl_aspace = NULL;
+ lops_init_le(&gl->gl_le, &gfs2_glock_lops);
@@ -18550,15 +18598,15 @@
+ if (error)
+ goto fail_aspace;
+
-+ write_lock(&bucket->hb_lock);
-+ tmp = search_bucket(bucket, sdp, &name);
++ write_lock(gl_lock_addr(hash));
++ tmp = search_bucket(hash, sdp, &name);
+ if (tmp) {
-+ write_unlock(&bucket->hb_lock);
++ write_unlock(gl_lock_addr(hash));
+ glock_free(gl);
+ gl = tmp;
+ } else {
-+ list_add_tail(&gl->gl_list, &bucket->hb_list);
-+ write_unlock(&bucket->hb_lock);
++ hlist_add_head(&gl->gl_list, &gl_hash_table[hash].hb_list);
++ write_unlock(gl_lock_addr(hash));
+ }
+
+ *glp = gl;
@@ -19677,26 +19725,20 @@
+
+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;
+}
+
+/**
@@ -19947,8 +19989,9 @@
+ * a journal from another client needs to be recovered.
+ */
+
-+void gfs2_glock_cb(struct gfs2_sbd *sdp, unsigned int type, void *data)
++void gfs2_glock_cb(void *cb_data, unsigned int type, void *data)
+{
++ struct gfs2_sbd *sdp = cb_data;
+
+ switch (type) {
+ case LM_CB_NEED_E:
@@ -19994,22 +20037,6 @@
+}
+
+/**
-+ * 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
+ *
@@ -20101,53 +20128,37 @@
+ */
+
+static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,
-+ struct gfs2_gl_hash_bucket *bucket)
++ unsigned int hash)
+{
-+ struct glock_plug plug;
-+ struct list_head *tmp;
-+ struct gfs2_glock *gl;
-+ int entries;
-+
-+ /* Add "plug" to end of bucket list, work back up list from there */
-+ memset(&plug.gl_flags, 0, sizeof(unsigned long));
-+ set_bit(GLF_PLUG, &plug.gl_flags);
-+
-+ write_lock(&bucket->hb_lock);
-+ list_add(&plug.gl_list, &bucket->hb_list);
-+ write_unlock(&bucket->hb_lock);
-+
-+ for (;;) {
-+ write_lock(&bucket->hb_lock);
-+
-+ for (;;) {
-+ tmp = plug.gl_list.next;
-+
-+ if (tmp == &bucket->hb_list) {
-+ list_del(&plug.gl_list);
-+ entries = !list_empty(&bucket->hb_list);
-+ write_unlock(&bucket->hb_lock);
-+ return entries;
-+ }
-+ gl = list_entry(tmp, struct gfs2_glock, gl_list);
-+
-+ /* Move plug up list */
-+ list_move(&plug.gl_list, &gl->gl_list);
-+
-+ if (test_bit(GLF_PLUG, &gl->gl_flags))
-+ continue;
-+ if (gl->gl_sbd != sdp)
-+ continue;
-+
-+ /* examiner() must glock_put() */
++ struct gfs2_glock *gl, *prev = NULL;
++ int has_entries = 0;
++ struct hlist_head *head = &gl_hash_table[hash].hb_list;
++
++ read_lock(gl_lock_addr(hash));
++ /* Can't use hlist_for_each_entry - don't want prefetch here */
++ if (hlist_empty(head))
++ goto out;
++ has_entries = 1;
++ gl = list_entry(head->first, struct gfs2_glock, gl_list);
++ while(1) {
++ if (gl->gl_sbd == sdp) {
+ gfs2_glock_hold(gl);
-+
-+ break;
++ read_unlock(gl_lock_addr(hash));
++ if (prev)
++ gfs2_glock_put(prev);
++ prev = gl;
++ examiner(gl);
++ read_lock(gl_lock_addr(hash));
+ }
-+
-+ write_unlock(&bucket->hb_lock);
-+
-+ examiner(gl);
++ if (gl->gl_list.next == NULL)
++ break;
++ gl = list_entry(gl->gl_list.next, struct gfs2_glock, gl_list);
+ }
++out:
++ read_unlock(gl_lock_addr(hash));
++ if (prev)
++ gfs2_glock_put(prev);
++ return has_entries;
+}
+
+/**
@@ -20159,23 +20170,19 @@
+static void scan_glock(struct gfs2_glock *gl)
+{
+ if (gl->gl_ops == &gfs2_inode_glops)
-+ goto out;
++ return;
+
+ if (gfs2_glmutex_trylock(gl)) {
+ if (queue_empty(gl, &gl->gl_holders) &&
-+ gl->gl_state != LM_ST_UNLOCKED &&
-+ demote_ok(gl))
++ gl->gl_state != LM_ST_UNLOCKED && demote_ok(gl))
+ goto out_schedule;
+ gfs2_glmutex_unlock(gl);
+ }
-+out:
-+ gfs2_glock_put(gl);
+ return;
+
+out_schedule:
+ gfs2_glmutex_unlock(gl);
+ gfs2_glock_schedule_for_reclaim(gl);
-+ gfs2_glock_put(gl);
+}
+
+/**
@@ -20188,10 +20195,8 @@
+{
+ unsigned int x;
+
-+ for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
-+ examine_bucket(scan_glock, sdp, &gl_hash_table[x]);
-+ cond_resched();
-+ }
++ for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
++ examine_bucket(scan_glock, sdp, x);
+}
+
+/**
@@ -20220,11 +20225,8 @@
+ if (queue_empty(gl, &gl->gl_holders) &&
+ gl->gl_state != LM_ST_UNLOCKED)
+ handle_callback(gl, LM_ST_UNLOCKED);
-+
+ gfs2_glmutex_unlock(gl);
+ }
-+
-+ gfs2_glock_put(gl);
+}
+
+/**
@@ -20246,10 +20248,10 @@
+
+ for (;;) {
+ cont = 0;
-+
-+ for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
-+ if (examine_bucket(clear_glock, sdp, &gl_hash_table[x]))
++ for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
++ if (examine_bucket(clear_glock, sdp, x))
+ cont = 1;
++ }
+
+ if (!wait || !cont)
+ break;
@@ -20431,19 +20433,16 @@
+
+static int gfs2_dump_lockstate(struct gfs2_sbd *sdp)
+{
-+ struct gfs2_gl_hash_bucket *bucket;
+ struct gfs2_glock *gl;
++ struct hlist_node *h;
+ unsigned int x;
+ int error = 0;
+
+ for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
-+ bucket = &gl_hash_table[x];
+
-+ read_lock(&bucket->hb_lock);
++ read_lock(gl_lock_addr(x));
+
-+ list_for_each_entry(gl, &bucket->hb_list, gl_list) {
-+ if (test_bit(GLF_PLUG, &gl->gl_flags))
-+ continue;
++ hlist_for_each_entry(gl, h, &gl_hash_table[x].hb_list, gl_list) {
+ if (gl->gl_sbd != sdp)
+ continue;
+
@@ -20452,7 +20451,7 @@
+ break;
+ }
+
-+ read_unlock(&bucket->hb_lock);
++ read_unlock(gl_lock_addr(x));
+
+ if (error)
+ break;
@@ -20466,19 +20465,22 @@
+{
+ unsigned i;
+ for(i = 0; i < GFS2_GL_HASH_SIZE; i++) {
-+ struct gfs2_gl_hash_bucket *hb = &gl_hash_table[i];
-+ rwlock_init(&hb->hb_lock);
-+ INIT_LIST_HEAD(&hb->hb_list);
++ INIT_HLIST_HEAD(&gl_hash_table[i].hb_list);
+ }
++#ifdef GL_HASH_LOCK_SZ
++ for(i = 0; i < GL_HASH_LOCK_SZ; i++) {
++ rwlock_init(&gl_hash_locks[i]);
++ }
++#endif
+ return 0;
+}
+
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
new file mode 100644
-index 0000000..e3bf4bc
+index 0000000..2b2a889
--- /dev/null
+++ b/fs/gfs2/glock.h
-@@ -0,0 +1,155 @@
+@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
@@ -20621,9 +20623,7 @@
+int gfs2_lvb_hold(struct gfs2_glock *gl);
+void gfs2_lvb_unhold(struct gfs2_glock *gl);
+
-+void gfs2_glock_cb(struct gfs2_sbd *sdp, unsigned int type, void *data);
-+
-+void gfs2_iopen_go_callback(struct gfs2_glock *gl, unsigned int state);
++void gfs2_glock_cb(void *cb_data, unsigned int type, void *data);
+
+void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl);
+void gfs2_reclaim_glock(struct gfs2_sbd *sdp);
@@ -20636,10 +20636,10 @@
+#endif /* __GLOCK_DOT_H__ */
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
new file mode 100644
-index 0000000..0c50a72
+index 0000000..d3aef74
--- /dev/null
+++ b/fs/gfs2/glops.c
-@@ -0,0 +1,560 @@
+@@ -0,0 +1,559 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
@@ -21171,7 +21171,6 @@
+const struct gfs2_glock_operations gfs2_iopen_glops = {
+ .go_xmote_th = gfs2_glock_xmote_th,
+ .go_drop_th = gfs2_glock_drop_th,
-+ .go_callback = gfs2_iopen_go_callback,
+ .go_type = LM_TYPE_IOPEN,
+};
+
@@ -21233,10 +21232,10 @@
+#endif /* __GLOPS_DOT_H__ */
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
new file mode 100644
-index 0000000..6184960
+index 0000000..c68d392
--- /dev/null
+++ b/fs/gfs2/incore.h
-@@ -0,0 +1,647 @@
+@@ -0,0 +1,638 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
@@ -21345,11 +21344,6 @@
+ struct list_head bd_ail_gl_list;
+};
+
-+struct gfs2_gl_hash_bucket {
-+ rwlock_t hb_lock;
-+ struct list_head hb_list;
-+};
-+
+struct gfs2_glock_operations {
+ void (*go_xmote_th) (struct gfs2_glock * gl, unsigned int state,
+ int flags);
@@ -21396,7 +21390,6 @@
+};
+
+enum {
-+ GLF_PLUG = 0,
+ GLF_LOCK = 1,
+ GLF_STICKY = 2,
+ GLF_PREFETCH = 3,
@@ -21406,7 +21399,7 @@
+};
+
+struct gfs2_glock {
-+ struct list_head gl_list;
++ struct hlist_node gl_list;
+ unsigned long gl_flags; /* GLF_... */
+ struct lm_lockname gl_name;
+ struct kref gl_ref;
@@ -21414,6 +21407,7 @@
+ spinlock_t gl_spin;
+
+ unsigned int gl_state;
++ unsigned int gl_hash;
+ struct task_struct *gl_owner;
+ unsigned long gl_ip;
+ struct list_head gl_holders;
@@ -21426,7 +21420,7 @@
+ struct gfs2_holder *gl_req_gh;
+ gfs2_glop_bh_t gl_req_bh;
+
-+ lm_lock_t *gl_lock;
++ void *gl_lock;
+ char *gl_lvb;
+ atomic_t gl_lvb_count;
+
@@ -21434,7 +21428,6 @@
+ unsigned long gl_stamp;
+ void *gl_object;
+
-+ struct gfs2_gl_hash_bucket *gl_bucket;
+ struct list_head gl_reclaim;
+
+ struct gfs2_sbd *gl_sbd;
@@ -21692,9 +21685,6 @@
+ SDF_NOATIME = 3,
+};
+
-+#define GFS2_GL_HASH_SHIFT 13
-+#define GFS2_GL_HASH_SIZE (1 << GFS2_GL_HASH_SHIFT)
-+#define GFS2_GL_HASH_MASK (GFS2_GL_HASH_SIZE - 1)
+#define GFS2_FSNAME_LEN 256
+
+struct gfs2_sbd {
@@ -23294,7 +23284,7 @@
+
diff --git a/fs/gfs2/lm.c b/fs/gfs2/lm.c
new file mode 100644
-index 0000000..e60f95c
+index 0000000..4e23aa5
--- /dev/null
+++ b/fs/gfs2/lm.c
@@ -0,0 +1,217 @@
@@ -23422,7 +23412,7 @@
+}
+
+int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
-+ lm_lock_t **lockp)
++ void **lockp)
+{
+ int error = -EIO;
+ if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
@@ -23431,13 +23421,13 @@
+ return error;
+}
+
-+void gfs2_lm_put_lock(struct gfs2_sbd *sdp, lm_lock_t *lock)
++void gfs2_lm_put_lock(struct gfs2_sbd *sdp, void *lock)
+{
+ if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+ sdp->sd_lockstruct.ls_ops->lm_put_lock(lock);
+}
+
-+unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
++unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, void *lock,
+ unsigned int cur_state, unsigned int req_state,
+ unsigned int flags)
+{
@@ -23448,7 +23438,7 @@
+ return ret;
+}
+
-+unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock,
++unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, void *lock,
+ unsigned int cur_state)
+{
+ int ret = 0;
@@ -23457,13 +23447,13 @@
+ return ret;
+}
+
-+void gfs2_lm_cancel(struct gfs2_sbd *sdp, lm_lock_t *lock)
++void gfs2_lm_cancel(struct gfs2_sbd *sdp, void *lock)
+{
+ if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+ sdp->sd_lockstruct.ls_ops->lm_cancel(lock);
+}
+
-+int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp)
++int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, void *lock, char **lvbp)
+{
+ int error = -EIO;
+ if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
@@ -23471,7 +23461,7 @@
+ return error;
+}
+
-+void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb)
++void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, void *lock, char *lvb)
+{
+ if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
+ sdp->sd_lockstruct.ls_ops->lm_unhold_lvb(lock, lvb);
@@ -23517,7 +23507,7 @@
+
diff --git a/fs/gfs2/lm.h b/fs/gfs2/lm.h
new file mode 100644
-index 0000000..6b890e7
+index 0000000..21cdc30
--- /dev/null
+++ b/fs/gfs2/lm.h
@@ -0,0 +1,42 @@
@@ -23543,16 +23533,16 @@
+int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
+ __attribute__ ((format(printf, 2, 3)));
+int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
-+ lm_lock_t **lockp);
-+void gfs2_lm_put_lock(struct gfs2_sbd *sdp, lm_lock_t *lock);
-+unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
++ void **lockp);
++void gfs2_lm_put_lock(struct gfs2_sbd *sdp, void *lock);
++unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, void *lock,
+ unsigned int cur_state, unsigned int req_state,
+ unsigned int flags);
-+unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock,
++unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, void *lock,
+ unsigned int cur_state);
-+void gfs2_lm_cancel(struct gfs2_sbd *sdp, lm_lock_t *lock);
-+int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char **lvbp);
-+void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb);
++void gfs2_lm_cancel(struct gfs2_sbd *sdp, void *lock);
++int gfs2_lm_hold_lvb(struct gfs2_sbd *sdp, void *lock, char **lvbp);
++void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, void *lock, char *lvb);
+int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl);
+int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name,
@@ -23565,10 +23555,10 @@
+#endif /* __LM_DOT_H__ */
diff --git a/fs/gfs2/lm_interface.h b/fs/gfs2/lm_interface.h
new file mode 100644
-index 0000000..75835e0
+index 0000000..1418fdc
--- /dev/null
+++ b/fs/gfs2/lm_interface.h
-@@ -0,0 +1,287 @@
+@@ -0,0 +1,273 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
@@ -23581,16 +23571,8 @@
+#ifndef __LM_INTERFACE_DOT_H__
+#define __LM_INTERFACE_DOT_H__
+
-+/*
-+ * Opaque handles represent the lock module's lockspace structure, the lock
-+ * module's lock structures, and GFS's file system (superblock) structure.
-+ */
-+
-+typedef void lm_lockspace_t;
-+typedef void lm_lock_t;
-+struct gfs2_sbd;
+
-+typedef void (*lm_callback_t) (struct gfs2_sbd *sdp, unsigned int type, void *data);
++typedef void (*lm_callback_t) (void *ptr, unsigned int type, void *data);
+
+/*
+ * lm_mount() flags
@@ -23746,65 +23728,60 @@
+struct lm_lockstruct;
+
+struct lm_lockops {
-+ char lm_proto_name[256];
++ const char *lm_proto_name;
+
+ /*
+ * Mount/Unmount
+ */
+
+ int (*lm_mount) (char *table_name, char *host_data,
-+ lm_callback_t cb, struct gfs2_sbd *sdp,
++ lm_callback_t cb, void *cb_data,
+ unsigned int min_lvb_size, int flags,
+ struct lm_lockstruct *lockstruct,
+ struct kobject *fskobj);
+
-+ void (*lm_others_may_mount) (lm_lockspace_t *lockspace);
++ void (*lm_others_may_mount) (void *lockspace);
+
-+ void (*lm_unmount) (lm_lockspace_t *lockspace);
++ void (*lm_unmount) (void *lockspace);
+
-+ void (*lm_withdraw) (lm_lockspace_t *lockspace);
++ void (*lm_withdraw) (void *lockspace);
+
+ /*
+ * Lock oriented operations
+ */
+
-+ int (*lm_get_lock) (lm_lockspace_t *lockspace,
-+ struct lm_lockname *name, lm_lock_t **lockp);
++ int (*lm_get_lock) (void *lockspace, struct lm_lockname *name, void **lockp);
+
-+ void (*lm_put_lock) (lm_lock_t *lock);
++ void (*lm_put_lock) (void *lock);
+
-+ unsigned int (*lm_lock) (lm_lock_t *lock, unsigned int cur_state,
++ unsigned int (*lm_lock) (void *lock, unsigned int cur_state,
+ unsigned int req_state, unsigned int flags);
+
-+ unsigned int (*lm_unlock) (lm_lock_t *lock, unsigned int cur_state);
++ unsigned int (*lm_unlock) (void *lock, unsigned int cur_state);
+
-+ void (*lm_cancel) (lm_lock_t *lock);
++ void (*lm_cancel) (void *lock);
+
-+ int (*lm_hold_lvb) (lm_lock_t *lock, char **lvbp);
-+ void (*lm_unhold_lvb) (lm_lock_t *lock, char *lvb);
-+ void (*lm_sync_lvb) (lm_lock_t *lock, char *lvb);
++ int (*lm_hold_lvb) (void *lock, char **lvbp);
++ void (*lm_unhold_lvb) (void *lock, char *lvb);
+
+ /*
+ * Posix Lock oriented operations
+ */
+
-+ int (*lm_plock_get) (lm_lockspace_t *lockspace,
-+ struct lm_lockname *name,
++ int (*lm_plock_get) (void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl);
+
-+ int (*lm_plock) (lm_lockspace_t *lockspace,
-+ struct lm_lockname *name,
++ int (*lm_plock) (void *lockspace, struct lm_lockname *name,
+ struct file *file, int cmd, struct file_lock *fl);
+
-+ int (*lm_punlock) (lm_lockspace_t *lockspace,
-+ struct lm_lockname *name,
++ int (*lm_punlock) (void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl);
+
+ /*
+ * Client oriented operations
+ */
+
-+ void (*lm_recovery_done) (lm_lockspace_t *lockspace, unsigned int jid,
++ void (*lm_recovery_done) (void *lockspace, unsigned int jid,
+ unsigned int message);
+
+ struct module *lm_owner;
@@ -23825,8 +23802,8 @@
+ unsigned int ls_jid;
+ unsigned int ls_first;
+ unsigned int ls_lvb_size;
-+ lm_lockspace_t *ls_lockspace;
-+ struct lm_lockops *ls_ops;
++ void *ls_lockspace;
++ const struct lm_lockops *ls_ops;
+ int ls_flags;
+};
+
@@ -23835,9 +23812,8 @@
+ * with these functions.
+ */
+
-+int gfs2_register_lockproto(struct lm_lockops *proto);
-+
-+void gfs2_unregister_lockproto(struct lm_lockops *proto);
++int gfs2_register_lockproto(const struct lm_lockops *proto);
++void gfs2_unregister_lockproto(const struct lm_lockops *proto);
+
+/*
+ * Lock module top interface. GFS calls these functions when mounting or
@@ -23845,7 +23821,7 @@
+ */
+
+int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
-+ lm_callback_t cb, struct gfs2_sbd *sdp,
++ lm_callback_t cb, void *cb_data,
+ unsigned int min_lvb_size, int flags,
+ struct lm_lockstruct *lockstruct,
+ struct kobject *fskobj);
@@ -23858,7 +23834,7 @@
+
diff --git a/fs/gfs2/locking.c b/fs/gfs2/locking.c
new file mode 100644
-index 0000000..31421ee
+index 0000000..65eca48
--- /dev/null
+++ b/fs/gfs2/locking.c
@@ -0,0 +1,185 @@
@@ -23885,7 +23861,7 @@
+
+struct lmh_wrapper {
+ struct list_head lw_list;
-+ struct lm_lockops *lw_ops;
++ const struct lm_lockops *lw_ops;
+};
+
+/* List of registered low-level locking protocols. A file system selects one
@@ -23901,7 +23877,7 @@
+ * Returns: 0 on success, -EXXX on failure
+ */
+
-+int gfs2_register_lockproto(struct lm_lockops *proto)
++int gfs2_register_lockproto(const struct lm_lockops *proto)
+{
+ struct lmh_wrapper *lw;
+
@@ -23936,7 +23912,7 @@
+ *
+ */
+
-+void gfs2_unregister_lockproto(struct lm_lockops *proto)
++void gfs2_unregister_lockproto(const struct lm_lockops *proto)
+{
+ struct lmh_wrapper *lw;
+
@@ -23972,7 +23948,7 @@
+ */
+
+int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
-+ lm_callback_t cb, struct gfs2_sbd *sdp,
++ lm_callback_t cb, void *cb_data,
+ unsigned int min_lvb_size, int flags,
+ struct lm_lockstruct *lockstruct,
+ struct kobject *fskobj)
@@ -24011,7 +23987,7 @@
+ goto retry;
+ }
+
-+ error = lw->lw_ops->lm_mount(table_name, host_data, cb, sdp,
++ error = lw->lw_ops->lm_mount(table_name, host_data, cb, cb_data,
+ min_lvb_size, flags, lockstruct, fskobj);
+ if (error)
+ module_put(lw->lw_ops->lm_owner);
@@ -24058,10 +24034,10 @@
+
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
new file mode 100644
-index 0000000..dceea41
+index 0000000..b167add
--- /dev/null
+++ b/fs/gfs2/locking/dlm/lock.c
-@@ -0,0 +1,541 @@
+@@ -0,0 +1,524 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
@@ -24271,21 +24247,21 @@
+ kfree(lp);
+}
+
-+int gdlm_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name,
-+ lm_lock_t **lockp)
++int gdlm_get_lock(void *lockspace, struct lm_lockname *name,
++ void **lockp)
+{
+ struct gdlm_lock *lp;
+ int error;
+
-+ error = gdlm_create_lp((struct gdlm_ls *) lockspace, name, &lp);
++ error = gdlm_create_lp(lockspace, name, &lp);
+
-+ *lockp = (lm_lock_t *) lp;
++ *lockp = lp;
+ return error;
+}
+
-+void gdlm_put_lock(lm_lock_t *lock)
++void gdlm_put_lock(void *lock)
+{
-+ gdlm_delete_lp((struct gdlm_lock *) lock);
++ gdlm_delete_lp(lock);
+}
+
+unsigned int gdlm_do_lock(struct gdlm_lock *lp)
@@ -24369,10 +24345,10 @@
+ return LM_OUT_ASYNC;
+}
+
-+unsigned int gdlm_lock(lm_lock_t *lock, unsigned int cur_state,
++unsigned int gdlm_lock(void *lock, unsigned int cur_state,
+ unsigned int req_state, unsigned int flags)
+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
++ struct gdlm_lock *lp = lock;
+
+ clear_bit(LFL_DLM_CANCEL, &lp->flags);
+ if (flags & LM_FLAG_NOEXP)
@@ -24385,9 +24361,9 @@
+ return gdlm_do_lock(lp);
+}
+
-+unsigned int gdlm_unlock(lm_lock_t *lock, unsigned int cur_state)
++unsigned int gdlm_unlock(void *lock, unsigned int cur_state)
+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
++ struct gdlm_lock *lp = lock;
+
+ clear_bit(LFL_DLM_CANCEL, &lp->flags);
+ if (lp->cur == DLM_LOCK_IV)
@@ -24395,9 +24371,9 @@
+ return gdlm_do_unlock(lp);
+}
+
-+void gdlm_cancel(lm_lock_t *lock)
++void gdlm_cancel(void *lock)
+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
++ struct gdlm_lock *lp = lock;
+ struct gdlm_ls *ls = lp->ls;
+ int error, delay_list = 0;
+
@@ -24528,9 +24504,9 @@
+ intact on the resource while the lvb is "held" even if it's holding no locks
+ on the resource. */
+
-+int gdlm_hold_lvb(lm_lock_t *lock, char **lvbp)
++int gdlm_hold_lvb(void *lock, char **lvbp)
+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
++ struct gdlm_lock *lp = lock;
+ int error;
+
+ error = gdlm_add_lvb(lp);
@@ -24546,31 +24522,14 @@
+ return error;
+}
+
-+void gdlm_unhold_lvb(lm_lock_t *lock, char *lvb)
++void gdlm_unhold_lvb(void *lock, char *lvb)
+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
++ struct gdlm_lock *lp = lock;
+
+ unhold_null_lock(lp);
+ gdlm_del_lvb(lp);
+}
+
-+void gdlm_sync_lvb(lm_lock_t *lock, char *lvb)
-+{
-+ struct gdlm_lock *lp = (struct gdlm_lock *) lock;
-+
-+ if (lp->cur != DLM_LOCK_EX)
-+ return;
-+
-+ init_completion(&lp->ast_wait);
-+ set_bit(LFL_SYNC_LVB, &lp->flags);
-+
-+ lp->req = DLM_LOCK_EX;
-+ lp->lkf = make_flags(lp, 0, lp->cur, lp->req);
-+
-+ gdlm_do_lock(lp);
-+ wait_for_completion(&lp->ast_wait);
-+}
-+
+void gdlm_submit_delayed(struct gdlm_ls *ls)
+{
+ struct gdlm_lock *lp, *safe;
@@ -24605,10 +24564,10 @@
+
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
new file mode 100644
-index 0000000..e6898d2
+index 0000000..3a45c02
--- /dev/null
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
-@@ -0,0 +1,188 @@
+@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
@@ -24723,7 +24682,7 @@
+ s16 cur;
+ s16 req;
+ s16 prev_req;
-+ u32 lkf; /* dlm flags DLM_LKF_ */
++ u32 lkf; /* dlm flags DLM_LKF_ */
+ unsigned long flags; /* lock_dlm flags LFL_ */
+
+ int bast_mode; /* protected by async_lock */
@@ -24776,24 +24735,23 @@
+void gdlm_delete_lp(struct gdlm_lock *);
+unsigned int gdlm_do_lock(struct gdlm_lock *);
+
-+int gdlm_get_lock(lm_lockspace_t *, struct lm_lockname *, lm_lock_t **);
-+void gdlm_put_lock(lm_lock_t *);
-+unsigned int gdlm_lock(lm_lock_t *, unsigned int, unsigned int, unsigned int);
-+unsigned int gdlm_unlock(lm_lock_t *, unsigned int);
-+void gdlm_cancel(lm_lock_t *);
-+int gdlm_hold_lvb(lm_lock_t *, char **);
-+void gdlm_unhold_lvb(lm_lock_t *, char *);
-+void gdlm_sync_lvb(lm_lock_t *, char *);
++int gdlm_get_lock(void *, struct lm_lockname *, void **);
++void gdlm_put_lock(void *);
++unsigned int gdlm_lock(void *, unsigned int, unsigned int, unsigned int);
++unsigned int gdlm_unlock(void *, unsigned int);
++void gdlm_cancel(void *);
++int gdlm_hold_lvb(void *, char **);
++void gdlm_unhold_lvb(void *, char *);
+
+/* plock.c */
+
+int gdlm_plock_init(void);
+void gdlm_plock_exit(void);
-+int gdlm_plock(lm_lockspace_t *, struct lm_lockname *, struct file *, int,
++int gdlm_plock(void *, struct lm_lockname *, struct file *, int,
+ struct file_lock *);
-+int gdlm_plock_get(lm_lockspace_t *, struct lm_lockname *, struct file *,
++int gdlm_plock_get(void *, struct lm_lockname *, struct file *,
+ struct file_lock *);
-+int gdlm_punlock(lm_lockspace_t *, struct lm_lockname *, struct file *,
++int gdlm_punlock(void *, struct lm_lockname *, struct file *,
+ struct file_lock *);
+#endif
+
@@ -24869,10 +24827,10 @@
+
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c
new file mode 100644
-index 0000000..8a1764f
+index 0000000..1f94dd3
--- /dev/null
+++ b/fs/gfs2/locking/dlm/mount.c
-@@ -0,0 +1,256 @@
+@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
@@ -24886,7 +24844,7 @@
+
+int gdlm_drop_count;
+int gdlm_drop_period;
-+struct lm_lockops gdlm_ops;
++const struct lm_lockops gdlm_ops;
+
+
+static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp,
@@ -24995,7 +24953,7 @@
+}
+
+static int gdlm_mount(char *table_name, char *host_data,
-+ lm_callback_t cb, struct gfs2_sbd *sdp,
++ lm_callback_t cb, void *cb_data,
+ unsigned int min_lvb_size, int flags,
+ struct lm_lockstruct *lockstruct,
+ struct kobject *fskobj)
@@ -25006,7 +24964,7 @@
+ if (min_lvb_size > GDLM_LVB_SIZE)
+ goto out;
+
-+ ls = init_gdlm(cb, sdp, flags, table_name);
++ ls = init_gdlm(cb, cb_data, flags, table_name);
+ if (!ls)
+ goto out;
+
@@ -25049,9 +25007,9 @@
+ return error;
+}
+
-+static void gdlm_unmount(lm_lockspace_t *lockspace)
++static void gdlm_unmount(void *lockspace)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ int rv;
+
+ log_debug("unmount flags %lx", ls->flags);
@@ -25073,18 +25031,18 @@
+ kfree(ls);
+}
+
-+static void gdlm_recovery_done(lm_lockspace_t *lockspace, unsigned int jid,
++static void gdlm_recovery_done(void *lockspace, unsigned int jid,
+ unsigned int message)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ ls->recover_jid_done = jid;
+ ls->recover_jid_status = message;
+ kobject_uevent(&ls->kobj, KOBJ_CHANGE);
+}
+
-+static void gdlm_others_may_mount(lm_lockspace_t *lockspace)
++static void gdlm_others_may_mount(void *lockspace)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ ls->first_done = 1;
+ kobject_uevent(&ls->kobj, KOBJ_CHANGE);
+}
@@ -25093,9 +25051,9 @@
+ other mounters, and lets us know (sets WITHDRAW flag). Then,
+ userspace leaves the mount group while we leave the lockspace. */
+
-+static void gdlm_withdraw(lm_lockspace_t *lockspace)
++static void gdlm_withdraw(void *lockspace)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+
+ kobject_uevent(&ls->kobj, KOBJ_OFFLINE);
+
@@ -25108,7 +25066,7 @@
+ gdlm_kobject_release(ls);
+}
+
-+struct lm_lockops gdlm_ops = {
++const struct lm_lockops gdlm_ops = {
+ .lm_proto_name = "lock_dlm",
+ .lm_mount = gdlm_mount,
+ .lm_others_may_mount = gdlm_others_may_mount,
@@ -25124,17 +25082,16 @@
+ .lm_cancel = gdlm_cancel,
+ .lm_hold_lvb = gdlm_hold_lvb,
+ .lm_unhold_lvb = gdlm_unhold_lvb,
-+ .lm_sync_lvb = gdlm_sync_lvb,
+ .lm_recovery_done = gdlm_recovery_done,
+ .lm_owner = THIS_MODULE,
+};
+
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
new file mode 100644
-index 0000000..263636b
+index 0000000..7365aec
--- /dev/null
+++ b/fs/gfs2/locking/dlm/plock.c
-@@ -0,0 +1,302 @@
+@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2005 Red Hat, Inc. All rights reserved.
+ *
@@ -25195,10 +25152,10 @@
+ wake_up(&send_wq);
+}
+
-+int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
++int gdlm_plock(void *lockspace, struct lm_lockname *name,
+ struct file *file, int cmd, struct file_lock *fl)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ struct plock_op *op;
+ int rv;
+
@@ -25239,10 +25196,10 @@
+ return rv;
+}
+
-+int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
++int gdlm_punlock(void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ struct plock_op *op;
+ int rv;
+
@@ -25278,10 +25235,10 @@
+ return rv;
+}
+
-+int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
++int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl)
+{
-+ struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
++ struct gdlm_ls *ls = lockspace;
+ struct plock_op *op;
+ int rv;
+
@@ -25368,8 +25325,7 @@
+
+ spin_lock(&ops_lock);
+ list_for_each_entry(op, &recv_list, list) {
-+ if (op->info.fsid == info.fsid &&
-+ op->info.number == info.number &&
++ if (op->info.fsid == info.fsid && op->info.number == info.number &&
+ op->info.owner == info.owner) {
+ list_del_init(&op->list);
+ found = 1;
@@ -26045,10 +26001,10 @@
+
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c
new file mode 100644
-index 0000000..e326079
+index 0000000..7b263fc
--- /dev/null
+++ b/fs/gfs2/locking/nolock/main.c
-@@ -0,0 +1,259 @@
+@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
@@ -26072,10 +26028,10 @@
+ unsigned int nl_lvb_size;
+};
+
-+static struct lm_lockops nolock_ops;
++static const struct lm_lockops nolock_ops;
+
+static int nolock_mount(char *table_name, char *host_data,
-+ lm_callback_t cb, struct gfs2_sbd *sdp,
++ lm_callback_t cb, void *cb_data,
+ unsigned int min_lvb_size, int flags,
+ struct lm_lockstruct *lockstruct,
+ struct kobject *fskobj)
@@ -26101,24 +26057,24 @@
+ lockstruct->ls_jid = jid;
+ lockstruct->ls_first = 1;
+ lockstruct->ls_lvb_size = min_lvb_size;
-+ lockstruct->ls_lockspace = (lm_lockspace_t *)nl;
++ lockstruct->ls_lockspace = nl;
+ lockstruct->ls_ops = &nolock_ops;
+ lockstruct->ls_flags = LM_LSFLAG_LOCAL;
+
+ return 0;
+}
+
-+static void nolock_others_may_mount(lm_lockspace_t *lockspace)
++static void nolock_others_may_mount(void *lockspace)
+{
+}
+
-+static void nolock_unmount(lm_lockspace_t *lockspace)
++static void nolock_unmount(void *lockspace)
+{
-+ struct nolock_lockspace *nl = (struct nolock_lockspace *)lockspace;
++ struct nolock_lockspace *nl = lockspace;
+ kfree(nl);
+}
+
-+static void nolock_withdraw(lm_lockspace_t *lockspace)
++static void nolock_withdraw(void *lockspace)
+{
+}
+
@@ -26131,10 +26087,10 @@
+ * Returns: 0 on success, -EXXX on failure
+ */
+
-+static int nolock_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name,
-+ lm_lock_t **lockp)
++static int nolock_get_lock(void *lockspace, struct lm_lockname *name,
++ void **lockp)
+{
-+ *lockp = (lm_lock_t *)lockspace;
++ *lockp = lockspace;
+ return 0;
+}
+
@@ -26144,7 +26100,7 @@
+ *
+ */
+
-+static void nolock_put_lock(lm_lock_t *lock)
++static void nolock_put_lock(void *lock)
+{
+}
+
@@ -26158,7 +26114,7 @@
+ * Returns: A bitmap of LM_OUT_*
+ */
+
-+static unsigned int nolock_lock(lm_lock_t *lock, unsigned int cur_state,
++static unsigned int nolock_lock(void *lock, unsigned int cur_state,
+ unsigned int req_state, unsigned int flags)
+{
+ return req_state | LM_OUT_CACHEABLE;
@@ -26172,12 +26128,12 @@
+ * Returns: 0
+ */
+
-+static unsigned int nolock_unlock(lm_lock_t *lock, unsigned int cur_state)
++static unsigned int nolock_unlock(void *lock, unsigned int cur_state)
+{
+ return 0;
+}
+
-+static void nolock_cancel(lm_lock_t *lock)
++static void nolock_cancel(void *lock)
+{
+}
+
@@ -26189,9 +26145,9 @@
+ * Returns: 0 on success, -EXXX on failure
+ */
+
-+static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp)
++static int nolock_hold_lvb(void *lock, char **lvbp)
+{
-+ struct nolock_lockspace *nl = (struct nolock_lockspace *)lock;
++ struct nolock_lockspace *nl = lock;
+ int error = 0;
+
+ *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL);
@@ -26208,23 +26164,12 @@
+ *
+ */
+
-+static void nolock_unhold_lvb(lm_lock_t *lock, char *lvb)
++static void nolock_unhold_lvb(void *lock, char *lvb)
+{
+ kfree(lvb);
+}
+
-+/**
-+ * nolock_sync_lvb - sync out the value of a lvb
-+ * @lock: the lock the LVB is associated with
-+ * @lvb: the lock value block
-+ *
-+ */
-+
-+static void nolock_sync_lvb(lm_lock_t *lock, char *lvb)
-+{
-+}
-+
-+static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
++static int nolock_plock_get(void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl)
+{
+ struct file_lock tmp;
@@ -26238,7 +26183,7 @@
+ return 0;
+}
+
-+static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
++static int nolock_plock(void *lockspace, struct lm_lockname *name,
+ struct file *file, int cmd, struct file_lock *fl)
+{
+ int error;
@@ -26246,7 +26191,7 @@
+ return error;
+}
+
-+static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
++static int nolock_punlock(void *lockspace, struct lm_lockname *name,
+ struct file *file, struct file_lock *fl)
+{
+ int error;
@@ -26254,12 +26199,12 @@
+ return error;
+}
+
-+static void nolock_recovery_done(lm_lockspace_t *lockspace, unsigned int jid,
++static void nolock_recovery_done(void *lockspace, unsigned int jid,
+ unsigned int message)
+{
+}
+
-+static struct lm_lockops nolock_ops = {
++static const struct lm_lockops nolock_ops = {
+ .lm_proto_name = "lock_nolock",
+ .lm_mount = nolock_mount,
+ .lm_others_may_mount = nolock_others_may_mount,
@@ -26272,7 +26217,6 @@
+ .lm_cancel = nolock_cancel,
+ .lm_hold_lvb = nolock_hold_lvb,
+ .lm_unhold_lvb = nolock_unhold_lvb,
-+ .lm_sync_lvb = nolock_sync_lvb,
+ .lm_plock_get = nolock_plock_get,
+ .lm_plock = nolock_plock,
+ .lm_punlock = nolock_punlock,
@@ -27901,7 +27845,7 @@
+
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
new file mode 100644
-index 0000000..2bdf246
+index 0000000..d286798
--- /dev/null
+++ b/fs/gfs2/main.c
@@ -0,0 +1,150 @@
@@ -27949,7 +27893,7 @@
+ struct gfs2_glock *gl = foo;
+ if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
+ SLAB_CTOR_CONSTRUCTOR) {
-+ INIT_LIST_HEAD(&gl->gl_list);
++ INIT_HLIST_NODE(&gl->gl_list);
+ spin_lock_init(&gl->gl_spin);
+ INIT_LIST_HEAD(&gl->gl_holders);
+ INIT_LIST_HEAD(&gl->gl_waiters1);
@@ -31663,7 +31607,7 @@
+#endif /* __OPS_FILE_DOT_H__ */
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
new file mode 100644
-index 0000000..f4397ce
+index 0000000..e8b7a1a
--- /dev/null
+++ b/fs/gfs2/ops_fstype.c
@@ -0,0 +1,943 @@
@@ -32438,7 +32382,7 @@
+fail_sys:
+ gfs2_sys_fs_del(sdp);
+fail:
-+ vfree(sdp);
++ kfree(sdp);
+ sb->s_fs_info = NULL;
+ return error;
+}
@@ -33819,10 +33763,10 @@
+#endif /* __OPS_INODE_DOT_H__ */
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
new file mode 100644
-index 0000000..addcf13
+index 0000000..975e93b
--- /dev/null
+++ b/fs/gfs2/ops_super.c
-@@ -0,0 +1,469 @@
+@@ -0,0 +1,468 @@
+/*
+ * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
@@ -33838,7 +33782,6 @@
+#include <linux/completion.h>
+#include <linux/buffer_head.h>
+#include <linux/statfs.h>
-+#include <linux/vmalloc.h>
+#include <linux/seq_file.h>
+#include <linux/mount.h>
+#include <linux/kthread.h>
@@ -33960,7 +33903,7 @@
+
+ /* At this point, we're through participating in the lockspace */
+ gfs2_sys_fs_del(sdp);
-+ vfree(sdp);
++ kfree(sdp);
+}
+
+/**
@@ -41462,13 +41405,3 @@
/*
* Return max readahead size for this inode in number-of-pages.
---- linux-2.6.17.noarch/fs/gfs2/ops_fstype.c~ 2006-09-07 16:17:46.718681000 -0400
-+++ linux-2.6.17.noarch/fs/gfs2/ops_fstype.c 2006-09-07 16:18:07.887495000 -0400
-@@ -17,6 +17,7 @@
- #include <linux/namei.h>
- #include <linux/mount.h>
- #include <linux/gfs2_ondisk.h>
-+#include <linux/vmalloc.h>
-
- #include "gfs2.h"
- #include "lm_interface.h"
More information about the fedora-cvs-commits
mailing list