seq, issue_seq, mseq, follows, size, max_size,
xattr_version, xattrs_buf ? (int)xattrs_buf->vec.iov_len : 0);
- msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPS, sizeof(*fc), 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPS, sizeof(*fc));
if (!msg)
return -ENOMEM;
struct ceph_msg *msg;
struct ceph_mds_session_head *h;
- msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h), 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_CLIENT_SESSION, sizeof(*h));
if (!msg) {
pr_err("create_session_msg ENOMEM creating msg\n");
return NULL;
while (session->s_num_cap_releases < session->s_nr_caps + extra) {
spin_unlock(&session->s_cap_lock);
- msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPRELEASE, PAGE_CACHE_SIZE,
- 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPRELEASE, PAGE_CACHE_SIZE);
if (!msg)
goto out_unlocked;
dout("add_cap_releases %p msg %p now %d\n", session, msg,
if (req->r_old_dentry_drop)
len += req->r_old_dentry->d_name.len;
- msg = ceph_msg_new(CEPH_MSG_CLIENT_REQUEST, len, 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_CLIENT_REQUEST, len);
if (!msg) {
msg = ERR_PTR(-ENOMEM);
goto out_free2;
ceph_pagelist_init(pagelist);
err = -ENOMEM;
- reply = ceph_msg_new(CEPH_MSG_CLIENT_RECONNECT, 0, 0, 0, NULL);
+ reply = ceph_msg_new(CEPH_MSG_CLIENT_RECONNECT, 0);
if (!reply)
goto fail_nomsg;
dnamelen = dentry->d_name.len;
len += dnamelen;
- msg = ceph_msg_new(CEPH_MSG_CLIENT_LEASE, len, 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_CLIENT_LEASE, len);
if (!msg)
return;
lease = msg->front.iov_base;
* construct a new message with given type, size
* the new msg has a ref count of 1.
*/
-struct ceph_msg *ceph_msg_new(int type, int front_len,
- int page_len, int page_off, struct page **pages)
+struct ceph_msg *ceph_msg_new(int type, int front_len)
{
struct ceph_msg *m;
m->hdr.version = 0;
m->hdr.front_len = cpu_to_le32(front_len);
m->hdr.middle_len = 0;
- m->hdr.data_len = cpu_to_le32(page_len);
- m->hdr.data_off = cpu_to_le16(page_off);
+ m->hdr.data_len = 0;
+ m->hdr.data_off = 0;
m->hdr.reserved = 0;
m->footer.front_crc = 0;
m->footer.middle_crc = 0;
m->middle = NULL;
/* data */
- m->nr_pages = calc_pages_for(page_off, page_len);
- m->pages = pages;
+ m->nr_pages = 0;
+ m->pages = NULL;
m->pagelist = NULL;
- dout("ceph_msg_new %p page %d~%d -> %d\n", m, page_off, page_len,
- m->nr_pages);
+ dout("ceph_msg_new %p front %d\n", m, front_len);
return m;
out2:
ceph_msg_put(m);
out:
- pr_err("msg_new can't create type %d len %d\n", type, front_len);
+ pr_err("msg_new can't create type %d front %d\n", type, front_len);
return NULL;
}
}
if (!msg) {
*skip = 0;
- msg = ceph_msg_new(type, front_len, 0, 0, NULL);
+ msg = ceph_msg_new(type, front_len);
if (!msg) {
pr_err("unable to allocate msg type %d len %d\n",
type, front_len);
}
memcpy(&msg->hdr, &con->in_hdr, sizeof(con->in_hdr));
- if (middle_len) {
+ if (middle_len && !msg->middle) {
ret = ceph_alloc_middle(con, msg);
if (ret < 0) {
ceph_msg_put(msg);
extern struct ceph_connection *ceph_con_get(struct ceph_connection *con);
extern void ceph_con_put(struct ceph_connection *con);
-extern struct ceph_msg *ceph_msg_new(int type, int front_len,
- int page_len, int page_off,
- struct page **pages);
+extern struct ceph_msg *ceph_msg_new(int type, int front_len);
extern void ceph_msg_kfree(struct ceph_msg *m);
struct ceph_mon_subscribe_item *i;
void *p, *end;
- msg = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE, 96, 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE, 96);
if (!msg)
return;
init_completion(&req->completion);
err = -ENOMEM;
- req->request = ceph_msg_new(CEPH_MSG_STATFS, sizeof(*h), 0, 0, NULL);
+ req->request = ceph_msg_new(CEPH_MSG_STATFS, sizeof(*h));
if (!req->request)
goto out;
- req->reply = ceph_msg_new(CEPH_MSG_STATFS_REPLY, 1024, 0, 0, NULL);
+ req->reply = ceph_msg_new(CEPH_MSG_STATFS_REPLY, 1024);
if (!req->reply)
goto out;
/* msg pools */
err = -ENOMEM;
monc->m_subscribe_ack = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE_ACK,
- sizeof(struct ceph_mon_subscribe_ack),
- 0, 0, NULL);
+ sizeof(struct ceph_mon_subscribe_ack));
if (!monc->m_subscribe_ack)
goto out_monmap;
- monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096, 0, 0,
- NULL);
+ monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096);
if (!monc->m_auth_reply)
goto out_subscribe_ack;
- monc->m_auth = ceph_msg_new(CEPH_MSG_AUTH, 4096, 0, 0, NULL);
+ monc->m_auth = ceph_msg_new(CEPH_MSG_AUTH, 4096);
monc->pending_auth = 0;
if (!monc->m_auth)
goto out_auth_reply;
case CEPH_MSG_MON_MAP:
case CEPH_MSG_MDS_MAP:
case CEPH_MSG_OSD_MAP:
- m = ceph_msg_new(type, front_len, 0, 0, NULL);
+ m = ceph_msg_new(type, front_len);
break;
}
{
struct ceph_msgpool *pool = arg;
- return ceph_msg_new(0, pool->front_len, 0, 0, NULL);
+ return ceph_msg_new(0, pool->front_len);
}
static void free_fn(void *element, void *arg)
WARN_ON(1);
/* try to alloc a fresh message */
- return ceph_msg_new(0, front_len, 0, 0, NULL);
+ return ceph_msg_new(0, front_len);
}
return mempool_alloc(pool->pool, GFP_NOFS);
msg = ceph_msgpool_get(&osdc->msgpool_op_reply, 0);
else
msg = ceph_msg_new(CEPH_MSG_OSD_OPREPLY,
- OSD_OPREPLY_FRONT_LEN, 0, 0, NULL);
+ OSD_OPREPLY_FRONT_LEN);
if (!msg) {
ceph_osdc_put_request(req);
return NULL;
if (use_mempool)
msg = ceph_msgpool_get(&osdc->msgpool_op, 0);
else
- msg = ceph_msg_new(CEPH_MSG_OSD_OP, msg_size, 0, 0, NULL);
+ msg = ceph_msg_new(CEPH_MSG_OSD_OP, msg_size);
if (!msg) {
ceph_osdc_put_request(req);
return NULL;
if (front > req->r_reply->front.iov_len) {
pr_warning("get_reply front %d > preallocated %d\n",
front, (int)req->r_reply->front.iov_len);
- m = ceph_msg_new(CEPH_MSG_OSD_OPREPLY, front, 0, 0, NULL);
+ m = ceph_msg_new(CEPH_MSG_OSD_OPREPLY, front);
if (!m)
goto out;
ceph_msg_put(req->r_reply);
switch (type) {
case CEPH_MSG_OSD_MAP:
- return ceph_msg_new(type, front, 0, 0, NULL);
+ return ceph_msg_new(type, front);
case CEPH_MSG_OSD_OPREPLY:
return get_reply(con, hdr, skip);
default: