aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2010-06-14 13:28:03 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-06-14 13:28:03 -0400
commit5a0790c2c4a18435759a70e1562450035d778339 (patch)
tree80acb12d0e37196cf60ae4ca150c6b556115f302 /fs/ext4
parent07a038245b28df9196ffb2e8cc626e9b956a4e23 (diff)
ext4: remove initialized but not read variables
No real bugs found, just removed some dead code. Found by gcc 4.6's new warnings. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c8
-rw-r--r--fs/ext4/inode.c5
-rw-r--r--fs/ext4/mballoc.c21
-rw-r--r--fs/ext4/namei.c2
-rw-r--r--fs/ext4/resize.c2
5 files changed, 8 insertions, 30 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 377309c1af65..346de3daab79 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1083,7 +1083,6 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
1083{ 1083{
1084 struct ext4_ext_path *curp = path; 1084 struct ext4_ext_path *curp = path;
1085 struct ext4_extent_header *neh; 1085 struct ext4_extent_header *neh;
1086 struct ext4_extent_idx *fidx;
1087 struct buffer_head *bh; 1086 struct buffer_head *bh;
1088 ext4_fsblk_t newblock; 1087 ext4_fsblk_t newblock;
1089 int err = 0; 1088 int err = 0;
@@ -1144,10 +1143,10 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
1144 ext4_idx_store_pblock(curp->p_idx, newblock); 1143 ext4_idx_store_pblock(curp->p_idx, newblock);
1145 1144
1146 neh = ext_inode_hdr(inode); 1145 neh = ext_inode_hdr(inode);
1147 fidx = EXT_FIRST_INDEX(neh);
1148 ext_debug("new root: num %d(%d), lblock %d, ptr %llu\n", 1146 ext_debug("new root: num %d(%d), lblock %d, ptr %llu\n",
1149 le16_to_cpu(neh->eh_entries), le16_to_cpu(neh->eh_max), 1147 le16_to_cpu(neh->eh_entries), le16_to_cpu(neh->eh_max),
1150 le32_to_cpu(fidx->ei_block), idx_pblock(fidx)); 1148 le32_to_cpu(EXT_FIRST_INDEX(neh)->ei_block),
1149 idx_pblock(EXT_FIRST_INDEX(neh)));
1151 1150
1152 neh->eh_depth = cpu_to_le16(path->p_depth + 1); 1151 neh->eh_depth = cpu_to_le16(path->p_depth + 1);
1153 err = ext4_ext_dirty(handle, inode, curp); 1152 err = ext4_ext_dirty(handle, inode, curp);
@@ -2954,7 +2953,6 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2954 struct ext4_extent *ex1 = NULL; 2953 struct ext4_extent *ex1 = NULL;
2955 struct ext4_extent *ex2 = NULL; 2954 struct ext4_extent *ex2 = NULL;
2956 struct ext4_extent *ex3 = NULL; 2955 struct ext4_extent *ex3 = NULL;
2957 struct ext4_extent_header *eh;
2958 ext4_lblk_t ee_block, eof_block; 2956 ext4_lblk_t ee_block, eof_block;
2959 unsigned int allocated, ee_len, depth; 2957 unsigned int allocated, ee_len, depth;
2960 ext4_fsblk_t newblock; 2958 ext4_fsblk_t newblock;
@@ -2971,7 +2969,6 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2971 eof_block = map->m_lblk + map->m_len; 2969 eof_block = map->m_lblk + map->m_len;
2972 2970
2973 depth = ext_depth(inode); 2971 depth = ext_depth(inode);
2974 eh = path[depth].p_hdr;
2975 ex = path[depth].p_ext; 2972 ex = path[depth].p_ext;
2976 ee_block = le32_to_cpu(ex->ee_block); 2973 ee_block = le32_to_cpu(ex->ee_block);
2977 ee_len = ext4_ext_get_actual_len(ex); 2974 ee_len = ext4_ext_get_actual_len(ex);
@@ -3058,7 +3055,6 @@ static int ext4_split_unwritten_extents(handle_t *handle,
3058 err = PTR_ERR(path); 3055 err = PTR_ERR(path);
3059 goto out; 3056 goto out;
3060 } 3057 }
3061 eh = path[depth].p_hdr;
3062 ex = path[depth].p_ext; 3058 ex = path[depth].p_ext;
3063 if (ex2 != &newex) 3059 if (ex2 != &newex)
3064 ex2 = ex; 3060 ex2 = ex;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 6c6614cae9e6..15ff8d8d839b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3146,13 +3146,10 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
3146 int ret, retries = 0; 3146 int ret, retries = 0;
3147 struct page *page; 3147 struct page *page;
3148 pgoff_t index; 3148 pgoff_t index;
3149 unsigned from, to;
3150 struct inode *inode = mapping->host; 3149 struct inode *inode = mapping->host;
3151 handle_t *handle; 3150 handle_t *handle;
3152 3151
3153 index = pos >> PAGE_CACHE_SHIFT; 3152 index = pos >> PAGE_CACHE_SHIFT;
3154 from = pos & (PAGE_CACHE_SIZE - 1);
3155 to = from + len;
3156 3153
3157 if (ext4_nonda_switch(inode->i_sb)) { 3154 if (ext4_nonda_switch(inode->i_sb)) {
3158 *fsdata = (void *)FALL_BACK_TO_NONDELALLOC; 3155 *fsdata = (void *)FALL_BACK_TO_NONDELALLOC;
@@ -5754,7 +5751,6 @@ static int ext4_expand_extra_isize(struct inode *inode,
5754{ 5751{
5755 struct ext4_inode *raw_inode; 5752 struct ext4_inode *raw_inode;
5756 struct ext4_xattr_ibody_header *header; 5753 struct ext4_xattr_ibody_header *header;
5757 struct ext4_xattr_entry *entry;
5758 5754
5759 if (EXT4_I(inode)->i_extra_isize >= new_extra_isize) 5755 if (EXT4_I(inode)->i_extra_isize >= new_extra_isize)
5760 return 0; 5756 return 0;
@@ -5762,7 +5758,6 @@ static int ext4_expand_extra_isize(struct inode *inode,
5762 raw_inode = ext4_raw_inode(&iloc); 5758 raw_inode = ext4_raw_inode(&iloc);
5763 5759
5764 header = IHDR(inode, raw_inode); 5760 header = IHDR(inode, raw_inode);
5765 entry = IFIRST(header);
5766 5761
5767 /* No extended attributes present */ 5762 /* No extended attributes present */
5768 if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR) || 5763 if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR) ||
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index d9d267181ddc..b2948b047973 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1999,7 +1999,6 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
1999 ext4_group_t ngroups, group, i; 1999 ext4_group_t ngroups, group, i;
2000 int cr; 2000 int cr;
2001 int err = 0; 2001 int err = 0;
2002 int bsbits;
2003 struct ext4_sb_info *sbi; 2002 struct ext4_sb_info *sbi;
2004 struct super_block *sb; 2003 struct super_block *sb;
2005 struct ext4_buddy e4b; 2004 struct ext4_buddy e4b;
@@ -2041,8 +2040,6 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
2041 ac->ac_2order = i - 1; 2040 ac->ac_2order = i - 1;
2042 } 2041 }
2043 2042
2044 bsbits = ac->ac_sb->s_blocksize_bits;
2045
2046 /* if stream allocation is enabled, use global goal */ 2043 /* if stream allocation is enabled, use global goal */
2047 if (ac->ac_flags & EXT4_MB_STREAM_ALLOC) { 2044 if (ac->ac_flags & EXT4_MB_STREAM_ALLOC) {
2048 /* TBD: may be hot point */ 2045 /* TBD: may be hot point */
@@ -2712,7 +2709,6 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2712 handle_t *handle, unsigned int reserv_blks) 2709 handle_t *handle, unsigned int reserv_blks)
2713{ 2710{
2714 struct buffer_head *bitmap_bh = NULL; 2711 struct buffer_head *bitmap_bh = NULL;
2715 struct ext4_super_block *es;
2716 struct ext4_group_desc *gdp; 2712 struct ext4_group_desc *gdp;
2717 struct buffer_head *gdp_bh; 2713 struct buffer_head *gdp_bh;
2718 struct ext4_sb_info *sbi; 2714 struct ext4_sb_info *sbi;
@@ -2725,8 +2721,6 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2725 2721
2726 sb = ac->ac_sb; 2722 sb = ac->ac_sb;
2727 sbi = EXT4_SB(sb); 2723 sbi = EXT4_SB(sb);
2728 es = sbi->s_es;
2729
2730 2724
2731 err = -EIO; 2725 err = -EIO;
2732 bitmap_bh = ext4_read_block_bitmap(sb, ac->ac_b_ex.fe_group); 2726 bitmap_bh = ext4_read_block_bitmap(sb, ac->ac_b_ex.fe_group);
@@ -2850,7 +2844,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
2850 int bsbits, max; 2844 int bsbits, max;
2851 ext4_lblk_t end; 2845 ext4_lblk_t end;
2852 loff_t size, orig_size, start_off; 2846 loff_t size, orig_size, start_off;
2853 ext4_lblk_t start, orig_start; 2847 ext4_lblk_t start;
2854 struct ext4_inode_info *ei = EXT4_I(ac->ac_inode); 2848 struct ext4_inode_info *ei = EXT4_I(ac->ac_inode);
2855 struct ext4_prealloc_space *pa; 2849 struct ext4_prealloc_space *pa;
2856 2850
@@ -2881,6 +2875,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
2881 size = size << bsbits; 2875 size = size << bsbits;
2882 if (size < i_size_read(ac->ac_inode)) 2876 if (size < i_size_read(ac->ac_inode))
2883 size = i_size_read(ac->ac_inode); 2877 size = i_size_read(ac->ac_inode);
2878 orig_size = size;
2884 2879
2885 /* max size of free chunks */ 2880 /* max size of free chunks */
2886 max = 2 << bsbits; 2881 max = 2 << bsbits;
@@ -2922,8 +2917,8 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
2922 start_off = (loff_t)ac->ac_o_ex.fe_logical << bsbits; 2917 start_off = (loff_t)ac->ac_o_ex.fe_logical << bsbits;
2923 size = ac->ac_o_ex.fe_len << bsbits; 2918 size = ac->ac_o_ex.fe_len << bsbits;
2924 } 2919 }
2925 orig_size = size = size >> bsbits; 2920 size = size >> bsbits;
2926 orig_start = start = start_off >> bsbits; 2921 start = start_off >> bsbits;
2927 2922
2928 /* don't cover already allocated blocks in selected range */ 2923 /* don't cover already allocated blocks in selected range */
2929 if (ar->pleft && start <= ar->lleft) { 2924 if (ar->pleft && start <= ar->lleft) {
@@ -3547,7 +3542,6 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
3547 ext4_group_t group; 3542 ext4_group_t group;
3548 ext4_grpblk_t bit; 3543 ext4_grpblk_t bit;
3549 unsigned long long grp_blk_start; 3544 unsigned long long grp_blk_start;
3550 sector_t start;
3551 int err = 0; 3545 int err = 0;
3552 int free = 0; 3546 int free = 0;
3553 3547
@@ -3567,10 +3561,9 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
3567 if (bit >= end) 3561 if (bit >= end)
3568 break; 3562 break;
3569 next = mb_find_next_bit(bitmap_bh->b_data, end, bit); 3563 next = mb_find_next_bit(bitmap_bh->b_data, end, bit);
3570 start = ext4_group_first_block_no(sb, group) + bit;
3571 mb_debug(1, " free preallocated %u/%u in group %u\n", 3564 mb_debug(1, " free preallocated %u/%u in group %u\n",
3572 (unsigned) start, (unsigned) next - bit, 3565 (unsigned) ext4_group_first_block_no(sb, group) + bit,
3573 (unsigned) group); 3566 (unsigned) next - bit, (unsigned) group);
3574 free += next - bit; 3567 free += next - bit;
3575 3568
3576 if (ac) { 3569 if (ac) {
@@ -4494,7 +4487,6 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
4494 struct super_block *sb = inode->i_sb; 4487 struct super_block *sb = inode->i_sb;
4495 struct ext4_allocation_context *ac = NULL; 4488 struct ext4_allocation_context *ac = NULL;
4496 struct ext4_group_desc *gdp; 4489 struct ext4_group_desc *gdp;
4497 struct ext4_super_block *es;
4498 unsigned long freed = 0; 4490 unsigned long freed = 0;
4499 unsigned int overflow; 4491 unsigned int overflow;
4500 ext4_grpblk_t bit; 4492 ext4_grpblk_t bit;
@@ -4513,7 +4505,6 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
4513 } 4505 }
4514 4506
4515 sbi = EXT4_SB(sb); 4507 sbi = EXT4_SB(sb);
4516 es = EXT4_SB(sb)->s_es;
4517 if (!(flags & EXT4_FREE_BLOCKS_VALIDATED) && 4508 if (!(flags & EXT4_FREE_BLOCKS_VALIDATED) &&
4518 !ext4_data_block_valid(sbi, block, count)) { 4509 !ext4_data_block_valid(sbi, block, count)) {
4519 ext4_error(sb, "Freeing blocks not in datazone - " 4510 ext4_error(sb, "Freeing blocks not in datazone - "
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a43e6617b351..5a61f77e7d7c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1088,7 +1088,6 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru
1088struct dentry *ext4_get_parent(struct dentry *child) 1088struct dentry *ext4_get_parent(struct dentry *child)
1089{ 1089{
1090 __u32 ino; 1090 __u32 ino;
1091 struct inode *inode;
1092 static const struct qstr dotdot = { 1091 static const struct qstr dotdot = {
1093 .name = "..", 1092 .name = "..",
1094 .len = 2, 1093 .len = 2,
@@ -1097,7 +1096,6 @@ struct dentry *ext4_get_parent(struct dentry *child)
1097 struct buffer_head *bh; 1096 struct buffer_head *bh;
1098 1097
1099 bh = ext4_find_entry(child->d_inode, &dotdot, &de); 1098 bh = ext4_find_entry(child->d_inode, &dotdot, &de);
1100 inode = NULL;
1101 if (!bh) 1099 if (!bh)
1102 return ERR_PTR(-ENOENT); 1100 return ERR_PTR(-ENOENT);
1103 ino = le32_to_cpu(de->inode); 1101 ino = le32_to_cpu(de->inode);
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 27527ae466ea..ca5c8aa00a2f 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -952,7 +952,6 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
952 ext4_fsblk_t n_blocks_count) 952 ext4_fsblk_t n_blocks_count)
953{ 953{
954 ext4_fsblk_t o_blocks_count; 954 ext4_fsblk_t o_blocks_count;
955 ext4_group_t o_groups_count;
956 ext4_grpblk_t last; 955 ext4_grpblk_t last;
957 ext4_grpblk_t add; 956 ext4_grpblk_t add;
958 struct buffer_head *bh; 957 struct buffer_head *bh;
@@ -964,7 +963,6 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
964 * yet: we're going to revalidate es->s_blocks_count after 963 * yet: we're going to revalidate es->s_blocks_count after
965 * taking the s_resize_lock below. */ 964 * taking the s_resize_lock below. */
966 o_blocks_count = ext4_blocks_count(es); 965 o_blocks_count = ext4_blocks_count(es);
967 o_groups_count = EXT4_SB(sb)->s_groups_count;
968 966
969 if (test_opt(sb, DEBUG)) 967 if (test_opt(sb, DEBUG))
970 printk(KERN_DEBUG "EXT4-fs: extending last group from %llu uto %llu blocks\n", 968 printk(KERN_DEBUG "EXT4-fs: extending last group from %llu uto %llu blocks\n",