From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-ext4@vger.kernel.org, linux-mm@kvack.org, npiggin@suse.de,
Jan Kara <jack@suse.cz>
Subject: [PATCH 3/7] ext4: Deprecate nobh mount option
Date: Thu, 17 Sep 2009 17:21:43 +0200 [thread overview]
Message-ID: <1253200907-31392-4-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1253200907-31392-1-git-send-email-jack@suse.cz>
This option doesn't do anything interesting for ext4 anymore since we attach
buffers to the page in page_mkwrite and in write_begin to support delayed
allocation and properly handle ENOSPC caused by mmaped writes.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/inode.c | 42 ++++++++++++------------------------------
fs/ext4/super.c | 10 +++-------
2 files changed, 15 insertions(+), 37 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index f9c642b..58492ab 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2481,20 +2481,17 @@ static int ext4_da_get_block_prep(struct inode *inode, sector_t iblock,
}
/*
- * This function is used as a standard get_block_t calback function
- * when there is no desire to allocate any blocks. It is used as a
- * callback function for block_prepare_write(), nobh_writepage(), and
- * block_write_full_page(). These functions should only try to map a
- * single block at a time.
+ * This function is used as a standard get_block_t calback function when there
+ * is no desire to allocate any blocks. It is used as a callback function for
+ * block_prepare_write() and block_write_full_page(). These functions should
+ * only try to map a single block at a time.
*
- * Since this function doesn't do block allocations even if the caller
- * requests it by passing in create=1, it is critically important that
- * any caller checks to make sure that any buffer heads are returned
- * by this function are either all already mapped or marked for
- * delayed allocation before calling nobh_writepage() or
- * block_write_full_page(). Otherwise, b_blocknr could be left
- * unitialized, and the page write functions will be taken by
- * surprise.
+ * Since this function doesn't do block allocations even if the caller requests
+ * it by passing in create=1, it is critically important that any caller checks
+ * to make sure that any buffer heads are returned by this function are either
+ * all already mapped or marked for delayed allocation before calling
+ * block_write_full_page(). Otherwise, b_blocknr could be left unitialized,
+ * and the page write functions will be taken by surprise.
*/
static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
@@ -2690,11 +2687,7 @@ static int ext4_writepage(struct page *page,
return __ext4_journalled_writepage(page, wbc, len);
}
- if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode))
- ret = nobh_writepage(page, noalloc_get_block_write, wbc);
- else
- ret = block_write_full_page(page, noalloc_get_block_write,
- wbc);
+ ret = block_write_full_page(page, noalloc_get_block_write, wbc);
return ret;
}
@@ -3463,17 +3456,6 @@ int ext4_block_truncate_page(handle_t *handle,
length = blocksize - (offset & (blocksize - 1));
iblock = index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
- /*
- * For "nobh" option, we can only work if we don't need to
- * read-in the page - otherwise we create buffers to do the IO.
- */
- if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
- ext4_should_writeback_data(inode) && PageUptodate(page)) {
- zero_user(page, offset, length);
- set_page_dirty(page);
- goto unlock;
- }
-
if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8f4f079..160051f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -846,8 +846,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0");
if (test_opt(sb, JOURNAL_ASYNC_COMMIT))
seq_puts(seq, ",journal_async_commit");
- if (test_opt(sb, NOBH))
- seq_puts(seq, ",nobh");
if (test_opt(sb, I_VERSION))
seq_puts(seq, ",i_version");
if (!test_opt(sb, DELALLOC))
@@ -2775,11 +2773,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
no_journal:
if (test_opt(sb, NOBH)) {
- if (!(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)) {
- ext4_msg(sb, KERN_WARNING, "Ignoring nobh option - "
- "its supported only with writeback mode");
- clear_opt(sbi->s_mount_opt, NOBH);
- }
+ ext4_msg(sb, KERN_WARNING, "nobh option is deprecated. "
+ "Ignoring it.");
+ clear_opt(sbi->s_mount_opt, NOBH);
}
/*
* The jbd2_journal_load will have done any necessary log recovery,
--
1.6.0.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-09-17 15:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 15:21 [RFC] [PATCH 0/7] Improve VFS to handle better mmaps when blocksize < pagesize (v3) Jan Kara
2009-09-17 15:21 ` [PATCH 1/7] fs: buffer_head writepage no invalidate Jan Kara
2009-09-17 15:21 ` [PATCH 2/7] fs: Remove zeroing from nobh_writepage Jan Kara
2009-09-17 15:21 ` Jan Kara [this message]
2009-09-17 15:21 ` [PATCH 4/7] vfs: Add better VFS support for page_mkwrite when blocksize < pagesize Jan Kara
2009-09-17 15:21 ` [PATCH 5/7] ext4: Convert filesystem to the new truncate calling convention Jan Kara
2009-09-22 14:36 ` Al Viro
2009-09-22 17:16 ` Jan Kara
2009-09-22 17:23 ` Al Viro
2009-09-22 17:37 ` Jan Kara
2009-09-17 15:21 ` [PATCH 6/7] ext4: Convert ext4 to new mkwrite code Jan Kara
2009-09-17 15:21 ` [PATCH 7/7] ext2: Convert ext2 " Jan Kara
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=1253200907-31392-4-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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).