diff options
author | Ashish Sangwan <a.sangwan@samsung.com> | 2013-07-01 08:12:38 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-07-01 08:12:38 -0400 |
commit | aeb2817a4ea99f62532adf3377be3b282d3bda12 (patch) | |
tree | 7e51c67923215eb8e6596d2052d2b8ad261c1b3c /fs/ext4 | |
parent | c4932dbe63dae2d23b4f596caa5d286ebfe042cf (diff) |
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 <a.sangwan@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/ext4.h | 2 | ||||
-rw-r--r-- | fs/ext4/extents.c | 2 | ||||
-rw-r--r-- | fs/ext4/inode.c | 3 |
3 files changed, 3 insertions, 4 deletions
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); | |||
2088 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); | 2088 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); |
2089 | extern int ext4_can_truncate(struct inode *inode); | 2089 | extern int ext4_can_truncate(struct inode *inode); |
2090 | extern void ext4_truncate(struct inode *); | 2090 | extern void ext4_truncate(struct inode *); |
2091 | extern int ext4_punch_hole(struct file *file, loff_t offset, loff_t length); | 2091 | extern int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length); |
2092 | extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks); | 2092 | extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks); |
2093 | extern void ext4_set_inode_flags(struct inode *); | 2093 | extern void ext4_set_inode_flags(struct inode *); |
2094 | extern void ext4_get_inode_flags(struct ext4_inode_info *); | 2094 | 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) | |||
4463 | return -EOPNOTSUPP; | 4463 | return -EOPNOTSUPP; |
4464 | 4464 | ||
4465 | if (mode & FALLOC_FL_PUNCH_HOLE) | 4465 | if (mode & FALLOC_FL_PUNCH_HOLE) |
4466 | return ext4_punch_hole(file, offset, len); | 4466 | return ext4_punch_hole(inode, offset, len); |
4467 | 4467 | ||
4468 | ret = ext4_convert_inline_data(inode); | 4468 | ret = ext4_convert_inline_data(inode); |
4469 | if (ret) | 4469 | if (ret) |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f9ba51f68777..753c15683809 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3481,9 +3481,8 @@ int ext4_can_truncate(struct inode *inode) | |||
3481 | * Returns: 0 on success or negative on failure | 3481 | * Returns: 0 on success or negative on failure |
3482 | */ | 3482 | */ |
3483 | 3483 | ||
3484 | int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) | 3484 | int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) |
3485 | { | 3485 | { |
3486 | struct inode *inode = file_inode(file); | ||
3487 | struct super_block *sb = inode->i_sb; | 3486 | struct super_block *sb = inode->i_sb; |
3488 | ext4_lblk_t first_block, stop_block; | 3487 | ext4_lblk_t first_block, stop_block; |
3489 | struct address_space *mapping = inode->i_mapping; | 3488 | struct address_space *mapping = inode->i_mapping; |