struct req_msg_field {
__u32 rmf_flags;
const char *rmf_name;
- /*
+ /**
* Field length. (-1) means "variable length".
*/
int rmf_size;
EXPORT_SYMBOL(RMF_OBD_ID);
const struct req_msg_field RMF_FIEMAP_KEY =
- DEFINE_MSGF("FIEMAP", 0, sizeof(struct ll_fiemap_info_key),
+ DEFINE_MSGF("fiemap", 0, sizeof(struct ll_fiemap_info_key),
lustre_swab_fiemap);
EXPORT_SYMBOL(RMF_FIEMAP_KEY);
const struct req_msg_field RMF_FIEMAP_VAL =
- DEFINE_MSGF("FIEMAP", 0, -1, lustre_swab_fiemap);
+ DEFINE_MSGF("fiemap", 0, -1, lustre_swab_fiemap);
EXPORT_SYMBOL(RMF_FIEMAP_VAL);
/*
pill->rc_fmt->rf_name,
field->rmf_name, offset, loc);
offset --;
- LASSERT(0 <= offset && offset < (sizeof(pill->rc_swabbed) << 3));
+ LASSERT(0 <= offset && offset < REQ_MAX_FIELD_NR);
return offset;
}
void *value;
int len;
int offset;
+ int inout = loc == RCL_CLIENT;
void *(*getter)(struct lustre_msg *m, int n, int minlen);
[RCL_SERVER] = "server"
};
+ LASSERT(pill != NULL);
+ LASSERT(pill != LP_POISON);
fmt = pill->rc_fmt;
LASSERT(fmt != NULL);
+ LASSERT(fmt != LP_POISON);
LASSERT(__req_format_is_sane(fmt));
offset = __req_capsule_offset(pill, field, loc);
value = getter(msg, offset, len);
swabber = swabber ?: field->rmf_swabber;
- if (!(pill->rc_swabbed & (1 << offset)) && loc != pill->rc_loc &&
- swabber != NULL && value != NULL &&
- lustre_msg_swabbed(msg)) {
+ if (ptlrpc_req_need_swab(pill->rc_req, inout, offset) &&
+ swabber != NULL && value != NULL) {
swabber(value);
- pill->rc_swabbed |= (1 << offset);
+ ptlrpc_req_set_swabbed(pill->rc_req, inout, offset);
}
+
if (value == NULL) {
DEBUG_REQ(D_ERROR, pill->rc_req,
"Wrong buffer for field `%s' (%d of %d) "
FMT_FIELD(old, i, j)->rmf_size);
}
/* last field should be returned to the unswabbed state */
- pill->rc_swabbed &= ~(__u32)(1 << j);
pill->rc_fmt = fmt;
}
EXPORT_SYMBOL(req_capsule_extend);