diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2008-10-07 20:27:46 +0200 |
---|---|---|
committer | Yehuda Sadeh <yehuda@hq.newdream.net> | 2008-10-07 21:35:43 +0200 |
commit | 8ef1cb27cb4badd94ee6e56647ca4c80110790c4 (patch) | |
tree | 36cedec1a57447b22a628b9137cf33f6d231ce96 | |
parent | kclient: use writepage instead of sendmsg for some of the data (diff) | |
download | ceph-8ef1cb27cb4badd94ee6e56647ca4c80110790c4.tar.xz ceph-8ef1cb27cb4badd94ee6e56647ca4c80110790c4.zip |
Revert "kclient: use writepage instead of sendmsg for some of the data"
This reverts commit 406fc33a6bb6120925edda0db9fc5f624d43efb9.
-rw-r--r-- | src/kernel/messenger.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src/kernel/messenger.c b/src/kernel/messenger.c index f298e1a9be2..8ccbce66833 100644 --- a/src/kernel/messenger.c +++ b/src/kernel/messenger.c @@ -17,9 +17,6 @@ int ceph_debug_msgr; #define DOUT_PREFIX "msgr: " #include "super.h" - -#define CEPH_USE_SENDPAGE - /* static tag bytes */ static char tag_ready = CEPH_MSGR_TAG_READY; static char tag_reset = CEPH_MSGR_TAG_RESETSESSION; @@ -337,7 +334,6 @@ int ceph_tcp_sendmsg(struct socket *sock, struct kvec *iov, /*printk(KERN_DEBUG "before sendmsg %d\n", len);*/ rlen = kernel_sendmsg(sock, &msg, iov, kvlen, len); - /*printk(KERN_DEBUG "after sendmsg %d\n", rlen);*/ return(rlen); } @@ -676,11 +672,7 @@ out: static int write_partial_msg_pages(struct ceph_connection *con, struct ceph_msg *msg) { -#ifndef CEPH_USE_SENDPAGE struct kvec kv; -#else - int len; -#endif int ret; unsigned data_len = le32_to_cpu(msg->hdr.data_len); @@ -689,24 +681,17 @@ static int write_partial_msg_pages(struct ceph_connection *con, con->out_msg_pos.page_pos); while (con->out_msg_pos.page < con->out_msg->nr_pages) { - struct page *page = NULL; -#ifndef CEPH_USE_SENDPAGE + struct page *page; void *kaddr; -#endif mutex_lock(&msg->page_mutex); if (msg->pages) { page = msg->pages[con->out_msg_pos.page]; -#ifndef CEPH_USE_SENDPAGE kaddr = kmap(page); -#endif } else { -#ifndef CEPH_USE_SENDPAGE /*dout(60, "using zero page\n");*/ kaddr = page_address(con->msgr->zero_page); -#endif } -#ifndef CEPH_USE_SENDPAGE kv.iov_base = kaddr + con->out_msg_pos.page_pos; kv.iov_len = min((int)(PAGE_SIZE - con->out_msg_pos.page_pos), (int)(data_len - con->out_msg_pos.data_pos)); @@ -716,33 +701,15 @@ static int write_partial_msg_pages(struct ceph_connection *con, kv.iov_base, kv.iov_len); con->out_msg_pos.did_page_crc = 1; } -#else - len = min((int)(PAGE_SIZE - con->out_msg_pos.page_pos), - (int)(data_len - con->out_msg_pos.data_pos)); - - con->out_msg_pos.did_page_crc = 0; -#endif - if (msg->pages) -#ifndef CEPH_USE_SENDPAGE - ret = ceph_tcp_sendmsg(con->sock, &kv, 1, kv.iov_len, 1); -#endif - ret = kernel_sendpage(con->sock, page, con->out_msg_pos.page_pos, len, MSG_DONTWAIT | MSG_NOSIGNAL | MSG_MORE); - else - ret = kernel_sendpage(con->sock, con->msgr->zero_page, con->out_msg_pos.page_pos, len, MSG_DONTWAIT | MSG_NOSIGNAL | MSG_MORE); -#ifndef CEPH_USE_SENDPAGE + ret = ceph_tcp_sendmsg(con->sock, &kv, 1, kv.iov_len, 1); if (msg->pages) kunmap(page); -#endif mutex_unlock(&msg->page_mutex); if (ret <= 0) goto out; con->out_msg_pos.data_pos += ret; con->out_msg_pos.page_pos += ret; -#ifndef CEPH_USE_SENDPAGE if (ret == kv.iov_len) { -#else - if (ret == len) { -#endif con->out_msg_pos.page_pos = 0; con->out_msg_pos.page++; con->out_msg_pos.did_page_crc = 0; |