RE: [PATCH v3] f2fs: add fast symlink support
From: Chao Yu
Date: Wed Mar 18 2015 - 23:18:33 EST
Hi Wanpeng,
> -----Original Message-----
> From: Wanpeng Li [mailto:wanpeng.li@xxxxxxxxxxxxxxx]
> Sent: Thursday, March 19, 2015 7:02 AM
> To: Jaegeuk Kim
> Cc: Wanpeng Li; Changman Lee; Chao Yu; linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx;
> linux-fsdevel@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3] f2fs: add fast symlink support
>
> Hi Jaegeuk,
> On Wed, Mar 18, 2015 at 11:05:28AM -0700, Jaegeuk Kim wrote:
> >Hi,
> >
> >On Wed, Mar 18, 2015 at 04:58:52PM +0800, Wanpeng Li wrote:
> >> Hi Jaegeuk,
> >> On Tue, Mar 17, 2015 at 10:21:27AM -0700, Jaegeuk Kim wrote:
> >> >> - err = page_symlink(inode, symname, symlen);
> >> >> +
> >> >> + if (symlen > MAX_FAST_SYMLINK_SIZE) {
> >> >> + /* slow symlink */
> >> >> + inode->i_op = &f2fs_symlink_inode_operations;
> >> >> + inode->i_mapping->a_ops = &f2fs_dblock_aops;
> >> >> + err = page_symlink(inode, symname, symlen);
> >> >> + } else {
> >> >> + /* fast symlink */
> >> >> + struct page *node_page;
> >> >> +
> >> >> + inode->i_op = &f2fs_fast_symlink_inode_operations;
> >> >> + node_page = get_node_page(sbi, inode->i_ino);
> >> >> + memcpy((char *)&F2FS_INODE(node_page)->i_addr, symname, symlen);
> >> >
> >> >This is mostly likewise the inline_data flow.
> >> >As of now, I can't recommend using any i_addr region, since we need to handle
> >> >many cases such as truncation, roll-forward recovery, and fsck/dump tools.
> >> >
> >> >It is more sensible to enable inline_data by default, isn't it?
> >>
> >> Do you mean to replace the codes above by something like
> >> f2fs_write_inline_data()?
> >
> >I meant the mount option, inline_data.
> >Currently, f2fs doesn't set that option at mount time, but I thought that we
> >can set it by default since it becomes stable.
>
> So I think you mean my codes should memcpy i_addr[1~872] instead of i_addr[0~872], right?
I think what Jaegeuk means is that we can use inline_data in f2fs by default with
patch like below firstly: