From: Chao Yu <chao2.yu@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: RE: [f2fs-dev] [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations
Date: Wed, 23 Dec 2015 11:26:25 +0800 [thread overview]
Message-ID: <010101d13d31$cdc1d860$69458920$@samsung.com> (raw)
In-Reply-To: <1450832388-29118-2-git-send-email-jaegeuk@kernel.org>
Hi Jaegeuk,
> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Wednesday, December 23, 2015 9:00 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations
>
> The f2fs_balance_fs doesn't need to cover f2fs_new_inode or f2fs_find_entry
> works.
So this avoids some unneeded overhead in f2fs_balance_fs for scenario where
f2fs_new_inode and f2fs_find_entry will fail for most of the time?
Shouldn't cover f2fs_find_entry in rename or rename2 case?
Thanks,
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/namei.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index 2c32110..8d2616f 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -128,8 +128,6 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t
> mode,
> nid_t ino = 0;
> int err;
>
> - f2fs_balance_fs(sbi);
> -
> inode = f2fs_new_inode(dir, mode);
> if (IS_ERR(inode))
> return PTR_ERR(inode);
> @@ -142,6 +140,8 @@ static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t
> mode,
> inode->i_mapping->a_ops = &f2fs_dblock_aops;
> ino = inode->i_ino;
>
> + f2fs_balance_fs(sbi);
> +
> f2fs_lock_op(sbi);
> err = f2fs_add_link(dentry, inode);
> if (err)
> @@ -288,12 +288,13 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
> int err = -ENOENT;
>
> trace_f2fs_unlink_enter(dir, dentry);
> - f2fs_balance_fs(sbi);
>
> de = f2fs_find_entry(dir, &dentry->d_name, &page);
> if (!de)
> goto fail;
>
> + f2fs_balance_fs(sbi);
> +
> f2fs_lock_op(sbi);
> err = acquire_orphan_inode(sbi);
> if (err) {
> @@ -341,8 +342,6 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
> if (len > dir->i_sb->s_blocksize)
> return -ENAMETOOLONG;
>
> - f2fs_balance_fs(sbi);
> -
> inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO);
> if (IS_ERR(inode))
> return PTR_ERR(inode);
> @@ -353,6 +352,8 @@ static int f2fs_symlink(struct inode *dir, struct dentry *dentry,
> inode->i_op = &f2fs_symlink_inode_operations;
> inode->i_mapping->a_ops = &f2fs_dblock_aops;
>
> + f2fs_balance_fs(sbi);
> +
> f2fs_lock_op(sbi);
> err = f2fs_add_link(dentry, inode);
> if (err)
> @@ -433,8 +434,6 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t
> mode)
> struct inode *inode;
> int err;
>
> - f2fs_balance_fs(sbi);
> -
> inode = f2fs_new_inode(dir, S_IFDIR | mode);
> if (IS_ERR(inode))
> return PTR_ERR(inode);
> @@ -444,6 +443,8 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t
> mode)
> inode->i_mapping->a_ops = &f2fs_dblock_aops;
> mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_HIGH_ZERO);
>
> + f2fs_balance_fs(sbi);
> +
> set_inode_flag(F2FS_I(inode), FI_INC_LINK);
> f2fs_lock_op(sbi);
> err = f2fs_add_link(dentry, inode);
> --
> 2.5.4 (Apple Git-61)
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2015-12-23 3:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 0:59 [PATCH 1/4] f2fs: check inline_data flag at converting time Jaegeuk Kim
2015-12-23 0:59 ` [PATCH 2/4] f2fs: avoid unnecessary f2fs_gc for dir operations Jaegeuk Kim
2015-12-23 0:59 ` Jaegeuk Kim
2015-12-23 3:26 ` Chao Yu [this message]
2015-12-23 18:54 ` [f2fs-dev] [PATCH 2/4 v2] " Jaegeuk Kim
2015-12-24 1:32 ` Chao Yu
2015-12-24 2:13 ` Jaegeuk Kim
2015-12-24 2:13 ` [f2fs-dev] " Jaegeuk Kim
2015-12-24 3:30 ` Chao Yu
2015-12-23 0:59 ` [PATCH 3/4] f2fs: record node block allocation in dnode_of_data Jaegeuk Kim
2015-12-23 8:00 ` Chao Yu
2015-12-23 8:00 ` [f2fs-dev] " Chao Yu
2015-12-23 18:57 ` Jaegeuk Kim
2015-12-23 19:00 ` [PATCH 3/4 v2] " Jaegeuk Kim
2015-12-23 19:00 ` Jaegeuk Kim
2015-12-24 1:35 ` [f2fs-dev] " Chao Yu
2015-12-23 0:59 ` [PATCH 4/4] f2fs: call f2fs_balance_fs only when node was changed Jaegeuk Kim
2015-12-23 0:59 ` Jaegeuk Kim
2015-12-23 9:46 ` Chao Yu
2015-12-23 9:46 ` [f2fs-dev] " Chao Yu
2015-12-23 19:13 ` Jaegeuk Kim
2015-12-25 1:38 ` Chao Yu
2015-12-25 1:38 ` [f2fs-dev] " Chao Yu
2015-12-23 19:14 ` Jaegeuk Kim
2015-12-23 19:14 ` Jaegeuk Kim
2015-12-24 5:48 ` Chao Yu
2015-12-24 5:48 ` [f2fs-dev] " Chao Yu
2015-12-23 3:19 ` [f2fs-dev] [PATCH 1/4] f2fs: check inline_data flag at converting time Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='010101d13d31$cdc1d860$69458920$@samsung.com' \
--to=chao2.yu@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.