__u32 lustre_msg_size(__u32 magic, int count, __u32 *lengths);
__u32 lustre_msg_size_v2(int count, __u32 *lengths);
__u32 lustre_packed_msg_size(struct lustre_msg *msg);
-__u32 lustre_msg_early_size(void);
+extern __u32 lustre_msg_early_size;
void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, __u32 n, __u32 min_size);
void *lustre_msg_buf(struct lustre_msg *m, __u32 n, __u32 minlen);
__u32 lustre_msg_buflen(struct lustre_msg *m, __u32 n);
/* Get real repbuf allocated size as rounded up power of 2 */
repsize = size_roundup_power2(req->rq_replen +
- lustre_msg_early_size());
+ lustre_msg_early_size);
/* Estimate free space for DoM files in repbuf */
repsize_estimate = repsize - (req->rq_replen -
mdt_md_capsule_size +
CDEBUG(D_INFO, "Increase repbuf by %d bytes, total: %d\n",
repsize, req->rq_replen);
repsize = size_roundup_power2(req->rq_replen +
- lustre_msg_early_size());
+ lustre_msg_early_size);
}
/* The only way to report real allocated repbuf size to the server
* is the lm_repsize but it must be set prior buffer allocation itself
int clearsize;
buflens[0] = PTLRPC_GSS_HEADER_SIZE;
- buflens[1] = lustre_msg_early_size();
+ buflens[1] = lustre_msg_early_size;
buflens[2] = gss_cli_payload(NULL, buflens[1], 0);
gss_at_reply_off_integ = lustre_msg_size_v2(3, buflens);
- buflens[0] = lustre_msg_early_size();
+ buflens[0] = lustre_msg_early_size;
clearsize = lustre_msg_size_v2(1, buflens);
buflens[0] = PTLRPC_GSS_HEADER_SIZE;
buflens[1] = gss_cli_payload(NULL, clearsize, 0);
#undef LUSTRE_MSG_MAGIC_V1
}
+__u32 lustre_msg_early_size;
+EXPORT_SYMBOL(lustre_msg_early_size);
+
/* early reply size */
-__u32 lustre_msg_early_size()
+void lustre_msg_early_size_init(void)
{
__u32 pblen = sizeof(struct ptlrpc_body);
- return lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen);
+ lustre_msg_early_size = lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, &pblen);
}
-EXPORT_SYMBOL(lustre_msg_early_size);
__u32 lustre_msg_size_v2(int count, __u32 *lengths)
{
struct ptlrpc_reply_state *
lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt);
void lustre_put_emerg_rs(struct ptlrpc_reply_state *rs);
+void lustre_msg_early_size_init(void); /* just for init */
/* pinger.c */
int ptlrpc_start_pinger(void);
mutex_init(&pinger_mutex);
mutex_init(&ptlrpcd_mutex);
ptlrpc_init_xid();
+ lustre_msg_early_size_init();
rc = req_layout_init();
if (rc)
int msgsize)
{
/* add space for early replied */
- msgsize += lustre_msg_early_size();
+ msgsize += lustre_msg_early_size;
msgsize = size_roundup_power2(msgsize);
if (likely(req->rq_packed_final)) {
if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)
- req->rq_reply_off = lustre_msg_early_size();
+ req->rq_reply_off = lustre_msg_early_size;
} else {
__u32 cksum;
__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
int rc;
- buflens[PLAIN_PACK_MSG_OFF] = lustre_msg_early_size();
+ buflens[PLAIN_PACK_MSG_OFF] = lustre_msg_early_size;
plain_at_offset = lustre_msg_size_v2(PLAIN_PACK_SEGMENTS, buflens);
rc = sptlrpc_register_policy(&plain_policy);