[PATCH] [1/7] Convert a few direct bounce_gfp users over to the blk_* wrappers

From: Andi Kleen
Date: Fri Mar 07 2008 - 04:22:24 EST



Signed-off-by: Andi Kleen <ak@xxxxxxx>

---
block/scsi_ioctl.c | 6 ++++--
fs/bio.c | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)

Index: linux/block/scsi_ioctl.c
===================================================================
--- linux.orig/block/scsi_ioctl.c
+++ linux/block/scsi_ioctl.c
@@ -433,10 +433,12 @@ int sg_scsi_ioctl(struct file *file, str

bytes = max(in_len, out_len);
if (bytes) {
- buffer = kzalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);
+ /* RED-PEN GFP_NOIO really needed? */
+ buffer = blk_kmalloc(q, bytes,
+ GFP_NOIO | GFP_USER | __GFP_NOWARN);
if (!buffer)
return -ENOMEM;
-
+ memset(buffer, 0, bytes);
}

rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
Index: linux/fs/bio.c
===================================================================
--- linux.orig/fs/bio.c
+++ linux/fs/bio.c
@@ -545,7 +545,7 @@ struct bio *bio_copy_user(struct request
if (bytes > len)
bytes = len;

- page = alloc_page(q->bounce_gfp | GFP_KERNEL);
+ page = blk_alloc_pages(q, GFP_KERNEL, PAGE_SIZE);
if (!page) {
ret = -ENOMEM;
break;
--
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/