Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242395
b: refs/heads/master
c: 0ba0851
h: refs/heads/master
i:
  242393: 1e68562
  242391: 6b77f7e
v: v3
  • Loading branch information
Tao Ma authored and Theodore Ts'o committed Mar 23, 2011
1 parent 970210c commit 71ea877
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 65922cb5ced76ba7182e955d4aada96f93446b1a
refs/heads/master: 0ba0851714beebb800992e5105a79dc3a4c504b0
11 changes: 8 additions & 3 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4870,10 +4870,15 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)
break;
}

if (len >= EXT4_BLOCKS_PER_GROUP(sb))
len -= (EXT4_BLOCKS_PER_GROUP(sb) - first_block);
else
/*
* For all the groups except the last one, last block will
* always be EXT4_BLOCKS_PER_GROUP(sb), so we only need to
* change it for the last group in which case start +
* len < EXT4_BLOCKS_PER_GROUP(sb).
*/
if (first_block + len < EXT4_BLOCKS_PER_GROUP(sb))
last_block = first_block + len;
len -= last_block - first_block;

if (e4b.bd_info->bb_free >= minlen) {
cnt = ext4_trim_all_free(sb, &e4b, first_block,
Expand Down

0 comments on commit 71ea877

Please sign in to comment.