Skip to content

Commit 0411ba7

Browse files
Andi Kleenjankara
authored andcommitted
ext3: Fix set but unused variables
[tytso@mit.edu: Fix compilation with CONFIG_JBD_DEBUG enabled] Acked-by: tytso@mit.edu cc: linux-ext4@vger.kernel.org Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 189eef5 commit 0411ba7

4 files changed

Lines changed: 3 additions & 20 deletions

File tree

‎fs/ext3/namei.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,6 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
14471447
struct inode *inode)
14481448
{
14491449
struct inode *dir = dentry->d_parent->d_inode;
1450-
unsigned long offset;
14511450
struct buffer_head * bh;
14521451
struct ext3_dir_entry_2 *de;
14531452
struct super_block * sb;
@@ -1469,7 +1468,7 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
14691468
ext3_mark_inode_dirty(handle, dir);
14701469
}
14711470
blocks = dir->i_size >> sb->s_blocksize_bits;
1472-
for (block = 0, offset = 0; block < blocks; block++) {
1471+
for (block = 0; block < blocks; block++) {
14731472
bh = ext3_bread(handle, dir, block, 0, &retval);
14741473
if(!bh)
14751474
return retval;

‎fs/ext3/resize.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,6 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
964964
ext3_fsblk_t n_blocks_count)
965965
{
966966
ext3_fsblk_t o_blocks_count;
967-
unsigned long o_groups_count;
968967
ext3_grpblk_t last;
969968
ext3_grpblk_t add;
970969
struct buffer_head * bh;
@@ -976,7 +975,6 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
976975
* yet: we're going to revalidate es->s_blocks_count after
977976
* taking the s_resize_lock below. */
978977
o_blocks_count = le32_to_cpu(es->s_blocks_count);
979-
o_groups_count = EXT3_SB(sb)->s_groups_count;
980978

981979
if (test_opt(sb, DEBUG))
982980
printk(KERN_DEBUG "EXT3-fs: extending last group from "E3FSBLK" uto "E3FSBLK" blocks\n",

‎fs/jbd/journal.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,13 +1281,9 @@ int journal_check_used_features (journal_t *journal, unsigned long compat,
12811281
int journal_check_available_features (journal_t *journal, unsigned long compat,
12821282
unsigned long ro, unsigned long incompat)
12831283
{
1284-
journal_superblock_t *sb;
1285-
12861284
if (!compat && !ro && !incompat)
12871285
return 1;
12881286

1289-
sb = journal->j_superblock;
1290-
12911287
/* We can support any known requested features iff the
12921288
* superblock is in version 2. Otherwise we fail to support any
12931289
* extended sb features. */
@@ -1481,7 +1477,6 @@ int journal_flush(journal_t *journal)
14811477

14821478
int journal_wipe(journal_t *journal, int write)
14831479
{
1484-
journal_superblock_t *sb;
14851480
int err = 0;
14861481

14871482
J_ASSERT (!(journal->j_flags & JFS_LOADED));
@@ -1490,8 +1485,6 @@ int journal_wipe(journal_t *journal, int write)
14901485
if (err)
14911486
return err;
14921487

1493-
sb = journal->j_superblock;
1494-
14951488
if (!journal->j_tail)
14961489
goto no_recovery;
14971490

‎fs/jbd/recovery.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,9 @@ int journal_recover(journal_t *journal)
283283
int journal_skip_recovery(journal_t *journal)
284284
{
285285
int err;
286-
journal_superblock_t * sb;
287-
288286
struct recovery_info info;
289287

290288
memset (&info, 0, sizeof(info));
291-
sb = journal->j_superblock;
292289

293290
err = do_one_pass(journal, &info, PASS_SCAN);
294291

@@ -297,7 +294,8 @@ int journal_skip_recovery(journal_t *journal)
297294
++journal->j_transaction_sequence;
298295
} else {
299296
#ifdef CONFIG_JBD_DEBUG
300-
int dropped = info.end_transaction - be32_to_cpu(sb->s_sequence);
297+
int dropped = info.end_transaction -
298+
be32_to_cpu(journal->j_superblock->s_sequence);
301299
#endif
302300
jbd_debug(1,
303301
"JBD: ignoring %d transaction%s from the journal.\n",
@@ -321,11 +319,6 @@ static int do_one_pass(journal_t *journal,
321319
unsigned int sequence;
322320
int blocktype;
323321

324-
/* Precompute the maximum metadata descriptors in a descriptor block */
325-
int MAX_BLOCKS_PER_DESC;
326-
MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t))
327-
/ sizeof(journal_block_tag_t));
328-
329322
/*
330323
* First thing is to establish what we expect to find in the log
331324
* (in terms of transaction IDs), and where (in terms of log

0 commit comments

Comments
 (0)