diff options
author | Fabio M. Di Nitto <fabbione@ubuntu.com> | 2008-01-15 16:13:36 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-01-30 12:04:41 -0500 |
commit | 550283e30ccec5ddab9749a77b0022ebcaf0f3af (patch) | |
tree | bf95681d9dd4bc866c8ad59d8556578ead753e7a /fs/dlm/util.c | |
parent | e7847d35ac39fe92c94540e88ac3d0e177f52d9e (diff) |
dlm: swap bytes for rcom lock reply
DLM_RCOM_LOCK_REPLY messages need byte swapping.
Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/util.c')
-rw-r--r-- | fs/dlm/util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/dlm/util.c b/fs/dlm/util.c index 963889cf6740..38dcfeb9c4b7 100644 --- a/fs/dlm/util.c +++ b/fs/dlm/util.c | |||
@@ -137,7 +137,7 @@ void dlm_rcom_out(struct dlm_rcom *rc) | |||
137 | rc->rc_seq = cpu_to_le64(rc->rc_seq); | 137 | rc->rc_seq = cpu_to_le64(rc->rc_seq); |
138 | rc->rc_seq_reply = cpu_to_le64(rc->rc_seq_reply); | 138 | rc->rc_seq_reply = cpu_to_le64(rc->rc_seq_reply); |
139 | 139 | ||
140 | if (type == DLM_RCOM_LOCK) | 140 | if ((type == DLM_RCOM_LOCK) || (type == DLM_RCOM_LOCK_REPLY)) |
141 | rcom_lock_out((struct rcom_lock *) rc->rc_buf); | 141 | rcom_lock_out((struct rcom_lock *) rc->rc_buf); |
142 | 142 | ||
143 | else if (type == DLM_RCOM_STATUS_REPLY) | 143 | else if (type == DLM_RCOM_STATUS_REPLY) |
@@ -147,6 +147,7 @@ void dlm_rcom_out(struct dlm_rcom *rc) | |||
147 | void dlm_rcom_in(struct dlm_rcom *rc) | 147 | void dlm_rcom_in(struct dlm_rcom *rc) |
148 | { | 148 | { |
149 | struct dlm_header *hd = (struct dlm_header *) rc; | 149 | struct dlm_header *hd = (struct dlm_header *) rc; |
150 | int type; | ||
150 | 151 | ||
151 | header_in(hd); | 152 | header_in(hd); |
152 | 153 | ||
@@ -156,10 +157,12 @@ void dlm_rcom_in(struct dlm_rcom *rc) | |||
156 | rc->rc_seq = le64_to_cpu(rc->rc_seq); | 157 | rc->rc_seq = le64_to_cpu(rc->rc_seq); |
157 | rc->rc_seq_reply = le64_to_cpu(rc->rc_seq_reply); | 158 | rc->rc_seq_reply = le64_to_cpu(rc->rc_seq_reply); |
158 | 159 | ||
159 | if (rc->rc_type == DLM_RCOM_LOCK) | 160 | type = rc->rc_type; |
161 | |||
162 | if ((type == DLM_RCOM_LOCK) || (type == DLM_RCOM_LOCK_REPLY)) | ||
160 | rcom_lock_in((struct rcom_lock *) rc->rc_buf); | 163 | rcom_lock_in((struct rcom_lock *) rc->rc_buf); |
161 | 164 | ||
162 | else if (rc->rc_type == DLM_RCOM_STATUS_REPLY) | 165 | else if (type == DLM_RCOM_STATUS_REPLY) |
163 | rcom_config_in((struct rcom_config *) rc->rc_buf); | 166 | rcom_config_in((struct rcom_config *) rc->rc_buf); |
164 | } | 167 | } |
165 | 168 | ||