Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101076
b: refs/heads/master
c: 74767c5
h: refs/heads/master
v: v3
  • Loading branch information
Shen Feng authored and Theodore Ts'o committed Jul 11, 2008
1 parent 24b9cca commit 62a718b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fdf6c7a7683c6272e953a33358920e98a4d93cf0
refs/heads/master: 74767c5a2dca0a60676d60d36377a41f60ca42ba
14 changes: 7 additions & 7 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,8 @@ static int ext4_mb_seq_history_open(struct inode *inode, struct file *file)
int rc;
int size;

if (unlikely(sbi->s_mb_history == NULL))
return -ENOMEM;
s = kmalloc(sizeof(*s), GFP_KERNEL);
if (s == NULL)
return -ENOMEM;
Expand Down Expand Up @@ -2187,9 +2189,7 @@ static void ext4_mb_history_init(struct super_block *sb)
sbi->s_mb_history_cur = 0;
spin_lock_init(&sbi->s_mb_history_lock);
i = sbi->s_mb_history_max * sizeof(struct ext4_mb_history);
sbi->s_mb_history = kmalloc(i, GFP_KERNEL);
if (likely(sbi->s_mb_history != NULL))
memset(sbi->s_mb_history, 0, i);
sbi->s_mb_history = kzalloc(i, GFP_KERNEL);
/* if we can't allocate history, then we simple won't use it */
}

Expand Down Expand Up @@ -2303,7 +2303,6 @@ static int ext4_mb_init_backend(struct super_block *sb)
i++;
goto err_freebuddy;
}
memset(meta_group_info[j], 0, len);
set_bit(EXT4_GROUP_INFO_NEED_INIT_BIT,
&(meta_group_info[j]->bb_state));

Expand Down Expand Up @@ -2358,6 +2357,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
unsigned i;
unsigned offset;
unsigned max;
int ret;

if (!test_opt(sb, MBALLOC))
return 0;
Expand Down Expand Up @@ -2392,12 +2392,12 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
} while (i <= sb->s_blocksize_bits + 1);

/* init file for buddy data */
i = ext4_mb_init_backend(sb);
if (i) {
ret = ext4_mb_init_backend(sb);
if (ret != 0) {
clear_opt(sbi->s_mount_opt, MBALLOC);
kfree(sbi->s_mb_offsets);
kfree(sbi->s_mb_maxs);
return i;
return ret;
}

spin_lock_init(&sbi->s_md_lock);
Expand Down

0 comments on commit 62a718b

Please sign in to comment.