diff options
author | Yan, Zheng <yanzheng@21cn.com> | 2009-12-28 00:01:58 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-01-17 20:06:27 -0500 |
commit | a038fab0cb873c75d6675e2bcffce8a3935bdce7 (patch) | |
tree | f128cf83728dccb1a5f392acb053ceccb4491aa3 /fs | |
parent | 406266ab9ac8ed8b085c58aacd9e3161480dc5d5 (diff) |
Btrfs: align offsets for btrfs_ordered_update_i_size
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ordered-data.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index b10a49d4bc6a..5c2a9e78a949 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -626,6 +626,8 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset, | |||
626 | 626 | ||
627 | if (ordered) | 627 | if (ordered) |
628 | offset = entry_end(ordered); | 628 | offset = entry_end(ordered); |
629 | else | ||
630 | offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize); | ||
629 | 631 | ||
630 | mutex_lock(&tree->mutex); | 632 | mutex_lock(&tree->mutex); |
631 | disk_i_size = BTRFS_I(inode)->disk_i_size; | 633 | disk_i_size = BTRFS_I(inode)->disk_i_size; |