aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-01-25 03:01:51 -0500
committerDavid Teigland <teigland@redhat.com>2008-02-04 02:24:07 -0500
commit4007685c6e6b5c92a07f27cd754bcca394168af2 (patch)
tree74b9f2966603d2a9fc795e9d58a84c721befd7ab /fs/dlm
parent93ff2971e99c90d1c4d39d242ef6050d2dc853d3 (diff)
dlm: use proper type for ->ls_recover_buf
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/dir.c2
-rw-r--r--fs/dlm/dlm_internal.h2
-rw-r--r--fs/dlm/rcom.c11
-rw-r--r--fs/dlm/recover.c4
4 files changed, 10 insertions, 9 deletions
diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
index ff97ba924333..ce30136671b3 100644
--- a/fs/dlm/dir.c
+++ b/fs/dlm/dir.c
@@ -235,7 +235,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
235 * pick namelen/name pairs out of received buffer 235 * pick namelen/name pairs out of received buffer
236 */ 236 */
237 237
238 b = ls->ls_recover_buf + sizeof(struct dlm_rcom); 238 b = ls->ls_recover_buf->rc_buf;
239 239
240 for (;;) { 240 for (;;) {
241 memcpy(&namelen, b, sizeof(uint16_t)); 241 memcpy(&namelen, b, sizeof(uint16_t));
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 187a5b5b28b6..f7fbaec94b15 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -500,7 +500,7 @@ struct dlm_ls {
500 struct rw_semaphore ls_recv_active; /* block dlm_recv */ 500 struct rw_semaphore ls_recv_active; /* block dlm_recv */
501 struct list_head ls_requestqueue;/* queue remote requests */ 501 struct list_head ls_requestqueue;/* queue remote requests */
502 struct mutex ls_requestqueue_mutex; 502 struct mutex ls_requestqueue_mutex;
503 char *ls_recover_buf; 503 struct dlm_rcom *ls_recover_buf;
504 int ls_recover_nodeid; /* for debugging */ 504 int ls_recover_nodeid; /* for debugging */
505 uint64_t ls_rcom_seq; 505 uint64_t ls_rcom_seq;
506 spinlock_t ls_rcom_spin; 506 spinlock_t ls_rcom_spin;
diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c
index fb0776201d73..3f9b96fd26e8 100644
--- a/fs/dlm/rcom.c
+++ b/fs/dlm/rcom.c
@@ -129,7 +129,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
129 ls->ls_recover_nodeid = nodeid; 129 ls->ls_recover_nodeid = nodeid;
130 130
131 if (nodeid == dlm_our_nodeid()) { 131 if (nodeid == dlm_our_nodeid()) {
132 rc = (struct dlm_rcom *) ls->ls_recover_buf; 132 rc = ls->ls_recover_buf;
133 rc->rc_result = dlm_recover_status(ls); 133 rc->rc_result = dlm_recover_status(ls);
134 goto out; 134 goto out;
135 } 135 }
@@ -148,7 +148,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
148 if (error) 148 if (error)
149 goto out; 149 goto out;
150 150
151 rc = (struct dlm_rcom *) ls->ls_recover_buf; 151 rc = ls->ls_recover_buf;
152 152
153 if (rc->rc_result == -ESRCH) { 153 if (rc->rc_result == -ESRCH) {
154 /* we pretend the remote lockspace exists with 0 status */ 154 /* we pretend the remote lockspace exists with 0 status */
@@ -202,14 +202,15 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
202{ 202{
203 struct dlm_rcom *rc; 203 struct dlm_rcom *rc;
204 struct dlm_mhandle *mh; 204 struct dlm_mhandle *mh;
205 int error = 0, len = sizeof(struct dlm_rcom); 205 int error = 0;
206 int max_size = dlm_config.ci_buffer_size - sizeof(struct dlm_rcom);
206 207
207 ls->ls_recover_nodeid = nodeid; 208 ls->ls_recover_nodeid = nodeid;
208 209
209 if (nodeid == dlm_our_nodeid()) { 210 if (nodeid == dlm_our_nodeid()) {
210 dlm_copy_master_names(ls, last_name, last_len, 211 dlm_copy_master_names(ls, last_name, last_len,
211 ls->ls_recover_buf + len, 212 ls->ls_recover_buf->rc_buf,
212 dlm_config.ci_buffer_size - len, nodeid); 213 max_size, nodeid);
213 goto out; 214 goto out;
214 } 215 }
215 216
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c
index df075dc300fa..80aba5bdd4a4 100644
--- a/fs/dlm/recover.c
+++ b/fs/dlm/recover.c
@@ -94,7 +94,7 @@ void dlm_set_recover_status(struct dlm_ls *ls, uint32_t status)
94 94
95static int wait_status_all(struct dlm_ls *ls, uint32_t wait_status) 95static int wait_status_all(struct dlm_ls *ls, uint32_t wait_status)
96{ 96{
97 struct dlm_rcom *rc = (struct dlm_rcom *) ls->ls_recover_buf; 97 struct dlm_rcom *rc = ls->ls_recover_buf;
98 struct dlm_member *memb; 98 struct dlm_member *memb;
99 int error = 0, delay; 99 int error = 0, delay;
100 100
@@ -123,7 +123,7 @@ static int wait_status_all(struct dlm_ls *ls, uint32_t wait_status)
123 123
124static int wait_status_low(struct dlm_ls *ls, uint32_t wait_status) 124static int wait_status_low(struct dlm_ls *ls, uint32_t wait_status)
125{ 125{
126 struct dlm_rcom *rc = (struct dlm_rcom *) ls->ls_recover_buf; 126 struct dlm_rcom *rc = ls->ls_recover_buf;
127 int error = 0, delay = 0, nodeid = ls->ls_low_nodeid; 127 int error = 0, delay = 0, nodeid = ls->ls_low_nodeid;
128 128
129 for (;;) { 129 for (;;) {