From: "Darrick J. Wong" <djwong@us.ibm.com>
To: Tejun Heo <tj@kernel.org>, Vivek Goyal <vgoyal@redhat.com>,
axboe@kernel.dk, tytso@mit.edu, shli@kernel.org, neilb@suse.de,
adilger.kernel@dilger.ca, jack@suse.cz, snitzer@redhat.com,
linux-kernel@vger.kernel.org, kmannth@us.ibm.com, cmm@us.ibm.com,
linux-ext4@vger.kernel.org, rwheeler@redhat.com, hch@lst.de,
josef@redhat.com, Mark Fasheh <mfasheh@suse.com>,
Joel Becker <jlbec@evilplan.org>,
ocfs2-devel@oss.oracle.com
Subject: [PATCH 2/3] jbd2: Remove barrier feature conditional flag (or: always issue flushes)
Date: Tue, 25 Jan 2011 23:18:33 -0800 [thread overview]
Message-ID: <20110126071833.GJ27190@tux1.beaverton.ibm.com> (raw)
In-Reply-To: <20110126071200.GE32261@tux1.beaverton.ibm.com>
As part of migrating the FLUSH/FUA knob to the block layer, remove the journal
flags and various conditionals in jbd2 that surround flush issue calls in favor
of always issuing the flush. The block layer will handle gracefully the
situation where a FLUSH or FUA request is issued to a device that doesn't
support it.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
---
fs/ext4/fsync.c | 5 ++---
fs/ext4/super.c | 7 -------
fs/jbd2/checkpoint.c | 3 +--
fs/jbd2/commit.c | 10 +++-------
fs/ocfs2/journal.c | 4 ----
include/linux/jbd2.h | 1 -
6 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 7829b28..8c99359 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -208,12 +208,11 @@ int ext4_sync_file(struct file *file, int datasync)
* the journal device.)
*/
if (ext4_should_writeback_data(inode) &&
- (journal->j_fs_dev != journal->j_dev) &&
- (journal->j_flags & JBD2_BARRIER))
+ (journal->j_fs_dev != journal->j_dev))
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL,
NULL);
ret = jbd2_log_wait_commit(journal, commit_tid);
- } else if (journal->j_flags & JBD2_BARRIER)
+ } else
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
return ret;
}
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 48ce561..7379829 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3704,10 +3704,6 @@ static void ext4_init_journal_params(struct super_block *sb, journal_t *journal)
journal->j_max_batch_time = sbi->s_max_batch_time;
write_lock(&journal->j_state_lock);
- if (test_opt(sb, BARRIER))
- journal->j_flags |= JBD2_BARRIER;
- else
- journal->j_flags &= ~JBD2_BARRIER;
if (test_opt(sb, DATA_ERR_ABORT))
journal->j_flags |= JBD2_ABORT_ON_SYNCDATA_ERR;
else
@@ -3899,9 +3895,6 @@ static int ext4_load_journal(struct super_block *sb,
return -EINVAL;
}
- if (!(journal->j_flags & JBD2_BARRIER))
- ext4_msg(sb, KERN_INFO, "barriers disabled");
-
if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) {
err = jbd2_journal_update_format(journal);
if (err) {
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 6a79fd0..02eb6b9 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -540,8 +540,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal)
* correctness. Fortunately jbd2_cleanup_journal_tail()
* doesn't get called all that often.
*/
- if ((journal->j_fs_dev != journal->j_dev) &&
- (journal->j_flags & JBD2_BARRIER))
+ if (journal->j_fs_dev != journal->j_dev)
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
if (!(journal->j_flags & JBD2_ABORT))
jbd2_journal_update_superblock(journal, 1);
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index f3ad159..e90ec0d 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -134,8 +134,7 @@ static int journal_submit_commit_record(journal_t *journal,
set_buffer_uptodate(bh);
bh->b_end_io = journal_end_buffer_io_sync;
- if (journal->j_flags & JBD2_BARRIER &&
- !JBD2_HAS_INCOMPAT_FEATURE(journal,
+ if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT))
ret = submit_bh(WRITE_SYNC_PLUG | WRITE_FLUSH_FUA, bh);
else
@@ -686,8 +685,7 @@ start_journal_io:
* the commit record
*/
if (commit_transaction->t_flushed_data_blocks &&
- (journal->j_fs_dev != journal->j_dev) &&
- (journal->j_flags & JBD2_BARRIER))
+ (journal->j_fs_dev != journal->j_dev))
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
/* Done it all: now write the commit record asynchronously. */
@@ -811,10 +809,8 @@ wait_for_iobuf:
if (!err && !is_journal_aborted(journal))
err = journal_wait_on_commit_record(journal, cbh);
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
- JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
- journal->j_flags & JBD2_BARRIER) {
+ JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT))
blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
- }
if (err)
jbd2_journal_abort(journal, err);
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index faa2303..caacabe 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -758,10 +758,6 @@ void ocfs2_set_journal_params(struct ocfs2_super *osb)
write_lock(&journal->j_state_lock);
journal->j_commit_interval = commit_interval;
- if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER)
- journal->j_flags |= JBD2_BARRIER;
- else
- journal->j_flags &= ~JBD2_BARRIER;
write_unlock(&journal->j_state_lock);
}
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 27e79c2..2c420ce 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -987,7 +987,6 @@ struct journal_s
#define JBD2_ACK_ERR 0x004 /* The errno in the sb has been acked */
#define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */
#define JBD2_LOADED 0x010 /* The journal superblock has been loaded */
-#define JBD2_BARRIER 0x020 /* Use IDE barriers */
#define JBD2_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file
* data write error in ordered
* mode */
next prev parent reply other threads:[~2011-01-26 7:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-26 7:12 [PATCHSET] Refactor barrier=/nobarrier flags from fs to block layer Darrick J. Wong
2011-01-26 7:16 ` [PATCH 1/3] block: Create sysfs knobs to override FLUSH/FUA support flags Darrick J. Wong
2011-01-26 9:30 ` Tejun Heo
2011-01-26 17:00 ` Darrick J. Wong
2011-02-05 16:20 ` Greg KH
2011-01-26 7:18 ` Darrick J. Wong [this message]
2011-01-26 7:23 ` [PATCH 3/3] ext4: Deprecate barrier= and nobarrier mount options Darrick J. Wong
2011-01-26 9:36 ` Tejun Heo
2011-01-26 10:47 ` Jan Kara
2011-01-26 10:51 ` Tejun Heo
2011-01-26 12:16 ` Ric Wheeler
2011-01-26 12:21 ` Tejun Heo
2011-01-26 13:29 ` torn5
2011-01-26 11:47 ` [PATCHSET] Refactor barrier=/nobarrier flags from fs to block layer Ric Wheeler
2011-01-26 11:49 ` Ric Wheeler
2011-01-26 16:41 ` Eric Sandeen
2011-01-26 17:24 ` Darrick J. Wong
2011-01-28 11:16 ` Dave Chinner
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=20110126071833.GJ27190@tux1.beaverton.ibm.com \
--to=djwong@us.ibm.com \
--cc=adilger.kernel@dilger.ca \
--cc=axboe@kernel.dk \
--cc=cmm@us.ibm.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=jlbec@evilplan.org \
--cc=josef@redhat.com \
--cc=kmannth@us.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=neilb@suse.de \
--cc=ocfs2-devel@oss.oracle.com \
--cc=rwheeler@redhat.com \
--cc=shli@kernel.org \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
--cc=tytso@mit.edu \
--cc=vgoyal@redhat.com \
/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
all inboxes | Powered by JetHome®