diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ext4_fs.h | 25 | ||||
-rw-r--r-- | include/linux/ext4_fs_i.h | 6 |
2 files changed, 7 insertions, 24 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 583049c1d36..300cc5a5adb 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h @@ -1107,27 +1107,10 @@ extern void ext4_ext_init(struct super_block *); extern void ext4_ext_release(struct super_block *); extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len); -static inline int -ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, - unsigned long max_blocks, struct buffer_head *bh, - int create, int extend_disksize) -{ - int retval; - mutex_lock(&EXT4_I(inode)->truncate_mutex); - if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) { - retval = ext4_ext_get_blocks(handle, inode, - (ext4_lblk_t)block, max_blocks, - bh, create, extend_disksize); - } else { - retval = ext4_get_blocks_handle(handle, inode, - (ext4_lblk_t)block, max_blocks, - bh, create, extend_disksize); - } - mutex_unlock(&EXT4_I(inode)->truncate_mutex); - return retval; -} - - +extern int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, + sector_t block, unsigned long max_blocks, + struct buffer_head *bh, int create, + int extend_disksize); #endif /* __KERNEL__ */ #endif /* _LINUX_EXT4_FS_H */ diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h index f1cd4934e46..4377d249d37 100644 --- a/include/linux/ext4_fs_i.h +++ b/include/linux/ext4_fs_i.h @@ -139,16 +139,16 @@ struct ext4_inode_info { __u16 i_extra_isize; /* - * truncate_mutex is for serialising ext4_truncate() against + * i_data_sem is for serialising ext4_truncate() against * ext4_getblock(). In the 2.4 ext2 design, great chunks of inode's * data tree are chopped off during truncate. We can't do that in * ext4 because whenever we perform intermediate commits during * truncate, the inode and all the metadata blocks *must* be in a * consistent state which allows truncation of the orphans to restart * during recovery. Hence we must fix the get_block-vs-truncate race - * by other means, so we have truncate_mutex. + * by other means, so we have i_data_sem. */ - struct mutex truncate_mutex; + struct rw_semaphore i_data_sem; struct inode vfs_inode; unsigned long i_ext_generation; |