xfs
[Top] [All Lists]

[PATCH 8/8]fs/xfs: Evalue bio->bi_rw after calling bio_alloc() and befor

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 8/8]fs/xfs: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page().
From: majianpeng <majianpeng@xxxxxxxxx>
Date: Mon, 30 Jul 2012 15:24:52 +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=JvV3idXoX4idUjLZ4+QhLZ0uk5fIXr+xNAAamRQHKus=; b=RBLTanJNZ//9eOrprYPrWsBMcYME5QHhjGfV1hbw2G7E+2c+/FCoT58TnCESJoUlw9 4azMTGd5kPOI99godEEEYIXFycqxX7SsWt7FR9mAxC9ffqU3Amv0PB3EZZEaQ85krJCN MzksjTtz8+Ox0MbI48dRMaKAQpYF6moxINwQlNHgo2GC5lyIbrdfqTr9QmCXuD+PLiYj hA668R9mSn9nTknGmyND92D8QMnUuyOAQsaieEWMw+uCAYixyDhEzqlPz8WbZzTWb+xX Z7Lh9g0IWvE1JyDOyoFdyh+mMDZ4rvCub0CG26EfDxBoKrKWxiNzvUiLM3sUhhooLZ48 86lQ==
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>
---
 fs/xfs/xfs_aops.c |    2 ++
 fs/xfs/xfs_buf.c  |    1 +
 2 files changed, 3 insertions(+)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 8dad722..f69f4b2 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -496,6 +496,8 @@ xfs_submit_ioend(
                        if (!bio) {
  retry:
                                bio = xfs_alloc_ioend_bio(bh);
+                               bio->bi_rw = (wbc->sync_mode == WB_SYNC_ALL
+                                               ? WRITE_SYNC : WRITE);
                        } else if (bh->b_blocknr != lastblock + 1) {
                                xfs_submit_ioend_bio(wbc, ioend, bio);
                                goto retry;
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 269b35c..744ec64 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1186,6 +1186,7 @@ next_chunk:
        bio->bi_sector = sector;
        bio->bi_end_io = xfs_buf_bio_end_io;
        bio->bi_private = bp;
+       bio->bi_rw = rw;
 
 
        for (; size && nr_pages; nr_pages--, map_i++) {
-- 
1.7.9.5
<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 8/8]fs/xfs: Evalue bio->bi_rw after calling bio_alloc() and before calling bio_add_page()., majianpeng <=