]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
dlm: use proper type for ->ls_recover_buf
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Jan 2008 08:01:51 +0000 (03:01 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 4 Feb 2008 07:24:07 +0000 (01:24 -0600)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/dir.c
fs/dlm/dlm_internal.h
fs/dlm/rcom.c
fs/dlm/recover.c

index ff97ba924333fccfc7cbb9699753f194d47eda7b..ce30136671b3f755e27233f9566edce1414b9f54 100644 (file)
@@ -235,7 +235,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
                         * pick namelen/name pairs out of received buffer
                         */
 
-                       b = ls->ls_recover_buf + sizeof(struct dlm_rcom);
+                       b = ls->ls_recover_buf->rc_buf;
 
                        for (;;) {
                                memcpy(&namelen, b, sizeof(uint16_t));
index 187a5b5b28b66f9e4338faf9aab4baefd6037d04..f7fbaec94b15a6c0067be2f37bef7a9e902970f1 100644 (file)
@@ -500,7 +500,7 @@ struct dlm_ls {
        struct rw_semaphore     ls_recv_active; /* block dlm_recv */
        struct list_head        ls_requestqueue;/* queue remote requests */
        struct mutex            ls_requestqueue_mutex;
-       char                    *ls_recover_buf;
+       struct dlm_rcom         *ls_recover_buf;
        int                     ls_recover_nodeid; /* for debugging */
        uint64_t                ls_rcom_seq;
        spinlock_t              ls_rcom_spin;
index fb0776201d734e5973fa410bd8703d023db89a09..3f9b96fd26e8e4087d8e79176f32bdbfa478d2b5 100644 (file)
@@ -129,7 +129,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
        ls->ls_recover_nodeid = nodeid;
 
        if (nodeid == dlm_our_nodeid()) {
-               rc = (struct dlm_rcom *) ls->ls_recover_buf;
+               rc = ls->ls_recover_buf;
                rc->rc_result = dlm_recover_status(ls);
                goto out;
        }
@@ -148,7 +148,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
        if (error)
                goto out;
 
-       rc = (struct dlm_rcom *) ls->ls_recover_buf;
+       rc = ls->ls_recover_buf;
 
        if (rc->rc_result == -ESRCH) {
                /* 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)
 {
        struct dlm_rcom *rc;
        struct dlm_mhandle *mh;
-       int error = 0, len = sizeof(struct dlm_rcom);
+       int error = 0;
+       int max_size = dlm_config.ci_buffer_size - sizeof(struct dlm_rcom);
 
        ls->ls_recover_nodeid = nodeid;
 
        if (nodeid == dlm_our_nodeid()) {
                dlm_copy_master_names(ls, last_name, last_len,
-                                     ls->ls_recover_buf + len,
-                                     dlm_config.ci_buffer_size - len, nodeid);
+                                     ls->ls_recover_buf->rc_buf,
+                                     max_size, nodeid);
                goto out;
        }
 
index df075dc300fa4ad7bbe8364478b297795d562a61..80aba5bdd4a4b72b0949fe4f0516c02f7d7f25ad 100644 (file)
@@ -94,7 +94,7 @@ void dlm_set_recover_status(struct dlm_ls *ls, uint32_t status)
 
 static int wait_status_all(struct dlm_ls *ls, uint32_t wait_status)
 {
-       struct dlm_rcom *rc = (struct dlm_rcom *) ls->ls_recover_buf;
+       struct dlm_rcom *rc = ls->ls_recover_buf;
        struct dlm_member *memb;
        int error = 0, delay;
 
@@ -123,7 +123,7 @@ static int wait_status_all(struct dlm_ls *ls, uint32_t wait_status)
 
 static int wait_status_low(struct dlm_ls *ls, uint32_t wait_status)
 {
-       struct dlm_rcom *rc = (struct dlm_rcom *) ls->ls_recover_buf;
+       struct dlm_rcom *rc = ls->ls_recover_buf;
        int error = 0, delay = 0, nodeid = ls->ls_low_nodeid;
 
        for (;;) {