From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
lizefan@huawei.com, cgroups@vger.kernel.org, tytso@mit.edu,
adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc
Date: Fri, 12 Jun 2015 17:02:22 -0500 [thread overview]
Message-ID: <1434146543-26358-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1434146543-26358-1-git-send-email-tj@kernel.org>
ext4_io_submit_init() takes the pointer to writeback_control to test
its sync_mode and determine between WRITE and WRITE_SYNC and records
the result in ->io_op. This patch makes it record the pointer
directly and moves the test to ext4_io_submit().
This doesn't cause any noticeable differences now but having
writeback_control available throughout IO submission path will be
depended upon by the planned cgroup writeback support.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
fs/ext4/ext4.h | 2 +-
fs/ext4/page-io.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 009a059..74a4923 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -191,7 +191,7 @@ typedef struct ext4_io_end {
} ext4_io_end_t;
struct ext4_io_submit {
- int io_op;
+ struct writeback_control *io_wbc;
struct bio *io_bio;
ext4_io_end_t *io_end;
sector_t io_next_block;
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index c5d81e8..3f80cb2 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -357,8 +357,10 @@ void ext4_io_submit(struct ext4_io_submit *io)
struct bio *bio = io->io_bio;
if (bio) {
+ int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
+ WRITE_SYNC : WRITE;
bio_get(io->io_bio);
- submit_bio(io->io_op, io->io_bio);
+ submit_bio(io_op, io->io_bio);
bio_put(io->io_bio);
}
io->io_bio = NULL;
@@ -367,7 +369,7 @@ void ext4_io_submit(struct ext4_io_submit *io)
void ext4_io_submit_init(struct ext4_io_submit *io,
struct writeback_control *wbc)
{
- io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
+ io->io_wbc = wbc;
io->io_bio = NULL;
io->io_end = NULL;
}
--
2.4.2
next prev parent reply other threads:[~2015-06-12 22:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 22:02 [PATCHSET block/for-4.2/writeback] ext4: implement cgroup writeback support Tejun Heo
2015-06-12 22:02 ` Tejun Heo [this message]
2015-06-12 22:02 ` [PATCH 2/2] " Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2015-06-16 22:53 [PATCHSET v2 block/for-4.2/writeback] " Tejun Heo
2015-06-16 22:53 ` [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc Tejun Heo
[not found] ` <1434495193-31182-2-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-07-22 3:56 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434146543-26358-2-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=adilger.kernel@dilger.ca \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).