Skip to content

Commit

Permalink
fs/splice.c: fix mapping_gfp_mask usage
Browse files Browse the repository at this point in the history
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: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Nick Piggin authored and Jens Axboe committed May 25, 2010
1 parent d02a2c0 commit 0ae0b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
break;

error = add_to_page_cache_lru(page, mapping, index,
mapping_gfp_mask(mapping));
GFP_KERNEL);
if (unlikely(error)) {
page_cache_release(page);
if (error == -EEXIST)
Expand Down

0 comments on commit 0ae0b5d

Please sign in to comment.