diff options
author | Christoph Hellwig <hch@lst.de> | 2010-06-14 14:42:49 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-06-14 14:42:49 -0400 |
commit | 206f7ab4f49a2021fcb8687f25395be77711ddee (patch) | |
tree | 19764d36a25ec1e088d32572a1c0936eeaf19636 /fs/ext4/inode.c | |
parent | 5a0790c2c4a18435759a70e1562450035d778339 (diff) |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 15ff8d8d839b..b485987f0146 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2553,18 +2553,16 @@ static int ext4_da_get_block_prep(struct inode *inode, sector_t iblock, | |||
2553 | /* | 2553 | /* |
2554 | * This function is used as a standard get_block_t calback function | 2554 | * This function is used as a standard get_block_t calback function |
2555 | * when there is no desire to allocate any blocks. It is used as a | 2555 | * when there is no desire to allocate any blocks. It is used as a |
2556 | * callback function for block_prepare_write(), nobh_writepage(), and | 2556 | * callback function for block_prepare_write() and block_write_full_page(). |
2557 | * block_write_full_page(). These functions should only try to map a | 2557 | * These functions should only try to map a single block at a time. |
2558 | * single block at a time. | ||
2559 | * | 2558 | * |
2560 | * Since this function doesn't do block allocations even if the caller | 2559 | * Since this function doesn't do block allocations even if the caller |
2561 | * requests it by passing in create=1, it is critically important that | 2560 | * requests it by passing in create=1, it is critically important that |
2562 | * any caller checks to make sure that any buffer heads are returned | 2561 | * any caller checks to make sure that any buffer heads are returned |
2563 | * by this function are either all already mapped or marked for | 2562 | * by this function are either all already mapped or marked for |
2564 | * delayed allocation before calling nobh_writepage() or | 2563 | * delayed allocation before calling block_write_full_page(). Otherwise, |
2565 | * block_write_full_page(). Otherwise, b_blocknr could be left | 2564 | * b_blocknr could be left unitialized, and the page write functions will |
2566 | * unitialized, and the page write functions will be taken by | 2565 | * be taken by surprise. |
2567 | * surprise. | ||
2568 | */ | 2566 | */ |
2569 | static int noalloc_get_block_write(struct inode *inode, sector_t iblock, | 2567 | static int noalloc_get_block_write(struct inode *inode, sector_t iblock, |
2570 | struct buffer_head *bh_result, int create) | 2568 | struct buffer_head *bh_result, int create) |
@@ -2749,9 +2747,7 @@ static int ext4_writepage(struct page *page, | |||
2749 | return __ext4_journalled_writepage(page, len); | 2747 | return __ext4_journalled_writepage(page, len); |
2750 | } | 2748 | } |
2751 | 2749 | ||
2752 | if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) | 2750 | if (page_bufs && buffer_uninit(page_bufs)) { |
2753 | ret = nobh_writepage(page, noalloc_get_block_write, wbc); | ||
2754 | else if (page_bufs && buffer_uninit(page_bufs)) { | ||
2755 | ext4_set_bh_endio(page_bufs, inode); | 2751 | ext4_set_bh_endio(page_bufs, inode); |
2756 | ret = block_write_full_page_endio(page, noalloc_get_block_write, | 2752 | ret = block_write_full_page_endio(page, noalloc_get_block_write, |
2757 | wbc, ext4_end_io_buffer_write); | 2753 | wbc, ext4_end_io_buffer_write); |
@@ -4125,17 +4121,6 @@ int ext4_block_truncate_page(handle_t *handle, | |||
4125 | length = blocksize - (offset & (blocksize - 1)); | 4121 | length = blocksize - (offset & (blocksize - 1)); |
4126 | iblock = index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits); | 4122 | iblock = index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits); |
4127 | 4123 | ||
4128 | /* | ||
4129 | * For "nobh" option, we can only work if we don't need to | ||
4130 | * read-in the page - otherwise we create buffers to do the IO. | ||
4131 | */ | ||
4132 | if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) && | ||
4133 | ext4_should_writeback_data(inode) && PageUptodate(page)) { | ||
4134 | zero_user(page, offset, length); | ||
4135 | set_page_dirty(page); | ||
4136 | goto unlock; | ||
4137 | } | ||
4138 | |||
4139 | if (!page_has_buffers(page)) | 4124 | if (!page_has_buffers(page)) |
4140 | create_empty_buffers(page, blocksize, 0); | 4125 | create_empty_buffers(page, blocksize, 0); |
4141 | 4126 | ||