diff options
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 5b19760b1de5..b0c225cdb52c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1825,7 +1825,7 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no) | |||
1825 | /* | 1825 | /* |
1826 | * Special error return code only used by dx_probe() and its callers. | 1826 | * Special error return code only used by dx_probe() and its callers. |
1827 | */ | 1827 | */ |
1828 | #define ERR_BAD_DX_DIR -75000 | 1828 | #define ERR_BAD_DX_DIR (-(MAX_ERRNO - 1)) |
1829 | 1829 | ||
1830 | /* | 1830 | /* |
1831 | * Timeout and state flag for lazy initialization inode thread. | 1831 | * Timeout and state flag for lazy initialization inode thread. |
@@ -2454,6 +2454,22 @@ static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize) | |||
2454 | up_write(&EXT4_I(inode)->i_data_sem); | 2454 | up_write(&EXT4_I(inode)->i_data_sem); |
2455 | } | 2455 | } |
2456 | 2456 | ||
2457 | /* Update i_size, i_disksize. Requires i_mutex to avoid races with truncate */ | ||
2458 | static inline int ext4_update_inode_size(struct inode *inode, loff_t newsize) | ||
2459 | { | ||
2460 | int changed = 0; | ||
2461 | |||
2462 | if (newsize > inode->i_size) { | ||
2463 | i_size_write(inode, newsize); | ||
2464 | changed = 1; | ||
2465 | } | ||
2466 | if (newsize > EXT4_I(inode)->i_disksize) { | ||
2467 | ext4_update_i_disksize(inode, newsize); | ||
2468 | changed |= 2; | ||
2469 | } | ||
2470 | return changed; | ||
2471 | } | ||
2472 | |||
2457 | struct ext4_group_info { | 2473 | struct ext4_group_info { |
2458 | unsigned long bb_state; | 2474 | unsigned long bb_state; |
2459 | struct rb_root bb_free_root; | 2475 | struct rb_root bb_free_root; |