aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/user.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2008-02-07 00:27:04 -0500
committerDavid Teigland <teigland@redhat.com>2008-02-07 00:27:04 -0500
commitd292c0cc489fa642799494bddbd7c94d11f7bbc1 (patch)
tree5999df751f987dc59ff052ed07fc7715c00898cc /fs/dlm/user.c
parente5dae548b0b5397e070de793be925cfc5813ad95 (diff)
dlm: eliminate astparam type casting
Put lkb_astparam in a union with a dlm_user_args pointer to eliminate a lot of type casting. Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r--fs/dlm/user.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index c3060458b68e..70b31b914870 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -195,8 +195,8 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type)
195 if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD)) 195 if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD))
196 goto out; 196 goto out;
197 197
198 DLM_ASSERT(lkb->lkb_astparam, dlm_print_lkb(lkb);); 198 DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb););
199 ua = (struct dlm_user_args *)lkb->lkb_astparam; 199 ua = lkb->lkb_ua;
200 proc = ua->proc; 200 proc = ua->proc;
201 201
202 if (type == AST_BAST && ua->bastaddr == NULL) 202 if (type == AST_BAST && ua->bastaddr == NULL)
@@ -771,7 +771,6 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
771{ 771{
772 struct dlm_user_proc *proc = file->private_data; 772 struct dlm_user_proc *proc = file->private_data;
773 struct dlm_lkb *lkb; 773 struct dlm_lkb *lkb;
774 struct dlm_user_args *ua;
775 DECLARE_WAITQUEUE(wait, current); 774 DECLARE_WAITQUEUE(wait, current);
776 int error, type=0, bmode=0, removed = 0; 775 int error, type=0, bmode=0, removed = 0;
777 776
@@ -842,8 +841,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
842 } 841 }
843 spin_unlock(&proc->asts_spin); 842 spin_unlock(&proc->asts_spin);
844 843
845 ua = (struct dlm_user_args *)lkb->lkb_astparam; 844 error = copy_result_to_user(lkb->lkb_ua,
846 error = copy_result_to_user(ua,
847 test_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags), 845 test_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags),
848 type, bmode, buf, count); 846 type, bmode, buf, count);
849 847