Because FALLOC_FL_PUNCH_HOLE flag must be ORed with FALLOC_FL_KEEP_SIZE 
in fallocate, so we could remove the useless 'keep size' branch code which 
will never be excuted in punch_hole.

Signed-off-by: Chao Yu <chao2...@samsung.com>
Signed-off-by: Fan Li <fanofcode...@samsung.com>
---
 fs/f2fs/file.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 7d714f4..0087d2a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -499,12 +499,6 @@ static int punch_hole(struct inode *inode, loff_t offset, 
loff_t len, int mode)
                }
        }
 
-       if (!(mode & FALLOC_FL_KEEP_SIZE) &&
-               i_size_read(inode) <= (offset + len)) {
-               i_size_write(inode, offset);
-               mark_inode_dirty(inode);
-       }
-
        return ret;
 }
 
-- 
1.7.9.5


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to