All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: block: try-2 (modified): Initialize bi_rw in mpage so bio_add can make use of it.
@ 2011-07-11 17:31 Muthu Kumar
  2011-07-11 17:49 ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Muthu Kumar @ 2011-07-11 17:31 UTC (permalink / raw)
  To: jaxboe; +Cc: linux-kernel

Jens et al,

do_mpage_readpage()/__mpage_writepage(): When they allocate a new bio,
bi_rw is not initialized. So later when they call __bio_add_page(),
struct bvec_merge_data bvm's .bi_rw will not be initialized with right
direction.
It will be useful for some merge functions if they know the direction
of transfer.

Let me know if this looks good. There are few more places like this
(e.g blkdev_issue_zeroout()). Would it make sense to send patch for
these cases also?

Signed-off-by: Muthukumar R <muthur@gmail.com>

------------------------
 fs/mpage.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
------------------------
diff --git a/fs/mpage.c b/fs/mpage.c
index fdfae9f..efabfc0 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -291,6 +291,7 @@ alloc_new:
                                GFP_KERNEL);
                if (bio == NULL)
                        goto confused;
+                bio->bi_rw = READ;
        }

        length = first_hole << blkbits;
@@ -583,6 +584,7 @@ alloc_new:
                                bio_get_nr_vecs(bdev), GFP_NOFS|__GFP_HIGH);
                if (bio == NULL)
                        goto confused;
+                bio->bi_rw = WRITE;
        }

        /*

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-26 13:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 17:31 [PATCH]: block: try-2 (modified): Initialize bi_rw in mpage so bio_add can make use of it Muthu Kumar
2011-07-11 17:49 ` Jens Axboe
2011-07-11 17:52   ` Muthu Kumar
2011-07-11 17:59     ` Jens Axboe
2011-07-18 18:54       ` Muthu Kumar
2011-07-18 19:13         ` Muthu Kumar
2011-07-25 17:22           ` Muthu Kumar
2011-07-26 13:20             ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.