From: Ashish Sangwan Date: Tue, 18 Jun 2013 15:24:02 +0000 (-0400) Subject: ext4: pass inode pointer instead of file pointer to punch hole X-Git-Tag: next-20130619~97^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3671864cfd8d989057e92d79b1e72e87945ad073;p=karo-tx-linux.git ext4: pass inode pointer instead of file pointer to punch hole No need to pass file pointer when we can directly pass inode pointer. Signed-off-by: Ashish Sangwan Signed-off-by: Namjae Jeon Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 7cc6b18230ec..6ed348d8d3eb 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2088,7 +2088,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int); extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); extern int ext4_can_truncate(struct inode *inode); extern void ext4_truncate(struct inode *); -extern int ext4_punch_hole(struct file *file, loff_t offset, loff_t length); +extern int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length); extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks); extern void ext4_set_inode_flags(struct inode *); extern void ext4_get_inode_flags(struct ext4_inode_info *); diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 51e41687f51e..937593e2f006 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4463,7 +4463,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) return -EOPNOTSUPP; if (mode & FALLOC_FL_PUNCH_HOLE) - return ext4_punch_hole(file, offset, len); + return ext4_punch_hole(inode, offset, len); ret = ext4_convert_inline_data(inode); if (ret) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 6a84635634a1..78cf398f0446 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3489,9 +3489,8 @@ static inline int ext4_begin_ordered_punch_hole(struct inode *inode, * Returns: 0 on success or negative on failure */ -int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) +int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) { - struct inode *inode = file_inode(file); struct super_block *sb = inode->i_sb; ext4_lblk_t first_block, stop_block; loff_t first_block_offset, last_block_offset;