aboutsummaryrefslogtreecommitdiffstats
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
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>
-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
-rw-r--r--fs/jbd2/journal.c12
-rw-r--r--fs/jbd2/recovery.c10
7 files changed, 10 insertions, 50 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",
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index bc2ff5932769..f7bf15787d68 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1392,13 +1392,9 @@ int jbd2_journal_check_used_features (journal_t *journal, unsigned long compat,
1392int jbd2_journal_check_available_features (journal_t *journal, unsigned long compat, 1392int jbd2_journal_check_available_features (journal_t *journal, unsigned long compat,
1393 unsigned long ro, unsigned long incompat) 1393 unsigned long ro, unsigned long incompat)
1394{ 1394{
1395 journal_superblock_t *sb;
1396
1397 if (!compat && !ro && !incompat) 1395 if (!compat && !ro && !incompat)
1398 return 1; 1396 return 1;
1399 1397
1400 sb = journal->j_superblock;
1401
1402 /* We can support any known requested features iff the 1398 /* We can support any known requested features iff the
1403 * superblock is in version 2. Otherwise we fail to support any 1399 * superblock is in version 2. Otherwise we fail to support any
1404 * extended sb features. */ 1400 * extended sb features. */
@@ -1618,7 +1614,6 @@ int jbd2_journal_flush(journal_t *journal)
1618 1614
1619int jbd2_journal_wipe(journal_t *journal, int write) 1615int jbd2_journal_wipe(journal_t *journal, int write)
1620{ 1616{
1621 journal_superblock_t *sb;
1622 int err = 0; 1617 int err = 0;
1623 1618
1624 J_ASSERT (!(journal->j_flags & JBD2_LOADED)); 1619 J_ASSERT (!(journal->j_flags & JBD2_LOADED));
@@ -1627,8 +1622,6 @@ int jbd2_journal_wipe(journal_t *journal, int write)
1627 if (err) 1622 if (err)
1628 return err; 1623 return err;
1629 1624
1630 sb = journal->j_superblock;
1631
1632 if (!journal->j_tail) 1625 if (!journal->j_tail)
1633 goto no_recovery; 1626 goto no_recovery;
1634 1627
@@ -2202,8 +2195,6 @@ void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode, struct inode *inode)
2202void jbd2_journal_release_jbd_inode(journal_t *journal, 2195void jbd2_journal_release_jbd_inode(journal_t *journal,
2203 struct jbd2_inode *jinode) 2196 struct jbd2_inode *jinode)
2204{ 2197{
2205 int writeout = 0;
2206
2207 if (!journal) 2198 if (!journal)
2208 return; 2199 return;
2209restart: 2200restart:
@@ -2220,9 +2211,6 @@ restart:
2220 goto restart; 2211 goto restart;
2221 } 2212 }
2222 2213
2223 /* Do we need to wait for data writeback? */
2224 if (journal->j_committing_transaction == jinode->i_transaction)
2225 writeout = 1;
2226 if (jinode->i_transaction) { 2214 if (jinode->i_transaction) {
2227 list_del(&jinode->i_list); 2215 list_del(&jinode->i_list);
2228 jinode->i_transaction = NULL; 2216 jinode->i_transaction = NULL;
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index 049281b7cb89..2bc4d5f116f1 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -285,12 +285,10 @@ int jbd2_journal_recover(journal_t *journal)
285int jbd2_journal_skip_recovery(journal_t *journal) 285int jbd2_journal_skip_recovery(journal_t *journal)
286{ 286{
287 int err; 287 int err;
288 journal_superblock_t * sb;
289 288
290 struct recovery_info info; 289 struct recovery_info info;
291 290
292 memset (&info, 0, sizeof(info)); 291 memset (&info, 0, sizeof(info));
293 sb = journal->j_superblock;
294 292
295 err = do_one_pass(journal, &info, PASS_SCAN); 293 err = do_one_pass(journal, &info, PASS_SCAN);
296 294
@@ -299,7 +297,8 @@ int jbd2_journal_skip_recovery(journal_t *journal)
299 ++journal->j_transaction_sequence; 297 ++journal->j_transaction_sequence;
300 } else { 298 } else {
301#ifdef CONFIG_JBD2_DEBUG 299#ifdef CONFIG_JBD2_DEBUG
302 int dropped = info.end_transaction - be32_to_cpu(sb->s_sequence); 300 int dropped = info.end_transaction -
301 be32_to_cpu(journal->j_superblock->s_sequence);
303#endif 302#endif
304 jbd_debug(1, 303 jbd_debug(1,
305 "JBD: ignoring %d transaction%s from the journal.\n", 304 "JBD: ignoring %d transaction%s from the journal.\n",
@@ -365,11 +364,6 @@ static int do_one_pass(journal_t *journal,
365 int tag_bytes = journal_tag_bytes(journal); 364 int tag_bytes = journal_tag_bytes(journal);
366 __u32 crc32_sum = ~0; /* Transactional Checksums */ 365 __u32 crc32_sum = ~0; /* Transactional Checksums */
367 366
368 /* Precompute the maximum metadata descriptors in a descriptor block */
369 int MAX_BLOCKS_PER_DESC;
370 MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t))
371 / tag_bytes);
372
373 /* 367 /*
374 * First thing is to establish what we expect to find in the log 368 * First thing is to establish what we expect to find in the log
375 * (in terms of transaction IDs), and where (in terms of log 369 * (in terms of transaction IDs), and where (in terms of log