linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	cm224.lee@samsung.com, chao2.yu@samsung.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] fs/f2fs: avoid redundant convert of inline inode
Date: Tue, 15 Sep 2015 15:10:11 +0800	[thread overview]
Message-ID: <55F7C453.2050000@huawei.com> (raw)
In-Reply-To: <1442300909-34483-1-git-send-email-zhenzhang.zhang@huawei.com>

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


.





------------------------------------------------------------------------------

       reply	other threads:[~2015-09-15  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1442300909-34483-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-09-15  7:10 ` Zhang Zhen [this message]
2015-09-15 20:33   ` [PATCH] fs/f2fs: avoid redundant convert of inline inode Jaegeuk Kim

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=55F7C453.2050000@huawei.com \
    --to=zhenzhang.zhang@huawei.com \
    --cc=chao2.yu@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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 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).