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

Andi Kleen
2008-03-07T09:22:23Z

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;