Skip to content

Commit dbcfc34

Browse files
committed
dlm: clean ups
A couple small clean-ups. Remove unnecessary wrapper-functions in rcom.c, and remove unnecessary casting and an unnecessary ASSERT in util.c. Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 2a79289 commit dbcfc34

2 files changed

Lines changed: 10 additions & 31 deletions

File tree

‎fs/dlm/rcom.c‎

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*******************************************************************************
33
**
44
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5-
** Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved.
5+
** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
66
**
77
** This copyrighted material is made available to anyone wishing to use,
88
** modify, copy, or redistribute it subject to the terms and conditions
@@ -197,11 +197,6 @@ static void receive_sync_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
197197
spin_unlock(&ls->ls_rcom_spin);
198198
}
199199

200-
static void receive_rcom_status_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
201-
{
202-
receive_sync_reply(ls, rc_in);
203-
}
204-
205200
int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
206201
{
207202
struct dlm_rcom *rc;
@@ -254,11 +249,6 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)
254249
send_rcom(ls, mh, rc);
255250
}
256251

257-
static void receive_rcom_names_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
258-
{
259-
receive_sync_reply(ls, rc_in);
260-
}
261-
262252
int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid)
263253
{
264254
struct dlm_rcom *rc;
@@ -381,11 +371,6 @@ static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in)
381371
send_rcom(ls, mh, rc);
382372
}
383373

384-
static void receive_rcom_lock_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
385-
{
386-
dlm_recover_process_copy(ls, rc_in);
387-
}
388-
389374
/* If the lockspace doesn't exist then still send a status message
390375
back; it's possible that it just doesn't have its global_id yet. */
391376

@@ -481,23 +466,23 @@ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
481466
break;
482467

483468
case DLM_RCOM_STATUS_REPLY:
484-
receive_rcom_status_reply(ls, rc);
469+
receive_sync_reply(ls, rc);
485470
break;
486471

487472
case DLM_RCOM_NAMES_REPLY:
488-
receive_rcom_names_reply(ls, rc);
473+
receive_sync_reply(ls, rc);
489474
break;
490475

491476
case DLM_RCOM_LOOKUP_REPLY:
492477
receive_rcom_lookup_reply(ls, rc);
493478
break;
494479

495480
case DLM_RCOM_LOCK_REPLY:
496-
receive_rcom_lock_reply(ls, rc);
481+
dlm_recover_process_copy(ls, rc);
497482
break;
498483

499484
default:
500-
DLM_ASSERT(0, printk("rc_type=%x\n", rc->rc_type););
485+
log_error(ls, "receive_rcom bad type %d", rc->rc_type);
501486
}
502487
out:
503488
return;

‎fs/dlm/util.c‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/******************************************************************************
22
*******************************************************************************
33
**
4-
** Copyright (C) 2005 Red Hat, Inc. All rights reserved.
4+
** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
55
**
66
** This copyrighted material is made available to anyone wishing to use,
77
** modify, copy, or redistribute it subject to the terms and conditions
@@ -85,9 +85,7 @@ static int from_dlm_errno(int err)
8585

8686
void dlm_message_out(struct dlm_message *ms)
8787
{
88-
struct dlm_header *hd = (struct dlm_header *) ms;
89-
90-
header_out(hd);
88+
header_out(&ms->m_header);
9189

9290
ms->m_type = cpu_to_le32(ms->m_type);
9391
ms->m_nodeid = cpu_to_le32(ms->m_nodeid);
@@ -111,9 +109,7 @@ void dlm_message_out(struct dlm_message *ms)
111109

112110
void dlm_message_in(struct dlm_message *ms)
113111
{
114-
struct dlm_header *hd = (struct dlm_header *) ms;
115-
116-
header_in(hd);
112+
header_in(&ms->m_header);
117113

118114
ms->m_type = le32_to_cpu(ms->m_type);
119115
ms->m_nodeid = le32_to_cpu(ms->m_nodeid);
@@ -179,10 +175,9 @@ static void rcom_config_in(struct rcom_config *rf)
179175

180176
void dlm_rcom_out(struct dlm_rcom *rc)
181177
{
182-
struct dlm_header *hd = (struct dlm_header *) rc;
183178
int type = rc->rc_type;
184179

185-
header_out(hd);
180+
header_out(&rc->rc_header);
186181

187182
rc->rc_type = cpu_to_le32(rc->rc_type);
188183
rc->rc_result = cpu_to_le32(rc->rc_result);
@@ -199,10 +194,9 @@ void dlm_rcom_out(struct dlm_rcom *rc)
199194

200195
void dlm_rcom_in(struct dlm_rcom *rc)
201196
{
202-
struct dlm_header *hd = (struct dlm_header *) rc;
203197
int type;
204198

205-
header_in(hd);
199+
header_in(&rc->rc_header);
206200

207201
rc->rc_type = le32_to_cpu(rc->rc_type);
208202
rc->rc_result = le32_to_cpu(rc->rc_result);

0 commit comments

Comments
 (0)