From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs glock.c glock.h inc ...
Date: 13 Sep 2006 20:07:40 -0000 [thread overview]
Message-ID: <20060913200740.13122.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-09-13 20:07:38
Modified files:
gfs-kernel/src/gfs: glock.c glock.h incore.h lm.c lm.h
lm_interface.h
Log message:
update per the gfs2 upstream changes to the lock module interface:
- remove sync_lvb
- remove lm_lock_t, lm_lockspace_t, lm_fsdata_t typedefs
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/glock.c.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/glock.h.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/incore.h.diff?cvsroot=cluster&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/lm.c.diff?cvsroot=cluster&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/lm.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/lm_interface.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
--- cluster/gfs-kernel/src/gfs/glock.c 2006/07/10 23:22:34 1.27
+++ cluster/gfs-kernel/src/gfs/glock.c 2006/09/13 20:07:38 1.28
@@ -2137,6 +2137,7 @@
glock_put(gl);
}
+#if 0
/**
* gfs_lvb_sync - sync a LVB
* @gl: The glock in question
@@ -2156,6 +2157,7 @@
unlock_on_glock(gl);
}
+#endif
/**
* blocking_cb -
@@ -2205,9 +2207,9 @@
*/
void
-gfs_glock_cb(lm_fsdata_t *fsdata, unsigned int type, void *data)
+gfs_glock_cb(void *fsdata, unsigned int type, void *data)
{
- struct gfs_sbd *sdp = (struct gfs_sbd *)fsdata;
+ struct gfs_sbd *sdp = fsdata;
atomic_inc(&sdp->sd_lm_callbacks);
--- cluster/gfs-kernel/src/gfs/glock.h 2006/07/10 23:22:34 1.9
+++ cluster/gfs-kernel/src/gfs/glock.h 2006/09/13 20:07:38 1.10
@@ -134,7 +134,7 @@
void gfs_lvb_unhold(struct gfs_glock *gl);
void gfs_lvb_sync(struct gfs_glock *gl);
-void gfs_glock_cb(lm_fsdata_t *fsdata, unsigned int type, void *data);
+void gfs_glock_cb(void *fsdata, unsigned int type, void *data);
void gfs_try_toss_inode(struct gfs_sbd *sdp, struct gfs_inum *inum);
void gfs_iopen_go_callback(struct gfs_glock *gl, unsigned int state);
--- cluster/gfs-kernel/src/gfs/incore.h 2006/09/12 18:24:27 1.28
+++ cluster/gfs-kernel/src/gfs/incore.h 2006/09/13 20:07:38 1.29
@@ -512,7 +512,7 @@
struct gfs_holder *gl_req_gh; /* Holder for request being serviced */
gfs_glop_bh_t gl_req_bh; /* The bottom half to execute */
- lm_lock_t *gl_lock; /* Lock module's private lock data */
+ void *gl_lock; /* Lock module's private lock data */
char *gl_lvb; /* Lock Value Block */
atomic_t gl_lvb_count; /* LVB recursive usage (hold/unhold) count */
--- cluster/gfs-kernel/src/gfs/lm.c 2006/09/12 18:24:27 1.16
+++ cluster/gfs-kernel/src/gfs/lm.c 2006/09/13 20:07:38 1.17
@@ -122,7 +122,7 @@
}
int gfs_lm_get_lock(struct gfs_sbd *sdp, struct lm_lockname *name,
- lm_lock_t **lockp)
+ void **lockp)
{
int error;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
@@ -133,13 +133,13 @@
return error;
}
-void gfs_lm_put_lock(struct gfs_sbd *sdp, lm_lock_t *lock)
+void gfs_lm_put_lock(struct gfs_sbd *sdp, void *lock)
{
if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
sdp->sd_lockstruct.ls_ops->lm_put_lock(lock);
}
-unsigned int gfs_lm_lock(struct gfs_sbd *sdp, lm_lock_t *lock,
+unsigned int gfs_lm_lock(struct gfs_sbd *sdp, void *lock,
unsigned int cur_state, unsigned int req_state,
unsigned int flags)
{
@@ -153,7 +153,7 @@
return ret;
}
-unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, lm_lock_t *lock,
+unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, void *lock,
unsigned int cur_state)
{
int ret;
@@ -164,13 +164,13 @@
return ret;
}
-void gfs_lm_cancel(struct gfs_sbd *sdp, lm_lock_t *lock)
+void gfs_lm_cancel(struct gfs_sbd *sdp, void *lock)
{
if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
sdp->sd_lockstruct.ls_ops->lm_cancel(lock);
}
-int gfs_lm_hold_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char **lvbp)
+int gfs_lm_hold_lvb(struct gfs_sbd *sdp, void *lock, char **lvbp)
{
int error;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
@@ -180,17 +180,19 @@
return error;
}
-void gfs_lm_unhold_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char *lvb)
+void gfs_lm_unhold_lvb(struct gfs_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);
}
-void gfs_lm_sync_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char *lvb)
+#if 0
+void gfs_lm_sync_lvb(struct gfs_sbd *sdp, void *lock, char *lvb)
{
if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
sdp->sd_lockstruct.ls_ops->lm_sync_lvb(lock, lvb);
}
+#endif
int gfs_lm_plock_get(struct gfs_sbd *sdp, struct lm_lockname *name,
struct file *file, struct file_lock *fl)
--- cluster/gfs-kernel/src/gfs/lm.h 2006/07/10 23:22:34 1.2
+++ cluster/gfs-kernel/src/gfs/lm.h 2006/09/13 20:07:38 1.3
@@ -20,17 +20,16 @@
int gfs_lm_withdraw(struct gfs_sbd *sdp, char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
int gfs_lm_get_lock(struct gfs_sbd *sdp,
- struct lm_lockname *name, lm_lock_t **lockp);
-void gfs_lm_put_lock(struct gfs_sbd *sdp, lm_lock_t *lock);
-unsigned int gfs_lm_lock(struct gfs_sbd *sdp, lm_lock_t *lock,
+ struct lm_lockname *name, void **lockp);
+void gfs_lm_put_lock(struct gfs_sbd *sdp, void *lock);
+unsigned int gfs_lm_lock(struct gfs_sbd *sdp, void *lock,
unsigned int cur_state, unsigned int req_state,
unsigned int flags);
-unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, lm_lock_t *lock,
+unsigned int gfs_lm_unlock(struct gfs_sbd *sdp, void *lock,
unsigned int cur_state);
-void gfs_lm_cancel(struct gfs_sbd *sdp, lm_lock_t *lock);
-int gfs_lm_hold_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char **lvbp);
-void gfs_lm_unhold_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char *lvb);
-void gfs_lm_sync_lvb(struct gfs_sbd *sdp, lm_lock_t *lock, char *lvb);
+void gfs_lm_cancel(struct gfs_sbd *sdp, void *lock);
+int gfs_lm_hold_lvb(struct gfs_sbd *sdp, void *lock, char **lvbp);
+void gfs_lm_unhold_lvb(struct gfs_sbd *sdp, void *lock, char *lvb);
int gfs_lm_plock_get(struct gfs_sbd *sdp,
struct lm_lockname *name,
struct file *file, struct file_lock *fl);
--- cluster/gfs-kernel/src/gfs/lm_interface.h 2006/08/07 14:20:29 1.3
+++ cluster/gfs-kernel/src/gfs/lm_interface.h 2006/09/13 20:07:38 1.4
@@ -4,23 +4,14 @@
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License v.2.
+ * of the GNU General Public License version 2.
*/
#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;
-typedef void lm_fsdata_t;
-typedef void (*lm_callback_t) (lm_fsdata_t *fsdata, unsigned int type,
- void *data);
+typedef void (*lm_callback_t) (void *ptr, unsigned int type, void *data);
/*
* lm_mount() flags
@@ -160,7 +151,7 @@
struct lm_lockname {
- uint64_t ln_number;
+ u64 ln_number;
unsigned int ln_type;
};
@@ -176,65 +167,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, lm_fsdata_t *fsdata,
+ 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;
@@ -255,21 +241,18 @@
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;
};
-void __init gfs2_init_lmh(void);
-
/*
* Lock module bottom interface. A lock module makes itself available to GFS
* 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
@@ -277,7 +260,7 @@
*/
int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
- lm_callback_t cb, lm_fsdata_t *fsdata,
+ lm_callback_t cb, void *cb_data,
unsigned int min_lvb_size, int flags,
struct lm_lockstruct *lockstruct,
struct kobject *fskobj);
reply other threads:[~2006-09-13 20:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060913200740.13122.qmail@sourceware.org \
--to=teigland@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.