diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-17 12:54:05 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:04 -0400 |
commit | dbe674a99c8af088faa4c95eddaeb271a3140ab6 (patch) | |
tree | c6b5a08e93d0b09df873fd5c304156622d03368a /fs/btrfs/btrfs_inode.h | |
parent | 247e743cbe6e655768c3679f84821e03c1577902 (diff) |
Btrfs: Update on disk i_size only after pending ordered extents are done
This changes the ordered data code to update i_size after the extent
is on disk. An on disk i_size is maintained in the in-memory btrfs inode
structures, and this is updated as extents finish.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 8d03687510e0..81c0444f37b6 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -40,11 +40,20 @@ struct btrfs_inode { | |||
40 | */ | 40 | */ |
41 | u64 last_trans; | 41 | u64 last_trans; |
42 | u64 delalloc_bytes; | 42 | u64 delalloc_bytes; |
43 | u64 disk_i_size; | ||
43 | u32 flags; | 44 | u32 flags; |
44 | }; | 45 | }; |
46 | |||
45 | static inline struct btrfs_inode *BTRFS_I(struct inode *inode) | 47 | static inline struct btrfs_inode *BTRFS_I(struct inode *inode) |
46 | { | 48 | { |
47 | return container_of(inode, struct btrfs_inode, vfs_inode); | 49 | return container_of(inode, struct btrfs_inode, vfs_inode); |
48 | } | 50 | } |
49 | 51 | ||
52 | static inline void btrfs_i_size_write(struct inode *inode, u64 size) | ||
53 | { | ||
54 | inode->i_size = size; | ||
55 | BTRFS_I(inode)->disk_i_size = size; | ||
56 | } | ||
57 | |||
58 | |||
50 | #endif | 59 | #endif |