aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-06-04 13:19:34 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-06-04 13:19:34 -0400
commit3613d22807a2616e9346800bacd88aa8bbbefcd7 (patch)
treea7e83b6ad87e3f4f9f9d271a1d253d9f9189b541 /fs/ext4
parent4e7ea81db53465ddd753678bc4cebf95369d0984 (diff)
ext4: remove buffer_uninit handling
There isn't any need for setting BH_Uninit on buffers anymore. It was only used to signal we need to mark io_end as needing extent conversion in add_bh_to_extent() but now we can mark the io_end directly when mapping extent. Reviewed-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ext4.h15
-rw-r--r--fs/ext4/inode.c4
-rw-r--r--fs/ext4/page-io.c4
3 files changed, 8 insertions, 15 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 90a164f365c4..0a9b729f991b 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2653,20 +2653,17 @@ extern void ext4_mmp_csum_set(struct super_block *sb, struct mmp_struct *mmp);
2653extern int ext4_mmp_csum_verify(struct super_block *sb, 2653extern int ext4_mmp_csum_verify(struct super_block *sb,
2654 struct mmp_struct *mmp); 2654 struct mmp_struct *mmp);
2655 2655
2656/* BH_Uninit flag: blocks are allocated but uninitialized on disk */ 2656/*
2657 * Note that these flags will never ever appear in a buffer_head's state flag.
2658 * See EXT4_MAP_... to see where this is used.
2659 */
2657enum ext4_state_bits { 2660enum ext4_state_bits {
2658 BH_Uninit /* blocks are allocated but uninitialized on disk */ 2661 BH_Uninit /* blocks are allocated but uninitialized on disk */
2659 = BH_JBDPrivateStart, 2662 = BH_JBDPrivateStart,
2660 BH_AllocFromCluster, /* allocated blocks were part of already 2663 BH_AllocFromCluster, /* allocated blocks were part of already
2661 * allocated cluster. Note that this flag will 2664 * allocated cluster. */
2662 * never, ever appear in a buffer_head's state
2663 * flag. See EXT4_MAP_FROM_CLUSTER to see where
2664 * this is used. */
2665}; 2665};
2666 2666
2667BUFFER_FNS(Uninit, uninit)
2668TAS_BUFFER_FNS(Uninit, uninit)
2669
2670/* 2667/*
2671 * Add new method to test whether block and inode bitmaps are properly 2668 * Add new method to test whether block and inode bitmaps are properly
2672 * initialized. With uninit_bg reading the block from disk is not enough 2669 * initialized. With uninit_bg reading the block from disk is not enough
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5939a4742def..736d164dc2ba 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2047,8 +2047,6 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
2047 clear_buffer_delay(bh); 2047 clear_buffer_delay(bh);
2048 bh->b_blocknr = pblock++; 2048 bh->b_blocknr = pblock++;
2049 } 2049 }
2050 if (mpd->map.m_flags & EXT4_MAP_UNINIT)
2051 set_buffer_uninit(bh);
2052 clear_buffer_unwritten(bh); 2050 clear_buffer_unwritten(bh);
2053 } while (++lblk < blocks && 2051 } while (++lblk < blocks &&
2054 (bh = bh->b_this_page) != head); 2052 (bh = bh->b_this_page) != head);
@@ -2110,6 +2108,8 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
2110 err = ext4_map_blocks(handle, inode, map, get_blocks_flags); 2108 err = ext4_map_blocks(handle, inode, map, get_blocks_flags);
2111 if (err < 0) 2109 if (err < 0)
2112 return err; 2110 return err;
2111 if (map->m_flags & EXT4_MAP_UNINIT)
2112 ext4_set_io_unwritten_flag(inode, mpd->io_submit.io_end);
2113 2113
2114 BUG_ON(map->m_len == 0); 2114 BUG_ON(map->m_len == 0);
2115 if (map->m_flags & EXT4_MAP_NEW) { 2115 if (map->m_flags & EXT4_MAP_NEW) {
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 3e5854625126..de6860c7836e 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -369,7 +369,6 @@ static int io_submit_add_bh(struct ext4_io_submit *io,
369 struct inode *inode, 369 struct inode *inode,
370 struct buffer_head *bh) 370 struct buffer_head *bh)
371{ 371{
372 ext4_io_end_t *io_end;
373 int ret; 372 int ret;
374 373
375 if (io->io_bio && bh->b_blocknr != io->io_next_block) { 374 if (io->io_bio && bh->b_blocknr != io->io_next_block) {
@@ -384,9 +383,6 @@ submit_and_retry:
384 ret = bio_add_page(io->io_bio, bh->b_page, bh->b_size, bh_offset(bh)); 383 ret = bio_add_page(io->io_bio, bh->b_page, bh->b_size, bh_offset(bh));
385 if (ret != bh->b_size) 384 if (ret != bh->b_size)
386 goto submit_and_retry; 385 goto submit_and_retry;
387 io_end = io->io_end;
388 if (test_clear_buffer_uninit(bh))
389 ext4_set_io_unwritten_flag(inode, io_end);
390 io->io_next_block++; 386 io->io_next_block++;
391 return 0; 387 return 0;
392} 388}