* [PATCH] f2fs: remove unneeded code in punch_hole @ 2013-11-22 8:52 Chao Yu 2013-11-27 5:14 ` Jaegeuk Kim 0 siblings, 1 reply; 3+ messages in thread From: Chao Yu @ 2013-11-22 8:52 UTC (permalink / raw) To: ???; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel 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> --- 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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] f2fs: remove unneeded code in punch_hole 2013-11-22 8:52 [PATCH] f2fs: remove unneeded code in punch_hole Chao Yu @ 2013-11-27 5:14 ` Jaegeuk Kim 2013-11-27 5:25 ` [f2fs-dev] " Chao Yu 0 siblings, 1 reply; 3+ messages in thread From: Jaegeuk Kim @ 2013-11-27 5:14 UTC (permalink / raw) To: Chao Yu; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel Got it. But, with this patch, we can also remove the parameter, int mode, in punch_hole(). If no objection, I'll fix that in your patch. Thanks, 2013-11-22 (금), 16:52 +0800, Chao Yu: > 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> > --- > 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; > } > -- Jaegeuk Kim Samsung ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [f2fs-dev] [PATCH] f2fs: remove unneeded code in punch_hole 2013-11-27 5:14 ` Jaegeuk Kim @ 2013-11-27 5:25 ` Chao Yu 0 siblings, 0 replies; 3+ messages in thread From: Chao Yu @ 2013-11-27 5:25 UTC (permalink / raw) To: jaegeuk.kim Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, '谭姝', fanofcode.li Hi, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com] > Sent: Wednesday, November 27, 2013 1:14 PM > To: Chao Yu > Cc: linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net; 谭姝; fanofcode.li@samsung.com > Subject: Re: [f2fs-dev] [PATCH] f2fs: remove unneeded code in punch_hole > > Got it. > > But, with this patch, we can also remove the parameter, int mode, in > punch_hole(). > If no objection, I'll fix that in your patch. > Thanks, Right, we should remove it. Thanks! > > 2013-11-22 (금), 16:52 +0800, Chao Yu: > > 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> > > --- > > 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; > > } > > > > -- > Jaegeuk Kim > Samsung ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-27 5:25 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-11-22 8:52 [PATCH] f2fs: remove unneeded code in punch_hole Chao Yu 2013-11-27 5:14 ` Jaegeuk Kim 2013-11-27 5:25 ` [f2fs-dev] " Chao Yu
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).