Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84895
b: refs/heads/master
c: d292c0c
h: refs/heads/master
i:
  84893: 6d9407f
  84891: fa0151e
  84887: df42d6e
  84879: 0b8f4f5
  84863: cec10b8
v: v3
  • Loading branch information
David Teigland committed Feb 7, 2008
1 parent 2b2da95 commit 25a4ab3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 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: e5dae548b0b5397e070de793be925cfc5813ad95
refs/heads/master: d292c0cc489fa642799494bddbd7c94d11f7bbc1
6 changes: 2 additions & 4 deletions trunk/fs/dlm/debug_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,12 @@ static int print_resource(struct dlm_rsb *res, struct seq_file *s)

static void print_lock(struct seq_file *s, struct dlm_lkb *lkb, struct dlm_rsb *r)
{
struct dlm_user_args *ua;
unsigned int waiting = 0;
uint64_t xid = 0;

if (lkb->lkb_flags & DLM_IFL_USER) {
ua = (struct dlm_user_args *) lkb->lkb_astparam;
if (ua)
xid = ua->xid;
if (lkb->lkb_ua)
xid = lkb->lkb_ua->xid;
}

if (lkb->lkb_timestamp)
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/dlm/dlm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ struct dlm_lkb {
struct dlm_lksb *lkb_lksb; /* caller's status block */
void (*lkb_astfn) (void *astparam);
void (*lkb_bastfn) (void *astparam, int mode);
void *lkb_astparam; /* caller's ast arg */
union {
void *lkb_astparam; /* caller's ast arg */
struct dlm_user_args *lkb_ua;
};
};


Expand Down
14 changes: 6 additions & 8 deletions trunk/fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -4533,7 +4533,7 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
/* user can change the params on its lock when it converts it, or
add an lvb that didn't exist before */

ua = (struct dlm_user_args *)lkb->lkb_astparam;
ua = lkb->lkb_ua;

if (flags & DLM_LKF_VALBLK && !ua->lksb.sb_lvbptr) {
ua->lksb.sb_lvbptr = kzalloc(DLM_USER_LVB_LEN, GFP_KERNEL);
Expand Down Expand Up @@ -4584,7 +4584,7 @@ int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
if (error)
goto out;

ua = (struct dlm_user_args *)lkb->lkb_astparam;
ua = lkb->lkb_ua;

if (lvb_in && ua->lksb.sb_lvbptr)
memcpy(ua->lksb.sb_lvbptr, lvb_in, DLM_USER_LVB_LEN);
Expand Down Expand Up @@ -4633,7 +4633,7 @@ int dlm_user_cancel(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
if (error)
goto out;

ua = (struct dlm_user_args *)lkb->lkb_astparam;
ua = lkb->lkb_ua;
if (ua_tmp->castparam)
ua->castparam = ua_tmp->castparam;
ua->user_lksb = ua_tmp->user_lksb;
Expand Down Expand Up @@ -4671,7 +4671,7 @@ int dlm_user_deadlock(struct dlm_ls *ls, uint32_t flags, uint32_t lkid)
if (error)
goto out;

ua = (struct dlm_user_args *)lkb->lkb_astparam;
ua = lkb->lkb_ua;

error = set_unlock_args(flags, ua, &args);
if (error)
Expand Down Expand Up @@ -4710,7 +4710,6 @@ int dlm_user_deadlock(struct dlm_ls *ls, uint32_t flags, uint32_t lkid)

static int orphan_proc_lock(struct dlm_ls *ls, struct dlm_lkb *lkb)
{
struct dlm_user_args *ua = (struct dlm_user_args *)lkb->lkb_astparam;
struct dlm_args args;
int error;

Expand All @@ -4719,7 +4718,7 @@ static int orphan_proc_lock(struct dlm_ls *ls, struct dlm_lkb *lkb)
list_add_tail(&lkb->lkb_ownqueue, &ls->ls_orphans);
mutex_unlock(&ls->ls_orphans_mutex);

set_unlock_args(0, ua, &args);
set_unlock_args(0, lkb->lkb_ua, &args);

error = cancel_lock(ls, lkb, &args);
if (error == -DLM_ECANCEL)
Expand All @@ -4732,11 +4731,10 @@ static int orphan_proc_lock(struct dlm_ls *ls, struct dlm_lkb *lkb)

static int unlock_proc_lock(struct dlm_ls *ls, struct dlm_lkb *lkb)
{
struct dlm_user_args *ua = (struct dlm_user_args *)lkb->lkb_astparam;
struct dlm_args args;
int error;

set_unlock_args(DLM_LKF_FORCEUNLOCK, ua, &args);
set_unlock_args(DLM_LKF_FORCEUNLOCK, lkb->lkb_ua, &args);

error = unlock_lock(ls, lkb, &args);
if (error == -DLM_EUNLOCK)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/dlm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void dlm_free_lkb(struct dlm_lkb *lkb)
{
if (lkb->lkb_flags & DLM_IFL_USER) {
struct dlm_user_args *ua;
ua = (struct dlm_user_args *)lkb->lkb_astparam;
ua = lkb->lkb_ua;
if (ua) {
if (ua->lksb.sb_lvbptr)
kfree(ua->lksb.sb_lvbptr);
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/dlm/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ void dlm_netlink_exit(void)
static void fill_data(struct dlm_lock_data *data, struct dlm_lkb *lkb)
{
struct dlm_rsb *r = lkb->lkb_resource;
struct dlm_user_args *ua = (struct dlm_user_args *) lkb->lkb_astparam;

memset(data, 0, sizeof(struct dlm_lock_data));

Expand All @@ -117,8 +116,8 @@ static void fill_data(struct dlm_lock_data *data, struct dlm_lkb *lkb)
data->grmode = lkb->lkb_grmode;
data->rqmode = lkb->lkb_rqmode;
data->timestamp = lkb->lkb_timestamp;
if (ua)
data->xid = ua->xid;
if (lkb->lkb_ua)
data->xid = lkb->lkb_ua->xid;
if (r) {
data->lockspace_id = r->res_ls->ls_global_id;
data->resource_namelen = r->res_length;
Expand Down
8 changes: 3 additions & 5 deletions trunk/fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD))
goto out;

DLM_ASSERT(lkb->lkb_astparam, dlm_print_lkb(lkb););
ua = (struct dlm_user_args *)lkb->lkb_astparam;
DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb););
ua = lkb->lkb_ua;
proc = ua->proc;

if (type == AST_BAST && ua->bastaddr == NULL)
Expand Down Expand Up @@ -771,7 +771,6 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
{
struct dlm_user_proc *proc = file->private_data;
struct dlm_lkb *lkb;
struct dlm_user_args *ua;
DECLARE_WAITQUEUE(wait, current);
int error, type=0, bmode=0, removed = 0;

Expand Down Expand Up @@ -842,8 +841,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
}
spin_unlock(&proc->asts_spin);

ua = (struct dlm_user_args *)lkb->lkb_astparam;
error = copy_result_to_user(ua,
error = copy_result_to_user(lkb->lkb_ua,
test_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags),
type, bmode, buf, count);

Expand Down

0 comments on commit 25a4ab3

Please sign in to comment.