Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101068
b: refs/heads/master
c: e7dfb24
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Theodore Ts'o committed Jul 11, 2008
1 parent d0f6a60 commit 7147aef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: f3b35f063e9a795495fe2f7a2fe55fab11f8ab12
refs/heads/master: e7dfb2463e3c1b10c38372023e0186d25dec1fa6
20 changes: 12 additions & 8 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,22 +381,28 @@ static inline void mb_clear_bit_atomic(spinlock_t *lock, int bit, void *addr)

static inline int mb_find_next_zero_bit(void *addr, int max, int start)
{
int fix = 0;
int fix = 0, ret, tmpmax;
addr = mb_correct_addr_and_bit(&fix, addr);
max += fix;
tmpmax = max + fix;
start += fix;

return ext4_find_next_zero_bit(addr, max, start) - fix;
ret = ext4_find_next_zero_bit(addr, tmpmax, start) - fix;
if (ret > max)
return max;
return ret;
}

static inline int mb_find_next_bit(void *addr, int max, int start)
{
int fix = 0;
int fix = 0, ret, tmpmax;
addr = mb_correct_addr_and_bit(&fix, addr);
max += fix;
tmpmax = max + fix;
start += fix;

return ext4_find_next_bit(addr, max, start) - fix;
ret = ext4_find_next_bit(addr, tmpmax, start) - fix;
if (ret > max)
return max;
return ret;
}

static void *mb_find_buddy(struct ext4_buddy *e4b, int order, int *max)
Expand Down Expand Up @@ -3473,8 +3479,6 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh,
if (bit >= end)
break;
next = mb_find_next_bit(bitmap_bh->b_data, end, bit);
if (next > end)
next = end;
start = group * EXT4_BLOCKS_PER_GROUP(sb) + bit +
le32_to_cpu(sbi->s_es->s_first_data_block);
mb_debug(" free preallocated %u/%u in group %u\n",
Expand Down

0 comments on commit 7147aef

Please sign in to comment.