aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lowcomms.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-08-24 14:18:04 -0400
committerDavid Teigland <teigland@redhat.com>2009-08-24 14:18:04 -0400
commit1329e3f2c898cfabb6ed236d3fb8c1725197af53 (patch)
treef4ca0178fb5f3f874e0493ac67fb196d326a40d7 /fs/dlm/lowcomms.c
parent063c4c99630c0b06afad080d2a18bda64172c1a2 (diff)
dlm: use kernel_sendpage
Using kernel_sendpage() is cleaner and safer than following sock->ops ourselves. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lowcomms.c')
-rw-r--r--fs/dlm/lowcomms.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index bda690cd3640..240cef14fe58 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1285,7 +1285,6 @@ out:
1285static void send_to_sock(struct connection *con) 1285static void send_to_sock(struct connection *con)
1286{ 1286{
1287 int ret = 0; 1287 int ret = 0;
1288 ssize_t(*sendpage) (struct socket *, struct page *, int, size_t, int);
1289 const int msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL; 1288 const int msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
1290 struct writequeue_entry *e; 1289 struct writequeue_entry *e;
1291 int len, offset; 1290 int len, offset;
@@ -1294,8 +1293,6 @@ static void send_to_sock(struct connection *con)
1294 if (con->sock == NULL) 1293 if (con->sock == NULL)
1295 goto out_connect; 1294 goto out_connect;
1296 1295
1297 sendpage = con->sock->ops->sendpage;
1298
1299 spin_lock(&con->writequeue_lock); 1296 spin_lock(&con->writequeue_lock);
1300 for (;;) { 1297 for (;;) {
1301 e = list_entry(con->writequeue.next, struct writequeue_entry, 1298 e = list_entry(con->writequeue.next, struct writequeue_entry,
@@ -1310,8 +1307,8 @@ static void send_to_sock(struct connection *con)
1310 1307
1311 ret = 0; 1308 ret = 0;
1312 if (len) { 1309 if (len) {
1313 ret = sendpage(con->sock, e->page, offset, len, 1310 ret = kernel_sendpage(con->sock, e->page, offset, len,
1314 msg_flags); 1311 msg_flags);
1315 if (ret == -EAGAIN || ret == 0) { 1312 if (ret == -EAGAIN || ret == 0) {
1316 cond_resched(); 1313 cond_resched();
1317 goto out; 1314 goto out;