Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91814
b: refs/heads/master
c: 9de90b7
h: refs/heads/master
v: v3
  • Loading branch information
marcin.slusarz@gmail.com authored and Jan Kara committed Apr 17, 2008
1 parent d70f2dd commit 0bf57d1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 43 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: c8ed837d371c24b678182a30e9f0b1f61dee212c
refs/heads/master: 9de90b76eb96e7cdeac8b8dbe7d3db948b070f4d
76 changes: 34 additions & 42 deletions trunk/fs/udf/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,34 +223,29 @@ void udf_truncate_extents(struct inode *inode)
if (indirect_ext_len) {
/* We managed to free all extents in the
* indirect extent - free it too */
if (!epos.bh)
BUG();
BUG_ON(!epos.bh);
udf_free_blocks(sb, inode, epos.block,
0, indirect_ext_len);
} else if (!epos.bh) {
iinfo->i_lenAlloc = lenalloc;
mark_inode_dirty(inode);
} else {
if (!epos.bh) {
iinfo->i_lenAlloc =
lenalloc;
mark_inode_dirty(inode);
} else {
struct allocExtDesc *aed =
(struct allocExtDesc *)
(epos.bh->b_data);
int len =
sizeof(struct allocExtDesc);
struct allocExtDesc *aed =
(struct allocExtDesc *)
(epos.bh->b_data);
int len = sizeof(struct allocExtDesc);

aed->lengthAllocDescs =
cpu_to_le32(lenalloc);
if (!UDF_QUERY_FLAG(sb,
UDF_FLAG_STRICT) ||
sbi->s_udfrev >= 0x0201)
len += lenalloc;
aed->lengthAllocDescs =
cpu_to_le32(lenalloc);
if (!UDF_QUERY_FLAG(sb,
UDF_FLAG_STRICT) ||
sbi->s_udfrev >= 0x0201)
len += lenalloc;

udf_update_tag(epos.bh->b_data,
len);
mark_buffer_dirty_inode(
epos.bh, inode);
}
udf_update_tag(epos.bh->b_data,
len);
mark_buffer_dirty_inode(
epos.bh, inode);
}
brelse(epos.bh);
epos.offset = sizeof(struct allocExtDesc);
Expand All @@ -271,28 +266,25 @@ void udf_truncate_extents(struct inode *inode)
}

if (indirect_ext_len) {
if (!epos.bh)
BUG();
BUG_ON(!epos.bh);
udf_free_blocks(sb, inode, epos.block, 0,
indirect_ext_len);
} else if (!epos.bh) {
iinfo->i_lenAlloc = lenalloc;
mark_inode_dirty(inode);
} else {
if (!epos.bh) {
iinfo->i_lenAlloc = lenalloc;
mark_inode_dirty(inode);
} else {
struct allocExtDesc *aed =
(struct allocExtDesc *)(epos.bh->b_data);
aed->lengthAllocDescs = cpu_to_le32(lenalloc);
if (!UDF_QUERY_FLAG(sb, UDF_FLAG_STRICT) ||
sbi->s_udfrev >= 0x0201)
udf_update_tag(epos.bh->b_data,
lenalloc +
sizeof(struct allocExtDesc));
else
udf_update_tag(epos.bh->b_data,
sizeof(struct allocExtDesc));
mark_buffer_dirty_inode(epos.bh, inode);
}
struct allocExtDesc *aed =
(struct allocExtDesc *)(epos.bh->b_data);
aed->lengthAllocDescs = cpu_to_le32(lenalloc);
if (!UDF_QUERY_FLAG(sb, UDF_FLAG_STRICT) ||
sbi->s_udfrev >= 0x0201)
udf_update_tag(epos.bh->b_data,
lenalloc +
sizeof(struct allocExtDesc));
else
udf_update_tag(epos.bh->b_data,
sizeof(struct allocExtDesc));
mark_buffer_dirty_inode(epos.bh, inode);
}
} else if (inode->i_size) {
if (byte_offset) {
Expand Down

0 comments on commit 0bf57d1

Please sign in to comment.