ext4: move i_size,i_disksize update routines to helper function
Cc: stable@vger.kernel.org # needed for bug fix patches Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:

committed by
Theodore Ts'o

parent
c99d1e6e83
commit
4631dbf677
@@ -2454,6 +2454,22 @@ static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize)
|
||||
up_write(&EXT4_I(inode)->i_data_sem);
|
||||
}
|
||||
|
||||
/* Update i_size, i_disksize. Requires i_mutex to avoid races with truncate */
|
||||
static inline int ext4_update_inode_size(struct inode *inode, loff_t newsize)
|
||||
{
|
||||
int changed = 0;
|
||||
|
||||
if (newsize > inode->i_size) {
|
||||
i_size_write(inode, newsize);
|
||||
changed = 1;
|
||||
}
|
||||
if (newsize > EXT4_I(inode)->i_disksize) {
|
||||
ext4_update_i_disksize(inode, newsize);
|
||||
changed |= 2;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
struct ext4_group_info {
|
||||
unsigned long bb_state;
|
||||
struct rb_root bb_free_root;
|
||||
|
Reference in New Issue
Block a user