From 3118122d2de16ede1cdb7fd30076956f48c13f93 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Apr 2008 09:58:33 -0700 Subject: [PATCH] kclient: GFP_NOFS --- src/kernel/addr.c | 4 ++-- src/kernel/dir.c | 2 +- src/kernel/file.c | 2 +- src/kernel/inode.c | 6 +++--- src/kernel/mds_client.c | 12 ++++++------ src/kernel/mdsmap.c | 6 +++--- src/kernel/messenger.c | 10 +++++----- src/kernel/mon_client.c | 4 ++-- src/kernel/osd_client.c | 10 +++++----- src/kernel/osdmap.c | 34 +++++++++++++++++----------------- src/kernel/super.c | 2 +- 11 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/kernel/addr.c b/src/kernel/addr.c index 0d9300fff8b88..2d7aa3b570916 100644 --- a/src/kernel/addr.c +++ b/src/kernel/addr.c @@ -77,7 +77,7 @@ static int ceph_readpages(struct file *file, struct address_space *mapping, list_del(&page->lru); if (add_to_page_cache(page, mapping, page->index, - GFP_KERNEL)) { + GFP_NOFS)) { page_cache_release(page); dout(20, "readpages add_to_page_cache failed on %p\n", page); @@ -196,7 +196,7 @@ static int ceph_writepages(struct address_space *mapping, /* larger page vector? */ max_pages = wsize >> PAGE_CACHE_SHIFT; if (max_pages > PAGEVEC_SIZE) { - pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL); + pages = kmalloc(max_pages * sizeof(*pages), GFP_NOFS); if (!pages) return generic_writepages(mapping, wbc); } else diff --git a/src/kernel/dir.c b/src/kernel/dir.c index 77013a496dcdc..5dfb63f2639fd 100644 --- a/src/kernel/dir.c +++ b/src/kernel/dir.c @@ -37,7 +37,7 @@ retry: if (len) len--; /* no leading '/' */ - path = kmalloc(len+1, GFP_KERNEL); + path = kmalloc(len+1, GFP_NOFS); if (path == NULL) return ERR_PTR(-ENOMEM); pos = len; diff --git a/src/kernel/file.c b/src/kernel/file.c index f4fef576f8a5e..dc1de9b1cc411 100644 --- a/src/kernel/file.c +++ b/src/kernel/file.c @@ -54,7 +54,7 @@ static int ceph_init_file(struct inode *inode, struct file *file, int fmode) { struct ceph_file_info *cf; - cf = kzalloc(sizeof(*cf), GFP_KERNEL); + cf = kzalloc(sizeof(*cf), GFP_NOFS); if (cf == NULL) { ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */ return -ENOMEM; diff --git a/src/kernel/inode.c b/src/kernel/inode.c index 96eb5a90ebdcd..58fee85bf4079 100644 --- a/src/kernel/inode.c +++ b/src/kernel/inode.c @@ -183,7 +183,7 @@ no_change: ci->i_fragtree->nsplits)); dout(20, "symlink len is %d\n", symlen); BUG_ON(symlen != ci->vfs_inode.i_size); - ci->i_symlink = kmalloc(symlen+1, GFP_KERNEL); + ci->i_symlink = kmalloc(symlen+1, GFP_NOFS); if (ci->i_symlink == NULL) return -ENOMEM; memcpy(ci->i_symlink, @@ -308,7 +308,7 @@ void ceph_update_dentry_lease(struct dentry *dentry, if (!di) { spin_unlock(&dentry->d_lock); di = kmalloc(sizeof(struct ceph_dentry_info), - GFP_KERNEL); + GFP_NOFS); if (!di) return; /* oh well */ spin_lock(&dentry->d_lock); @@ -651,7 +651,7 @@ struct ceph_inode_cap *ceph_add_cap(struct inode *inode, cap = new_cap; else { spin_unlock(&inode->i_lock); - new_cap = kmalloc(sizeof(*cap), GFP_KERNEL); + new_cap = kmalloc(sizeof(*cap), GFP_NOFS); if (new_cap == 0) return ERR_PTR(-ENOMEM); spin_lock(&inode->i_lock); diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index 5b4623800b1dd..092c51d9d7730 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -95,7 +95,7 @@ static int parse_reply_info_trace(void **p, void *end, sizeof(*info->trace_dir) + sizeof(*info->trace_dname) + sizeof(*info->trace_dname_len)), - GFP_KERNEL); + GFP_NOFS); if (info->trace_in == NULL) goto badmem; @@ -171,7 +171,7 @@ int parse_reply_info_dir(void **p, void *end, struct ceph_mds_reply_info *info) sizeof(*info->dir_dname) + sizeof(*info->dir_dname_len) + sizeof(*info->dir_dlease)), - GFP_KERNEL); + GFP_NOFS); if (info->dir_in == NULL) goto badmem; info->dir_ilease = (void *)(info->dir_in + num); @@ -285,7 +285,7 @@ __register_session(struct ceph_mds_client *mdsc, int mds) spin_unlock(&mdsc->lock); - s = kmalloc(sizeof(struct ceph_mds_session), GFP_KERNEL); + s = kmalloc(sizeof(struct ceph_mds_session), GFP_NOFS); s->s_mds = mds; s->s_state = CEPH_MDS_SESSION_NEW; s->s_cap_seq = 0; @@ -310,7 +310,7 @@ __register_session(struct ceph_mds_client *mdsc, int mds) dout(50, "register_session realloc to %d\n", newmax); spin_unlock(&mdsc->lock); - sa = kzalloc(newmax * sizeof(void *), GFP_KERNEL); + sa = kzalloc(newmax * sizeof(void *), GFP_NOFS); spin_lock(&mdsc->lock); if (sa == NULL) return ERR_PTR(-ENOMEM); @@ -404,7 +404,7 @@ static struct ceph_mds_request *new_request(struct ceph_msg *msg) { struct ceph_mds_request *req; - req = kmalloc(sizeof(*req), GFP_KERNEL); + req = kmalloc(sizeof(*req), GFP_NOFS); req->r_request = msg; req->r_reply = 0; req->r_last_inode = 0; @@ -953,7 +953,7 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, BUG_ON(le32_to_cpu(req->r_request->hdr.type) != CEPH_MSG_CLIENT_REQUEST); - radix_tree_preload(GFP_KERNEL); + radix_tree_preload(GFP_NOFS); spin_lock(&mdsc->lock); __register_request(mdsc, req); diff --git a/src/kernel/mdsmap.c b/src/kernel/mdsmap.c index 049d58f53a4ad..d156150c3fedb 100644 --- a/src/kernel/mdsmap.c +++ b/src/kernel/mdsmap.c @@ -59,7 +59,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) __u32 mds; int err = -EINVAL; - m = kzalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc(sizeof(*m), GFP_NOFS); if (m == NULL) return ERR_PTR(-ENOMEM); @@ -75,8 +75,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) ceph_decode_32(p, m->m_session_autoclose); ceph_decode_32(p, m->m_max_mds); - m->m_addr = kmalloc(m->m_max_mds*sizeof(*m->m_addr), GFP_KERNEL); - m->m_state = kzalloc(m->m_max_mds*sizeof(*m->m_state), GFP_KERNEL); + m->m_addr = kmalloc(m->m_max_mds*sizeof(*m->m_addr), GFP_NOFS); + m->m_state = kzalloc(m->m_max_mds*sizeof(*m->m_state), GFP_NOFS); if (m->m_addr == NULL || m->m_state == NULL) goto badmem; diff --git a/src/kernel/messenger.c b/src/kernel/messenger.c index ec1ba2dd28efa..995a893ca0c4c 100644 --- a/src/kernel/messenger.c +++ b/src/kernel/messenger.c @@ -38,7 +38,7 @@ static void try_accept(struct work_struct *); static struct ceph_connection *new_connection(struct ceph_messenger *msgr) { struct ceph_connection *con; - con = kzalloc(sizeof(struct ceph_connection), GFP_KERNEL); + con = kzalloc(sizeof(struct ceph_connection), GFP_NOFS); if (con == NULL) return NULL; @@ -650,7 +650,7 @@ static int read_message_partial(struct ceph_connection *con) front_len = le32_to_cpu(m->hdr.front_len); while (m->front.iov_len < front_len) { if (m->front.iov_base == NULL) { - m->front.iov_base = kmalloc(front_len, GFP_KERNEL); + m->front.iov_base = kmalloc(front_len, GFP_NOFS); if (m->front.iov_base == NULL) return -ENOMEM; } @@ -970,7 +970,7 @@ static void process_accept(struct ceph_connection *con) __u32 peer_cseq = le32_to_cpu(con->in_connect_seq); /* do we have an existing connection for this peer? */ - radix_tree_preload(GFP_KERNEL); + radix_tree_preload(GFP_NOFS); spin_lock(&msgr->con_lock); existing = __get_connection(msgr, &con->peer_addr); if (existing) { @@ -1394,7 +1394,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, { struct ceph_msg *m; - m = kmalloc(sizeof(*m), GFP_KERNEL); + m = kmalloc(sizeof(*m), GFP_NOFS); if (m == NULL) goto out; atomic_set(&m->nref, 1); @@ -1405,7 +1405,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, /* front */ if (front_len) { - m->front.iov_base = kmalloc(front_len, GFP_KERNEL); + m->front.iov_base = kmalloc(front_len, GFP_NOFS); if (m->front.iov_base == NULL) goto out2; } else { diff --git a/src/kernel/mon_client.c b/src/kernel/mon_client.c index 644a34209514f..5e3c7535beb98 100644 --- a/src/kernel/mon_client.c +++ b/src/kernel/mon_client.c @@ -17,7 +17,7 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end) int i, err = -EINVAL; dout(30, "monmap_decode %p %p\n", p, end); - m = kmalloc(end-p, GFP_KERNEL); + m = kmalloc(end-p, GFP_NOFS); if (m == NULL) return ERR_PTR(-ENOMEM); @@ -317,7 +317,7 @@ int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl) if (monc->monmap == NULL) return -ENOMEM; spin_lock_init(&monc->lock); - INIT_RADIX_TREE(&monc->statfs_request_tree, GFP_KERNEL); + INIT_RADIX_TREE(&monc->statfs_request_tree, GFP_NOFS); INIT_DELAYED_WORK(&monc->mds_delayed_work, do_request_mdsmap); INIT_DELAYED_WORK(&monc->osd_delayed_work, do_request_osdmap); INIT_DELAYED_WORK(&monc->umount_delayed_work, do_request_umount); diff --git a/src/kernel/osd_client.c b/src/kernel/osd_client.c index 964adbcc2125e..d923632068876 100644 --- a/src/kernel/osd_client.c +++ b/src/kernel/osd_client.c @@ -67,7 +67,7 @@ static struct ceph_osd_request *alloc_request(int nr_pages, { struct ceph_osd_request *req; - req = kmalloc(sizeof(*req) + nr_pages*sizeof(void *), GFP_KERNEL); + req = kmalloc(sizeof(*req) + nr_pages*sizeof(void *), GFP_NOFS); if (req == NULL) return ERR_PTR(-ENOMEM); req->r_request = msg; @@ -438,7 +438,7 @@ int do_request(struct ceph_osd_client *osdc, struct ceph_osd_request *req) /* register+send request */ down_read(&osdc->map_sem); - radix_tree_preload(GFP_KERNEL); + radix_tree_preload(GFP_NOFS); register_request(osdc, req); send_request(osdc, req, -1); up_read(&osdc->map_sem); @@ -483,7 +483,7 @@ void ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client) spin_lock_init(&osdc->request_lock); osdc->last_tid = 0; osdc->nr_requests = 0; - INIT_RADIX_TREE(&osdc->request_tree, GFP_KERNEL); + INIT_RADIX_TREE(&osdc->request_tree, GFP_NOFS); INIT_DELAYED_WORK(&osdc->timeout_work, handle_timeout); } @@ -554,7 +554,7 @@ int ceph_osdc_sync_read(struct ceph_osd_client *osdc, ceph_ino_t ino, /* allocate temp pages to hold data */ for (i = 0; i < nr_pages; i++) { - req->r_pages[i] = alloc_page(GFP_KERNEL); + req->r_pages[i] = alloc_page(GFP_NOFS); if (req->r_pages[i] == NULL) { req->r_nr_pages = i+1; put_request(req); @@ -736,7 +736,7 @@ int ceph_osdc_sync_write(struct ceph_osd_client *osdc, ceph_ino_t ino, left = len; po = off & ~PAGE_MASK; for (i = 0; i < nr_pages; i++) { - req->r_pages[i] = alloc_page(GFP_KERNEL); + req->r_pages[i] = alloc_page(GFP_NOFS); if (req->r_pages[i] == NULL) { req->r_nr_pages = i+1; put_request(req); diff --git a/src/kernel/osdmap.c b/src/kernel/osdmap.c index 1f1201922ea27..dade396c61f0a 100644 --- a/src/kernel/osdmap.c +++ b/src/kernel/osdmap.c @@ -36,7 +36,7 @@ static int crush_decode_uniform_bucket(void **p, void *end, { int j; dout(30, "crush_decode_uniform_bucket %p to %p\n", *p, end); - b->primes = kmalloc(b->h.size * sizeof(__u32), GFP_KERNEL); + b->primes = kmalloc(b->h.size * sizeof(__u32), GFP_NOFS); if (b->primes == NULL) return -ENOMEM; ceph_decode_need(p, end, (1+b->h.size) * sizeof(__u32), bad); @@ -53,10 +53,10 @@ static int crush_decode_list_bucket(void **p, void *end, { int j; dout(30, "crush_decode_list_bucket %p to %p\n", *p, end); - b->item_weights = kmalloc(b->h.size * sizeof(__u32), GFP_KERNEL); + b->item_weights = kmalloc(b->h.size * sizeof(__u32), GFP_NOFS); if (b->item_weights == NULL) return -ENOMEM; - b->sum_weights = kmalloc(b->h.size * sizeof(__u32), GFP_KERNEL); + b->sum_weights = kmalloc(b->h.size * sizeof(__u32), GFP_NOFS); if (b->sum_weights == NULL) return -ENOMEM; ceph_decode_need(p, end, 2 * b->h.size * sizeof(__u32), bad); @@ -74,7 +74,7 @@ static int crush_decode_tree_bucket(void **p, void *end, { int j; dout(30, "crush_decode_tree_bucket %p to %p\n", *p, end); - b->node_weights = kmalloc(b->h.size * sizeof(__u32), GFP_KERNEL); + b->node_weights = kmalloc(b->h.size * sizeof(__u32), GFP_NOFS); if (b->node_weights == NULL) return -ENOMEM; ceph_decode_need(p, end, b->h.size * sizeof(__u32), bad); @@ -90,7 +90,7 @@ static int crush_decode_straw_bucket(void **p, void *end, { int j; dout(30, "crush_decode_straw_bucket %p to %p\n", *p, end); - b->straws = kmalloc(b->h.size * sizeof(__u32), GFP_KERNEL); + b->straws = kmalloc(b->h.size * sizeof(__u32), GFP_NOFS); if (b->straws == NULL) return -ENOMEM; ceph_decode_need(p, end, 2 * b->h.size * sizeof(__u32), bad); @@ -112,7 +112,7 @@ static struct crush_map *crush_decode(void **p, void *end) dout(30, "crush_decode %p to %p\n", *p, end); - c = kzalloc(sizeof(*c), GFP_KERNEL); + c = kzalloc(sizeof(*c), GFP_NOFS); if (c == NULL) return ERR_PTR(-ENOMEM); @@ -121,20 +121,20 @@ static struct crush_map *crush_decode(void **p, void *end) ceph_decode_32(p, c->max_rules); ceph_decode_32(p, c->max_devices); - c->device_offload = kmalloc(c->max_devices * sizeof(__u32), GFP_KERNEL); + c->device_offload = kmalloc(c->max_devices * sizeof(__u32), GFP_NOFS); if (c->device_offload == NULL) goto badmem; - c->device_parents = kmalloc(c->max_devices * sizeof(__u32), GFP_KERNEL); + c->device_parents = kmalloc(c->max_devices * sizeof(__u32), GFP_NOFS); if (c->device_parents == NULL) goto badmem; - c->bucket_parents = kmalloc(c->max_buckets * sizeof(__u32), GFP_KERNEL); + c->bucket_parents = kmalloc(c->max_buckets * sizeof(__u32), GFP_NOFS); if (c->bucket_parents == NULL) goto badmem; - c->buckets = kmalloc(c->max_buckets * sizeof(*c->buckets), GFP_KERNEL); + c->buckets = kmalloc(c->max_buckets * sizeof(*c->buckets), GFP_NOFS); if (c->buckets == NULL) goto badmem; - c->rules = kmalloc(c->max_rules * sizeof(*c->rules), GFP_KERNEL); + c->rules = kmalloc(c->max_rules * sizeof(*c->rules), GFP_NOFS); if (c->rules == NULL) goto badmem; @@ -172,7 +172,7 @@ static struct crush_map *crush_decode(void **p, void *end) break; } BUG_ON(size == 0); - b = c->buckets[i] = kzalloc(size, GFP_KERNEL); + b = c->buckets[i] = kzalloc(size, GFP_NOFS); if (b == NULL) goto badmem; @@ -186,7 +186,7 @@ static struct crush_map *crush_decode(void **p, void *end) dout(30, "crush_decode bucket size %d off %x %p to %p\n", b->size, (int)(*p-start), *p, end); - b->items = kmalloc(b->size * sizeof(__s32), GFP_KERNEL); + b->items = kmalloc(b->size * sizeof(__s32), GFP_NOFS); if (b->items == NULL) goto badmem; @@ -241,7 +241,7 @@ static struct crush_map *crush_decode(void **p, void *end) r = c->rules[i] = kmalloc(sizeof(**c->rules) + yes*sizeof(struct crush_rule_step), - GFP_KERNEL); + GFP_NOFS); if (r == NULL) goto badmem; r->len = yes; @@ -281,7 +281,7 @@ static int osdmap_set_max_osd(struct ceph_osdmap *map, int max) state = kzalloc(max * (sizeof(__u32) + sizeof(struct ceph_entity_addr)), - GFP_KERNEL); + GFP_NOFS); if (state == NULL) return -ENOMEM; addr = (void *)((__u32 *)state + max); @@ -309,7 +309,7 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) dout(30, "osdmap_decode from %p to %p\n", *p, end); - map = kzalloc(sizeof(*map), GFP_KERNEL); + map = kzalloc(sizeof(*map), GFP_NOFS); if (map == NULL) return ERR_PTR(-ENOMEM); @@ -351,7 +351,7 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) if (len) { map->pg_swap_primary = kmalloc(len * sizeof(*map->pg_swap_primary), - GFP_KERNEL); + GFP_NOFS); if (map->pg_swap_primary == NULL) goto badmem; map->num_pg_swap_primary = len; diff --git a/src/kernel/super.c b/src/kernel/super.c index 0f1406b15818b..32960f679cfe7 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -118,7 +118,7 @@ static struct inode *ceph_alloc_inode(struct super_block *sb) struct ceph_inode_info *ci; int i; - ci = kmem_cache_alloc(ceph_inode_cachep, GFP_KERNEL); + ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS); if (!ci) return NULL; -- 2.39.5