X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fgfs2%2Flocking.c;h=663fee7287832baf70a2d644239d97ecf4db1523;hb=197cd65accc6a274dabcd81f4811ba5d9a4856df;hp=11c4068105ccb7dd04779555701d0f21d80dd010;hpb=e9fc2aa091ab8fa46e60d4c9d06a89305c441652;p=linux-2.6 diff --git a/fs/gfs2/locking.c b/fs/gfs2/locking.c index 11c4068105..663fee7287 100644 --- a/fs/gfs2/locking.c +++ b/fs/gfs2/locking.c @@ -16,19 +16,18 @@ #include #include #include - -#include "lm_interface.h" +#include 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 of them by name at mount time, e.g. lock_nolock, lock_dlm. */ -static struct list_head lmh_list; -static struct mutex lmh_lock; +static LIST_HEAD(lmh_list); +static DEFINE_MUTEX(lmh_lock); /** * gfs2_register_lockproto - Register a low-level locking protocol @@ -37,7 +36,7 @@ static struct mutex lmh_lock; * 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; @@ -72,7 +71,7 @@ int gfs2_register_lockproto(struct lm_lockops *proto) * */ -void gfs2_unregister_lockproto(struct lm_lockops *proto) +void gfs2_unregister_lockproto(const struct lm_lockops *proto) { struct lmh_wrapper *lw; @@ -99,7 +98,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto) * @table_name - the name of the lock space * @host_data - data specific to this host * @cb - the callback to the code using the lock module - * @fsdata - data to pass back with the callback + * @sdp - The GFS2 superblock * @min_lvb_size - the mininum LVB size that the caller can deal with * @flags - LM_MFLAG_* * @lockstruct - a structure returned describing the mount @@ -108,7 +107,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto) */ 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) @@ -147,7 +146,7 @@ retry: goto retry; } - error = lw->lw_ops->lm_mount(table_name, host_data, cb, fsdata, + 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); @@ -180,12 +179,6 @@ void gfs2_withdraw_lockproto(struct lm_lockstruct *lockstruct) mutex_unlock(&lmh_lock); } -void __init gfs2_init_lmh(void) -{ - mutex_init(&lmh_lock); - INIT_LIST_HEAD(&lmh_list); -} - EXPORT_SYMBOL_GPL(gfs2_register_lockproto); EXPORT_SYMBOL_GPL(gfs2_unregister_lockproto);