[PATCH] block: discard use gfp_mask

From: Hugh Dickins
Date: Wed Dec 30 2009 - 14:08:21 EST


blkdev_issue_discard() takes a gfp_mask argument: usually GFP_KERNEL,
but GFP_NOIO from swap and GFP_NOFS from gfs2. blkdev_issue_discard()
should use that for its alloc_page(), instead of assuming GFP_KERNEL.

Signed-off-by: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx>
---

block/blk-barrier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- 2.6.33-rc2/block/blk-barrier.c 2009-12-03 03:51:21.000000000 +0000
+++ linux/block/blk-barrier.c 2009-12-26 18:28:30.000000000 +0000
@@ -402,7 +402,7 @@ int blkdev_issue_discard(struct block_de
* our current implementations need. If we'll ever need
* more the interface will need revisiting.
*/
- page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+ page = alloc_page(gfp_mask | __GFP_ZERO);
if (!page)
goto out_free_bio;
if (bio_add_pc_page(q, bio, page, sector_size, 0) < sector_size)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/