]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: GFP_NOFS for vmalloc; vmalloc large incoming msgs too
authorSage Weil <sage@newdream.net>
Mon, 10 Aug 2009 20:29:00 +0000 (13:29 -0700)
committerSage Weil <sage@newdream.net>
Mon, 10 Aug 2009 20:29:00 +0000 (13:29 -0700)
src/kernel/messenger.c

index 2e9b3c6f45675717aee1276484ee98f143af3dfc..a6c8e0a8f7f494a96551e6660e48030f0e8328b8 100644 (file)
@@ -1432,7 +1432,15 @@ static int read_partial_message(struct ceph_connection *con)
 
        while (m->front.iov_len < front_len) {
                if (m->front.iov_base == NULL) {
-                       m->front.iov_base = kmalloc(front_len, GFP_NOFS);
+                       if (front_len > PAGE_CACHE_SIZE) {
+                               m->front.iov_base = __vmalloc(front_len,
+                                                             GFP_NOFS,
+                                                             PAGE_KERNEL);
+                               m->front_is_vmalloc = true;
+                       } else {
+                               m->front.iov_base = kmalloc(front_len,
+                                                           GFP_NOFS);
+                       }
                        if (m->front.iov_base == NULL)
                                return -ENOMEM;
                }
@@ -2296,7 +2304,8 @@ struct ceph_msg *ceph_msg_new(int type, int front_len,
        /* front */
        if (front_len) {
                if (front_len > PAGE_CACHE_SIZE) {
-                       m->front.iov_base = vmalloc(front_len);
+                       m->front.iov_base = __vmalloc(front_len, GFP_NOFS,
+                                                     PAGE_KERNEL);
                        m->front_is_vmalloc = true;
                } else {
                        m->front.iov_base = kmalloc(front_len, GFP_NOFS);