* [PATCH] fs/f2fs: avoid redundant convert of inline inode
[not found] <1442300909-34483-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2015-09-15 7:10 ` Zhang Zhen
2015-09-15 20:33 ` Jaegeuk Kim
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Zhen @ 2015-09-15 7:10 UTC (permalink / raw)
To: Jaegeuk Kim, cm224.lee, chao2.yu; +Cc: linux-f2fs-devel
Encrypted inode for regular file should not have inline_data.
Here we check encrypted inode before convert of inline inode
to avoid redundant convert.
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
fs/f2fs/data.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a82abe9..ec2270a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1535,6 +1535,9 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
size_t count = iov_iter_count(iter);
int err;
+ if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode))
+ return 0;
+
/* we don't need to use inline_data strictly */
if (f2fs_has_inline_data(inode)) {
err = f2fs_convert_inline_inode(inode);
@@ -1542,9 +1545,6 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
return err;
}
- if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode))
- return 0;
-
err = check_direct_IO(inode, iter, offset);
if (err)
return err;
--
1.9.1
.
------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs/f2fs: avoid redundant convert of inline inode
2015-09-15 7:10 ` [PATCH] fs/f2fs: avoid redundant convert of inline inode Zhang Zhen
@ 2015-09-15 20:33 ` Jaegeuk Kim
0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2015-09-15 20:33 UTC (permalink / raw)
To: Zhang Zhen; +Cc: linux-f2fs-devel
Hi Zhang,
On Tue, Sep 15, 2015 at 03:10:11PM +0800, Zhang Zhen wrote:
> Encrypted inode for regular file should not have inline_data.
> Here we check encrypted inode before convert of inline inode
> to avoid redundant convert.
When a new file is created in an encrypted dir, it does not set inline_data,
which returns false for the below f2fs_has_inline_data() all the time.
So, I don't think there happens any redundant conversion.
Thanks,
>
> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
> ---
> fs/f2fs/data.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index a82abe9..ec2270a 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1535,6 +1535,9 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
> size_t count = iov_iter_count(iter);
> int err;
>
> + if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode))
> + return 0;
> +
> /* we don't need to use inline_data strictly */
> if (f2fs_has_inline_data(inode)) {
> err = f2fs_convert_inline_inode(inode);
> @@ -1542,9 +1545,6 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
> return err;
> }
>
> - if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode))
> - return 0;
> -
> err = check_direct_IO(inode, iter, offset);
> if (err)
> return err;
> --
> 1.9.1
>
>
> .
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> 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] 2+ messages in thread
end of thread, other threads:[~2015-09-15 20:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1442300909-34483-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-09-15 7:10 ` [PATCH] fs/f2fs: avoid redundant convert of inline inode Zhang Zhen
2015-09-15 20:33 ` Jaegeuk Kim
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).