* [PATCH] f2fs: no need to initialize zero value for GFP_F2FS_ZERO
@ 2018-03-21 12:25 Yunlong Song
2018-03-22 1:11 ` Chao Yu
2018-03-22 2:08 ` [PATCH v2] " Yunlong Song
0 siblings, 2 replies; 4+ messages in thread
From: Yunlong Song @ 2018-03-21 12:25 UTC (permalink / raw)
To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
Since f2fs_inode_info is allocated with flag GFP_F2FS_ZERO, so we do not
need to initialize zero value for its member any more.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
fs/f2fs/super.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0c1fe9b..3a7fa03 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -825,9 +825,7 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
init_once((void *) fi);
/* Initialize f2fs-specific inode info */
- atomic_set(&fi->dirty_pages, 0);
fi->i_current_depth = 1;
- fi->i_advise = 0;
init_rwsem(&fi->i_sem);
INIT_LIST_HEAD(&fi->dirty_list);
INIT_LIST_HEAD(&fi->gdirty_list);
@@ -839,10 +837,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
init_rwsem(&fi->i_mmap_sem);
init_rwsem(&fi->i_xattr_sem);
-#ifdef CONFIG_QUOTA
- memset(&fi->i_dquot, 0, sizeof(fi->i_dquot));
- fi->i_reserved_quota = 0;
-#endif
/* Will be used by directory only */
fi->i_dir_level = F2FS_SB(sb)->dir_level;
--
1.8.5.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: no need to initialize zero value for GFP_F2FS_ZERO
2018-03-21 12:25 [PATCH] f2fs: no need to initialize zero value for GFP_F2FS_ZERO Yunlong Song
@ 2018-03-22 1:11 ` Chao Yu
2018-03-22 2:08 ` [PATCH v2] " Yunlong Song
1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2018-03-22 1:11 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
On 2018/3/21 20:25, Yunlong Song wrote:
> Since f2fs_inode_info is allocated with flag GFP_F2FS_ZERO, so we do not
> need to initialize zero value for its member any more.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
> fs/f2fs/super.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 0c1fe9b..3a7fa03 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -825,9 +825,7 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
> init_once((void *) fi);
>
> /* Initialize f2fs-specific inode info */
> - atomic_set(&fi->dirty_pages, 0);
We'd better to keep atomic_set function as it is since how it initialize
.dirty_pages field is completely depend on locking sub module itself.
Thanks,
> fi->i_current_depth = 1;
> - fi->i_advise = 0;
> init_rwsem(&fi->i_sem);
> INIT_LIST_HEAD(&fi->dirty_list);
> INIT_LIST_HEAD(&fi->gdirty_list);
> @@ -839,10 +837,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
> init_rwsem(&fi->i_mmap_sem);
> init_rwsem(&fi->i_xattr_sem);
>
> -#ifdef CONFIG_QUOTA
> - memset(&fi->i_dquot, 0, sizeof(fi->i_dquot));
> - fi->i_reserved_quota = 0;
> -#endif
> /* Will be used by directory only */
> fi->i_dir_level = F2FS_SB(sb)->dir_level;
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] f2fs: no need to initialize zero value for GFP_F2FS_ZERO
2018-03-21 12:25 [PATCH] f2fs: no need to initialize zero value for GFP_F2FS_ZERO Yunlong Song
2018-03-22 1:11 ` Chao Yu
@ 2018-03-22 2:08 ` Yunlong Song
2018-03-22 2:23 ` Chao Yu
1 sibling, 1 reply; 4+ messages in thread
From: Yunlong Song @ 2018-03-22 2:08 UTC (permalink / raw)
To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
Since f2fs_inode_info is allocated with flag GFP_F2FS_ZERO, so we do not
need to initialize zero value for its member any more.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
fs/f2fs/super.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0c1fe9b..42d564c 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -827,7 +827,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
/* Initialize f2fs-specific inode info */
atomic_set(&fi->dirty_pages, 0);
fi->i_current_depth = 1;
- fi->i_advise = 0;
init_rwsem(&fi->i_sem);
INIT_LIST_HEAD(&fi->dirty_list);
INIT_LIST_HEAD(&fi->gdirty_list);
@@ -839,10 +838,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
init_rwsem(&fi->i_mmap_sem);
init_rwsem(&fi->i_xattr_sem);
-#ifdef CONFIG_QUOTA
- memset(&fi->i_dquot, 0, sizeof(fi->i_dquot));
- fi->i_reserved_quota = 0;
-#endif
/* Will be used by directory only */
fi->i_dir_level = F2FS_SB(sb)->dir_level;
--
1.8.5.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] f2fs: no need to initialize zero value for GFP_F2FS_ZERO
2018-03-22 2:08 ` [PATCH v2] " Yunlong Song
@ 2018-03-22 2:23 ` Chao Yu
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2018-03-22 2:23 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
On 2018/3/22 10:08, Yunlong Song wrote:
> Since f2fs_inode_info is allocated with flag GFP_F2FS_ZERO, so we do not
> need to initialize zero value for its member any more.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-22 2:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 12:25 [PATCH] f2fs: no need to initialize zero value for GFP_F2FS_ZERO Yunlong Song
2018-03-22 1:11 ` Chao Yu
2018-03-22 2:08 ` [PATCH v2] " Yunlong Song
2018-03-22 2:23 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®