Skip to content

Commit

Permalink
Btrfs: align offsets for btrfs_ordered_update_i_size
Browse files Browse the repository at this point in the history
Some callers of btrfs_ordered_update_i_size can now pass in
a NULL for the ordered extent to update against.  This makes
sure we properly align the offset they pass in when deciding
how much to bump the on disk i_size.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Yan, Zheng authored and Chris Mason committed Jan 18, 2010
1 parent 406266a commit a038fab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/ordered-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,

if (ordered)
offset = entry_end(ordered);
else
offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize);

mutex_lock(&tree->mutex);
disk_i_size = BTRFS_I(inode)->disk_i_size;
Expand Down

0 comments on commit a038fab

Please sign in to comment.