Commit 206f7ab4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Theodore Ts'o

ext4: remove vestiges of nobh support

The nobh option was only supported for writeback mode, but given that all
write paths actually create buffer heads it effectively was a no-op already.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 5a0790c2
...@@ -873,7 +873,6 @@ struct ext4_inode_info { ...@@ -873,7 +873,6 @@ struct ext4_inode_info {
#define EXT4_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */ #define EXT4_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */
#define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000 /* No auto delalloc mapping */ #define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000 /* No auto delalloc mapping */
#define EXT4_MOUNT_BARRIER 0x20000 /* Use block barriers */ #define EXT4_MOUNT_BARRIER 0x20000 /* Use block barriers */
#define EXT4_MOUNT_NOBH 0x40000 /* No bufferheads */
#define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
......
...@@ -313,17 +313,15 @@ static inline int ext4_should_writeback_data(struct inode *inode) ...@@ -313,17 +313,15 @@ static inline int ext4_should_writeback_data(struct inode *inode)
* This function controls whether or not we should try to go down the * This function controls whether or not we should try to go down the
* dioread_nolock code paths, which makes it safe to avoid taking * dioread_nolock code paths, which makes it safe to avoid taking
* i_mutex for direct I/O reads. This only works for extent-based * i_mutex for direct I/O reads. This only works for extent-based
* files, and it doesn't work for nobh or if data journaling is * files, and it doesn't work if data journaling is enabled, since the
* enabled, since the dioread_nolock code uses b_private to pass * dioread_nolock code uses b_private to pass information back to the
* information back to the I/O completion handler, and this conflicts * I/O completion handler, and this conflicts with the jbd's use of
* with the jbd's use of b_private. * b_private.
*/ */
static inline int ext4_should_dioread_nolock(struct inode *inode) static inline int ext4_should_dioread_nolock(struct inode *inode)
{ {
if (!test_opt(inode->i_sb, DIOREAD_NOLOCK)) if (!test_opt(inode->i_sb, DIOREAD_NOLOCK))
return 0; return 0;
if (test_opt(inode->i_sb, NOBH))
return 0;
if (!S_ISREG(inode->i_mode)) if (!S_ISREG(inode->i_mode))
return 0; return 0;
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
......
...@@ -2553,18 +2553,16 @@ static int ext4_da_get_block_prep(struct inode *inode, sector_t iblock, ...@@ -2553,18 +2553,16 @@ 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 * 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 * when there is no desire to allocate any blocks. It is used as a
* callback function for block_prepare_write(), nobh_writepage(), and * callback function for block_prepare_write() and block_write_full_page().
* block_write_full_page(). These functions should only try to map a * These functions should only try to map a single block at a time.
* single block at a time.
* *
* Since this function doesn't do block allocations even if the caller * Since this function doesn't do block allocations even if the caller
* requests it by passing in create=1, it is critically important that * requests it by passing in create=1, it is critically important that
* any caller checks to make sure that any buffer heads are returned * any caller checks to make sure that any buffer heads are returned
* by this function are either all already mapped or marked for * by this function are either all already mapped or marked for
* delayed allocation before calling nobh_writepage() or * delayed allocation before calling block_write_full_page(). Otherwise,
* block_write_full_page(). Otherwise, b_blocknr could be left * b_blocknr could be left unitialized, and the page write functions will
* unitialized, and the page write functions will be taken by * be taken by surprise.
* surprise.
*/ */
static int noalloc_get_block_write(struct inode *inode, sector_t iblock, static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create) struct buffer_head *bh_result, int create)
...@@ -2749,9 +2747,7 @@ static int ext4_writepage(struct page *page, ...@@ -2749,9 +2747,7 @@ static int ext4_writepage(struct page *page,
return __ext4_journalled_writepage(page, len); return __ext4_journalled_writepage(page, len);
} }
if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) if (page_bufs && buffer_uninit(page_bufs)) {
ret = nobh_writepage(page, noalloc_get_block_write, wbc);
else if (page_bufs && buffer_uninit(page_bufs)) {
ext4_set_bh_endio(page_bufs, inode); ext4_set_bh_endio(page_bufs, inode);
ret = block_write_full_page_endio(page, noalloc_get_block_write, ret = block_write_full_page_endio(page, noalloc_get_block_write,
wbc, ext4_end_io_buffer_write); wbc, ext4_end_io_buffer_write);
...@@ -4125,17 +4121,6 @@ int ext4_block_truncate_page(handle_t *handle, ...@@ -4125,17 +4121,6 @@ int ext4_block_truncate_page(handle_t *handle,
length = blocksize - (offset & (blocksize - 1)); length = blocksize - (offset & (blocksize - 1));
iblock = index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits); 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)) if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0); create_empty_buffers(page, blocksize, 0);
......
...@@ -946,8 +946,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) ...@@ -946,8 +946,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
seq_puts(seq, ",journal_async_commit"); seq_puts(seq, ",journal_async_commit");
else if (test_opt(sb, JOURNAL_CHECKSUM)) else if (test_opt(sb, JOURNAL_CHECKSUM))
seq_puts(seq, ",journal_checksum"); seq_puts(seq, ",journal_checksum");
if (test_opt(sb, NOBH))
seq_puts(seq, ",nobh");
if (test_opt(sb, I_VERSION)) if (test_opt(sb, I_VERSION))
seq_puts(seq, ",i_version"); seq_puts(seq, ",i_version");
if (!test_opt(sb, DELALLOC)) if (!test_opt(sb, DELALLOC))
...@@ -1624,10 +1622,12 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1624,10 +1622,12 @@ static int parse_options(char *options, struct super_block *sb,
*n_blocks_count = option; *n_blocks_count = option;
break; break;
case Opt_nobh: case Opt_nobh:
set_opt(sbi->s_mount_opt, NOBH); ext4_msg(sb, KERN_WARNING,
"Ignoring deprecated nobh option");
break; break;
case Opt_bh: case Opt_bh:
clear_opt(sbi->s_mount_opt, NOBH); ext4_msg(sb, KERN_WARNING,
"Ignoring deprecated bh option");
break; break;
case Opt_i_version: case Opt_i_version:
set_opt(sbi->s_mount_opt, I_VERSION); set_opt(sbi->s_mount_opt, I_VERSION);
...@@ -2912,18 +2912,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -2912,18 +2912,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
ext4_msg(sb, KERN_ERR, "insufficient memory"); ext4_msg(sb, KERN_ERR, "insufficient memory");
goto failed_mount_wq; goto failed_mount_wq;
} }
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);
}
if (test_opt(sb, DIOREAD_NOLOCK)) {
ext4_msg(sb, KERN_WARNING, "dioread_nolock option is "
"not supported with nobh mode");
goto failed_mount_wq;
}
}
EXT4_SB(sb)->dio_unwritten_wq = create_workqueue("ext4-dio-unwritten"); EXT4_SB(sb)->dio_unwritten_wq = create_workqueue("ext4-dio-unwritten");
if (!EXT4_SB(sb)->dio_unwritten_wq) { if (!EXT4_SB(sb)->dio_unwritten_wq) {
printk(KERN_ERR "EXT4-fs: failed to create DIO workqueue\n"); printk(KERN_ERR "EXT4-fs: failed to create DIO workqueue\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment