[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <962e0fd9683e2d523cadf8036769dfbaf3b21e77.1421052656.git.dongsu.park@profitbricks.com>
Date: Mon, 12 Jan 2015 12:44:03 +0100
From: Dongsu Park <dongsu.park@...fitbricks.com>
To: linux-kernel@...r.kernel.org
Cc: Christoph Hellwig <hch@...radead.org>,
Kent Overstreet <kmo@...erainc.com>,
Jens Axboe <axboe@...nel.dk>,
Al Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Dongsu Park <dongsu.park@...fitbricks.com>
Subject: [PATCH v2 6/7] fs: make _submit_bh consistent with generic bio chaining
From: Kent Overstreet <kmo@...erainc.com>
Make _submit_bh() handle refcounting by increasing bio->bi_remaining,
followed by bio_endio(). Since bio chaining was introduced with
196d38bccfcf ("block: Generic bio chaining"), refcounting should be
done on bi_remaining instead of ancient bio_cnt. Doing that, calling
convention can be consistent with the immutable biovecs API.
Cc: Christoph Hellwig <hch@...radead.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel@...r.kernel.org
Signed-off-by: Kent Overstreet <kmo@...erainc.com>
[dpark: add more description in commit message]
Signed-off-by: Dongsu Park <dongsu.park@...fitbricks.com>
---
fs/buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 20805db..dbe5699 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3041,13 +3041,13 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
if (buffer_prio(bh))
rw |= REQ_PRIO;
- bio_get(bio);
+ atomic_inc(&bio->bi_remaining);
submit_bio(rw, bio);
if (bio_flagged(bio, BIO_EOPNOTSUPP))
ret = -EOPNOTSUPP;
- bio_put(bio);
+ bio_endio(bio, 0);
return ret;
}
EXPORT_SYMBOL_GPL(_submit_bh);
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists