Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38843
b: refs/heads/master
c: 9b47c11
h: refs/heads/master
i:
  38841: 1d7b4d7
  38839: c9a1875
v: v3
  • Loading branch information
Steven Whitehouse committed Sep 8, 2006
1 parent d24781a commit 002d003
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2c4580797f62b0dd9a48f1e0ce3fe8b8fd76262
refs/heads/master: 9b47c11d1cbedcba685c9bd90c73fd41acdfab0e
3 changes: 2 additions & 1 deletion trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,8 +1713,9 @@ static void blocking_cb(struct gfs2_sbd *sdp, struct lm_lockname *name,
* 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:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/glock.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
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_glock_cb(void *cb_data, unsigned int type, void *data);

void gfs2_iopen_go_callback(struct gfs2_glock *gl, unsigned int state);

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct gfs2_glock {
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;

Expand Down
14 changes: 7 additions & 7 deletions trunk/fs/gfs2/lm.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
}

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)))
Expand All @@ -131,13 +131,13 @@ int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
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)
{
Expand All @@ -148,7 +148,7 @@ unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, lm_lock_t *lock,
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;
Expand All @@ -157,21 +157,21 @@ unsigned int gfs2_lm_unlock(struct gfs2_sbd *sdp, lm_lock_t *lock,
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)))
error = sdp->sd_lockstruct.ls_ops->lm_hold_lvb(lock, lvbp);
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);
Expand Down
14 changes: 7 additions & 7 deletions trunk/fs/gfs2/lm.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ void gfs2_lm_unmount(struct gfs2_sbd *sdp);
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,
Expand Down
57 changes: 22 additions & 35 deletions trunk/fs/gfs2/lm_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,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
Expand Down Expand Up @@ -175,64 +167,60 @@ struct lm_async_cb {
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);
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;
Expand All @@ -253,8 +241,8 @@ struct lm_lockstruct {
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;
};

Expand All @@ -263,17 +251,16 @@ struct lm_lockstruct {
* 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
* unmounting a file system.
*/

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);
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/gfs2/locking.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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
Expand All @@ -37,7 +37,7 @@ static DEFINE_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;

Expand Down Expand Up @@ -72,7 +72,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;

Expand Down Expand Up @@ -108,7 +108,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, 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)
Expand Down Expand Up @@ -147,7 +147,7 @@ int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
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);
Expand Down
32 changes: 16 additions & 16 deletions trunk/fs/gfs2/locking/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,21 @@ void gdlm_delete_lp(struct gdlm_lock *lp)
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)
Expand Down Expand Up @@ -305,10 +305,10 @@ static unsigned int gdlm_do_unlock(struct gdlm_lock *lp)
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)
Expand All @@ -321,19 +321,19 @@ unsigned int gdlm_lock(lm_lock_t *lock, unsigned int cur_state,
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)
return 0;
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;

Expand Down Expand Up @@ -464,9 +464,9 @@ static void unhold_null_lock(struct gdlm_lock *lp)
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);
Expand All @@ -482,9 +482,9 @@ int gdlm_hold_lvb(lm_lock_t *lock, char **lvbp)
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);
Expand Down
Loading

0 comments on commit 002d003

Please sign in to comment.