Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128471
b: refs/heads/master
c: bab9fb0
h: refs/heads/master
i:
  128469: 6b2136a
  128467: aff0a86
  128463: e1b912e
v: v3
  • Loading branch information
Yan authored and Chris Mason committed Sep 25, 2008
1 parent 8689dfc commit 4ada096
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 23223584e44cb1b0b69ba3a9ad74956f292a416b
refs/heads/master: bab9fb035faa5119991b64cfee1b14c1d6f6a31b
10 changes: 6 additions & 4 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans,
btrfs_file_extent_type(fi) !=
BTRFS_FILE_EXTENT_INLINE) {
u64 num_dec;
extent_start = btrfs_file_extent_disk_blocknr(fi);
if (!del_item) {
u64 orig_num_blocks =
btrfs_file_extent_num_blocks(fi);
Expand All @@ -604,12 +605,13 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans,
extent_num_blocks >>= inode->i_blkbits;
btrfs_set_file_extent_num_blocks(fi,
extent_num_blocks);
inode->i_blocks -= (orig_num_blocks -
extent_num_blocks) << 3;
num_dec = (orig_num_blocks -
extent_num_blocks) << 3;
if (extent_start != 0) {
inode->i_blocks -= num_dec;
}
btrfs_mark_buffer_dirty(path->nodes[0]);
} else {
extent_start =
btrfs_file_extent_disk_blocknr(fi);
extent_num_blocks =
btrfs_file_extent_disk_num_blocks(fi);
/* FIXME blocksize != 4096 */
Expand Down

0 comments on commit 4ada096

Please sign in to comment.