diff options
author | Chao Yu <chao2.yu@samsung.com> | 2013-11-22 03:52:50 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-22 20:18:04 -0500 |
commit | a66c7b2fcfbc9ef4e972f6bc2b63d72d00f23122 (patch) | |
tree | 81c28b128fc6316e20ac1a8ae697d7b2edc8aa0d /fs/f2fs/file.c | |
parent | 031fa8cc9ba45c14f440b9cf71d09950fbe5eb9b (diff) |
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 <chao2.yu@samsung.com>
Signed-off-by: Fan Li <fanofcode.li@samsung.com>
[Jaegeuk Kim: remove an unnecessary parameter togather]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 1cd8e44b637f..2b47adcd852a 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) | |||
444 | return 0; | 444 | return 0; |
445 | } | 445 | } |
446 | 446 | ||
447 | static int punch_hole(struct inode *inode, loff_t offset, loff_t len, int mode) | 447 | static int punch_hole(struct inode *inode, loff_t offset, loff_t len) |
448 | { | 448 | { |
449 | pgoff_t pg_start, pg_end; | 449 | pgoff_t pg_start, pg_end; |
450 | loff_t off_start, off_end; | 450 | 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) | |||
484 | } | 484 | } |
485 | } | 485 | } |
486 | 486 | ||
487 | if (!(mode & FALLOC_FL_KEEP_SIZE) && | ||
488 | i_size_read(inode) <= (offset + len)) { | ||
489 | i_size_write(inode, offset); | ||
490 | mark_inode_dirty(inode); | ||
491 | } | ||
492 | |||
493 | return ret; | 487 | return ret; |
494 | } | 488 | } |
495 | 489 | ||
@@ -552,7 +546,7 @@ static long f2fs_fallocate(struct file *file, int mode, | |||
552 | return -EOPNOTSUPP; | 546 | return -EOPNOTSUPP; |
553 | 547 | ||
554 | if (mode & FALLOC_FL_PUNCH_HOLE) | 548 | if (mode & FALLOC_FL_PUNCH_HOLE) |
555 | ret = punch_hole(inode, offset, len, mode); | 549 | ret = punch_hole(inode, offset, len); |
556 | else | 550 | else |
557 | ret = expand_inode_data(inode, offset, len, mode); | 551 | ret = expand_inode_data(inode, offset, len, mode); |
558 | 552 | ||