aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/messenger.c
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-04-06 17:33:58 -0400
committerSage Weil <sage@newdream.net>2010-05-17 18:25:42 -0400
commit34d23762d988b7dcb08390ac72a353df3d60193c (patch)
tree3a49d039527548697165da2b8789f3588b95ffed /fs/ceph/messenger.c
parent23804d91f112df09b832cd091b71af4dc2831aa8 (diff)
ceph: all allocation functions should get gfp_mask
This is essential, as for the rados block device we'll need to run in different contexts that would need flags that are other than GFP_NOFS. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r--fs/ceph/messenger.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c
index 50c5f24086fd..60b74839ebec 100644
--- a/fs/ceph/messenger.c
+++ b/fs/ceph/messenger.c
@@ -2070,11 +2070,11 @@ void ceph_con_keepalive(struct ceph_connection *con)
2070 * construct a new message with given type, size 2070 * construct a new message with given type, size
2071 * the new msg has a ref count of 1. 2071 * the new msg has a ref count of 1.
2072 */ 2072 */
2073struct ceph_msg *ceph_msg_new(int type, int front_len) 2073struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
2074{ 2074{
2075 struct ceph_msg *m; 2075 struct ceph_msg *m;
2076 2076
2077 m = kmalloc(sizeof(*m), GFP_NOFS); 2077 m = kmalloc(sizeof(*m), flags);
2078 if (m == NULL) 2078 if (m == NULL)
2079 goto out; 2079 goto out;
2080 kref_init(&m->kref); 2080 kref_init(&m->kref);
@@ -2101,11 +2101,11 @@ struct ceph_msg *ceph_msg_new(int type, int front_len)
2101 /* front */ 2101 /* front */
2102 if (front_len) { 2102 if (front_len) {
2103 if (front_len > PAGE_CACHE_SIZE) { 2103 if (front_len > PAGE_CACHE_SIZE) {
2104 m->front.iov_base = __vmalloc(front_len, GFP_NOFS, 2104 m->front.iov_base = __vmalloc(front_len, flags,
2105 PAGE_KERNEL); 2105 PAGE_KERNEL);
2106 m->front_is_vmalloc = true; 2106 m->front_is_vmalloc = true;
2107 } else { 2107 } else {
2108 m->front.iov_base = kmalloc(front_len, GFP_NOFS); 2108 m->front.iov_base = kmalloc(front_len, flags);
2109 } 2109 }
2110 if (m->front.iov_base == NULL) { 2110 if (m->front.iov_base == NULL) {
2111 pr_err("msg_new can't allocate %d bytes\n", 2111 pr_err("msg_new can't allocate %d bytes\n",
@@ -2180,7 +2180,7 @@ static struct ceph_msg *ceph_alloc_msg(struct ceph_connection *con,
2180 } 2180 }
2181 if (!msg) { 2181 if (!msg) {
2182 *skip = 0; 2182 *skip = 0;
2183 msg = ceph_msg_new(type, front_len); 2183 msg = ceph_msg_new(type, front_len, GFP_NOFS);
2184 if (!msg) { 2184 if (!msg) {
2185 pr_err("unable to allocate msg type %d len %d\n", 2185 pr_err("unable to allocate msg type %d len %d\n",
2186 type, front_len); 2186 type, front_len);