提交 0ae0b5d0 编写于 作者: N Nick Piggin 提交者: Jens Axboe

fs/splice.c: fix mapping_gfp_mask usage

mapping_gfp_mask() is not supposed to store allocation contex details,
only page location details.  So mapping_gfp_mask should be applied to the
pagecache page allocation, wheras normal (kernel mapped) memory should be
used for surrounding allocations such as radix-tree nodes allocated by
add_to_page_cache.  Context modifiers should be applied on a per-callsite
basis.

So change splice to follow this convention (which is followed in similar
code patterns in core code).
Signed-off-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 d02a2c07
...@@ -354,7 +354,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, ...@@ -354,7 +354,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
break; break;
error = add_to_page_cache_lru(page, mapping, index, error = add_to_page_cache_lru(page, mapping, index,
mapping_gfp_mask(mapping)); GFP_KERNEL);
if (unlikely(error)) { if (unlikely(error)) {
page_cache_release(page); page_cache_release(page);
if (error == -EEXIST) if (error == -EEXIST)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册