linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: pass inode pointer instead of file poiner to punch hole
@ 2013-05-24 14:36 ashishsangwan2
  2013-06-18 15:24 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: ashishsangwan2 @ 2013-05-24 14:36 UTC (permalink / raw)
  To: tytso, adilger; +Cc: linux-ext4, Ashish Sangwan, Namjae Jeon

From: Ashish Sangwan <a.sangwan@samsung.com>

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>
---
 fs/ext4/ext4.h    |    2 +-
 fs/ext4/extents.c |    2 +-
 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 5aae3d1..04e4d1e 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 bc0f191..3676dae 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4446,7 +4446,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 d6382b8..06e0fe2 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3580,9 +3580,8 @@ int ext4_can_truncate(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;
 	struct address_space *mapping = inode->i_mapping;
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: pass inode pointer instead of file poiner to punch hole
  2013-05-24 14:36 [PATCH] ext4: pass inode pointer instead of file poiner to punch hole ashishsangwan2
@ 2013-06-18 15:24 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2013-06-18 15:24 UTC (permalink / raw)
  To: ashishsangwan2; +Cc: adilger, linux-ext4, Ashish Sangwan, Namjae Jeon

On Fri, May 24, 2013 at 08:06:55PM +0530, ashishsangwan2@gmail.com wrote:
> From: Ashish Sangwan <a.sangwan@samsung.com>
> 
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-18 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-24 14:36 [PATCH] ext4: pass inode pointer instead of file poiner to punch hole ashishsangwan2
2013-06-18 15:24 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).