Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: switch some GFP_NOFS memory allocation to GFP_KERNEL

GFP_NOFS memory allocation is required for page writeback path.
But there is no need to use GFP_NOFS in syscall path and readpage
path

Signed-off-by: Yan, Zheng <zyan@redhat.com>

authored by

Yan, Zheng and committed by
Ilya Dryomov
687265e5 f66fd9f0

+15 -14
+2 -2
fs/ceph/acl.c
··· 187 187 val_size2 = posix_acl_xattr_size(default_acl->a_count); 188 188 189 189 err = -ENOMEM; 190 - tmp_buf = kmalloc(max(val_size1, val_size2), GFP_NOFS); 190 + tmp_buf = kmalloc(max(val_size1, val_size2), GFP_KERNEL); 191 191 if (!tmp_buf) 192 192 goto out_err; 193 - pagelist = kmalloc(sizeof(struct ceph_pagelist), GFP_NOFS); 193 + pagelist = kmalloc(sizeof(struct ceph_pagelist), GFP_KERNEL); 194 194 if (!pagelist) 195 195 goto out_err; 196 196 ceph_pagelist_init(pagelist);
+2 -2
fs/ceph/addr.c
··· 350 350 351 351 /* build page vector */ 352 352 nr_pages = calc_pages_for(0, len); 353 - pages = kmalloc(sizeof(*pages) * nr_pages, GFP_NOFS); 353 + pages = kmalloc(sizeof(*pages) * nr_pages, GFP_KERNEL); 354 354 ret = -ENOMEM; 355 355 if (!pages) 356 356 goto out; ··· 362 362 dout("start_read %p adding %p idx %lu\n", inode, page, 363 363 page->index); 364 364 if (add_to_page_cache_lru(page, &inode->i_data, page->index, 365 - GFP_NOFS)) { 365 + GFP_KERNEL)) { 366 366 ceph_fscache_uncache_page(inode, page); 367 367 page_cache_release(page); 368 368 dout("start_read %p add_to_page_cache failed %p\n",
+5 -5
fs/ceph/dir.c
··· 38 38 if (dentry->d_fsdata) 39 39 return 0; 40 40 41 - di = kmem_cache_alloc(ceph_dentry_cachep, GFP_NOFS | __GFP_ZERO); 41 + di = kmem_cache_alloc(ceph_dentry_cachep, GFP_KERNEL | __GFP_ZERO); 42 42 if (!di) 43 43 return -ENOMEM; /* oh well */ 44 44 ··· 231 231 int len) 232 232 { 233 233 kfree(fi->last_name); 234 - fi->last_name = kmalloc(len+1, GFP_NOFS); 234 + fi->last_name = kmalloc(len+1, GFP_KERNEL); 235 235 if (!fi->last_name) 236 236 return -ENOMEM; 237 237 memcpy(fi->last_name, name, len); ··· 342 342 req->r_direct_hash = ceph_frag_value(frag); 343 343 req->r_direct_is_hash = true; 344 344 if (fi->last_name) { 345 - req->r_path2 = kstrdup(fi->last_name, GFP_NOFS); 345 + req->r_path2 = kstrdup(fi->last_name, GFP_KERNEL); 346 346 if (!req->r_path2) { 347 347 ceph_mdsc_put_request(req); 348 348 return -ENOMEM; ··· 764 764 err = PTR_ERR(req); 765 765 goto out; 766 766 } 767 - req->r_path2 = kstrdup(dest, GFP_NOFS); 767 + req->r_path2 = kstrdup(dest, GFP_KERNEL); 768 768 if (!req->r_path2) { 769 769 err = -ENOMEM; 770 770 ceph_mdsc_put_request(req); ··· 1189 1189 return -EISDIR; 1190 1190 1191 1191 if (!cf->dir_info) { 1192 - cf->dir_info = kmalloc(bufsize, GFP_NOFS); 1192 + cf->dir_info = kmalloc(bufsize, GFP_KERNEL); 1193 1193 if (!cf->dir_info) 1194 1194 return -ENOMEM; 1195 1195 cf->dir_info_len =
+4 -4
fs/ceph/file.c
··· 89 89 case S_IFDIR: 90 90 dout("init_file %p %p 0%o (regular)\n", inode, file, 91 91 inode->i_mode); 92 - cf = kmem_cache_alloc(ceph_file_cachep, GFP_NOFS | __GFP_ZERO); 92 + cf = kmem_cache_alloc(ceph_file_cachep, GFP_KERNEL | __GFP_ZERO); 93 93 if (cf == NULL) { 94 94 ceph_put_fmode(ceph_inode(inode), fmode); /* clean up */ 95 95 return -ENOMEM; ··· 483 483 } 484 484 } else { 485 485 num_pages = calc_pages_for(off, len); 486 - pages = ceph_alloc_page_vector(num_pages, GFP_NOFS); 486 + pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL); 487 487 if (IS_ERR(pages)) 488 488 return PTR_ERR(pages); 489 489 ret = striped_read(inode, off, len, pages, ··· 734 734 */ 735 735 num_pages = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 736 736 737 - pages = ceph_alloc_page_vector(num_pages, GFP_NOFS); 737 + pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL); 738 738 if (IS_ERR(pages)) { 739 739 ret = PTR_ERR(pages); 740 740 goto out; ··· 858 858 struct page *page = NULL; 859 859 loff_t i_size; 860 860 if (retry_op == READ_INLINE) { 861 - page = __page_cache_alloc(GFP_NOFS); 861 + page = __page_cache_alloc(GFP_KERNEL); 862 862 if (!page) 863 863 return -ENOMEM; 864 864 }
+2 -1
fs/ceph/mds_client.c
··· 1668 1668 1669 1669 order = get_order(size * num_entries); 1670 1670 while (order >= 0) { 1671 - rinfo->dir_in = (void*)__get_free_pages(GFP_NOFS | __GFP_NOWARN, 1671 + rinfo->dir_in = (void*)__get_free_pages(GFP_KERNEL | 1672 + __GFP_NOWARN, 1672 1673 order); 1673 1674 if (rinfo->dir_in) 1674 1675 break;