Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347878
b: refs/heads/master
c: 1b243fd
h: refs/heads/master
v: v3
  • Loading branch information
Vyacheslav Dubeyko authored and Linus Torvalds committed Dec 21, 2012
1 parent eca449a commit b05e6c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 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: 5daa669c80c121ab75ecdf1c8e2df52f072fd25e
refs/heads/master: 1b243fd39bd605cdfc482bba4e56b0cb34b28f27
24 changes: 20 additions & 4 deletions trunk/fs/hfsplus/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static int hfsplus_free_extents(struct super_block *sb,
{
u32 count, start;
int i;
int err = 0;

hfsplus_dump_extent(extent);
for (i = 0; i < 8; extent++, i++) {
Expand All @@ -345,18 +346,33 @@ static int hfsplus_free_extents(struct super_block *sb,
for (;;) {
start = be32_to_cpu(extent->start_block);
if (count <= block_nr) {
hfsplus_block_free(sb, start, count);
err = hfsplus_block_free(sb, start, count);
if (err) {
printk(KERN_ERR "hfs: can't free extent\n");
dprint(DBG_EXTENT, " start: %u count: %u\n",
start, count);
}
extent->block_count = 0;
extent->start_block = 0;
block_nr -= count;
} else {
count -= block_nr;
hfsplus_block_free(sb, start + count, block_nr);
err = hfsplus_block_free(sb, start + count, block_nr);
if (err) {
printk(KERN_ERR "hfs: can't free extent\n");
dprint(DBG_EXTENT, " start: %u count: %u\n",
start, count);
}
extent->block_count = cpu_to_be32(count);
block_nr = 0;
}
if (!block_nr || !i)
return 0;
if (!block_nr || !i) {
/*
* Try to free all extents and
* return only last error
*/
return err;
}
i--;
extent--;
count = be32_to_cpu(extent->block_count);
Expand Down

0 comments on commit b05e6c6

Please sign in to comment.