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.zh...@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 ------------------------------------------------------------------------------ _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel