From: Chao Yu Date: Fri, 22 Nov 2013 08:52:50 +0000 (+0800) Subject: f2fs: remove unneeded code in punch_hole X-Git-Tag: v3.14-rc1~122^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a66c7b2fcfbc9ef4e972f6bc2b63d72d00f23122;p=kernel%2Fkernel-generic.git f2fs: remove unneeded code in punch_hole 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 Signed-off-by: Fan Li [Jaegeuk Kim: remove an unnecessary parameter togather] Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 1cd8e44..2b47adc 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -444,7 +444,7 @@ int truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end) return 0; } -static int punch_hole(struct inode *inode, loff_t offset, loff_t len, int mode) +static int punch_hole(struct inode *inode, loff_t offset, loff_t len) { pgoff_t pg_start, pg_end; loff_t off_start, off_end; @@ -484,12 +484,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; } @@ -552,7 +546,7 @@ static long f2fs_fallocate(struct file *file, int mode, return -EOPNOTSUPP; if (mode & FALLOC_FL_PUNCH_HOLE) - ret = punch_hole(inode, offset, len, mode); + ret = punch_hole(inode, offset, len); else ret = expand_inode_data(inode, offset, len, mode);