xfs
[Top] [All Lists]

[PATCH 1/8] block/blk-lib.c: Evalue bio->bi_rw after calling bio_alloc()

To: axboe <axboe@xxxxxxxxx>, "konrad.wilk" <konrad.wilk@xxxxxxxxxx>, "chris.mason" <chris.mason@xxxxxxxxxxxx>, viro <viro@xxxxxxxxxxxxxxxxxx>, tytso <tytso@xxxxxxx>, "adilger.kernel" <adilger.kernel@xxxxxxxxx>, shaggy <shaggy@xxxxxxxxxx>, mfasheh <mfasheh@xxxxxxxx>, jlbec <jlbec@xxxxxxxxxxxx>, bpm <bpm@xxxxxxx>, elder <elder@xxxxxxxxxx>
Subject: [PATCH 1/8] block/blk-lib.c: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page().
From: majianpeng <majianpeng@xxxxxxxxx>
Date: Mon, 30 Jul 2012 15:23:29 +0800
Cc: linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-btrfs <linux-btrfs@xxxxxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, linux-ext4 <linux-ext4@xxxxxxxxxxxxxxx>, jfs-discussion <jfs-discussion@xxxxxxxxxxxxxxxxxxxxx>, xfs <xfs@xxxxxxxxxxx>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:x-priority:x-has-attach:x-mailer :mime-version:message-id:content-type:content-transfer-encoding; bh=YxqawhJzBitPnxBsY/vZMLG+W3V1PpVwx99kDG9ogjY=; b=y3998iMLEkbvUZqgMXGCG5gqtLAvXtG/9nd9E8l6o02F9rpW+S+O2Pq0/bK9iaiIZl WW2pG/mD3nQPEoZOmhFDbDcZC5x8rtNMIuqSMqc8XvYrzLw/niJPjEELseteZ6LpJ7h+ KSYUvgVV+kk1LnUu3coWiDZ2LArBTXcSf6RGextMhiqUJLq9SVszBMnk7ROYFkJya3rH N4gTm4Ia37ULY1wnIG6/tLgu0pm/i3lz7+vdBh0PwlziWny1YTVDrrH4PsWKYyhcNtYx E4RqFzL4typ5UNLTzts4h8dSY072hn+XSUmgNLGLVLnDF1yQxa4VheSl1Mb5eD1grb1O hkcA==
Because call bio_alloc, the bi_rw is zero by default,but in bio_add_page
used the bi_rw. So evalue bi_rw.

Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
 block/blk-lib.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 2b461b4..fac777b 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -151,6 +151,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, 
sector_t sector,
                bio->bi_bdev   = bdev;
                bio->bi_end_io = bio_batch_end_io;
                bio->bi_private = &bb;
+               bio->bi_rw = WRITE;
 
                while (nr_sects != 0) {
                        sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects);
-- 
1.7.9.5
<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 1/8] block/blk-lib.c: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page()., majianpeng <=