Jaegeuk, My mistake~
Eric, What I want is like do_page_cache_ra(), but I used page_cache_ra_unbounded() directly, because we already checked that read is within i_size. Or we could use do_page_cache_ra(), but it might do the same check in it again. What do you think? I could add some description about these in Documentation/filesystems/f2fs.rst and I implemented tests internally. 2020년 11월 24일 (화) 오전 3:48, Eric Biggers <ebigg...@kernel.org>님이 작성: > > On Mon, Nov 23, 2020 at 12:17:51PM +0900, Daeho Jeong wrote: > > From: Daeho Jeong <daehoje...@google.com> > > > > Added two ioctl to decompress/compress explicitly the compression > > enabled file in "compress_mode=user-based" mount option. > > > > Using these two ioctls, the users can make a control of compression > > and decompression of their files. > > > > Signed-off-by: Daeho Jeong <daehoje...@google.com> > > --- > > fs/f2fs/file.c | 181 +++++++++++++++++++++++++++++++++++++- > > include/uapi/linux/f2fs.h | 2 + > > 2 files changed, 182 insertions(+), 1 deletion(-) > > > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > > index be8db06aca27..e8f142470e87 100644 > > --- a/fs/f2fs/file.c > > +++ b/fs/f2fs/file.c > > @@ -4026,6 +4026,180 @@ static int f2fs_ioc_set_compress_option(struct file > > *filp, unsigned long arg) > > return ret; > > } > > > > +static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len) > > +{ > > + DEFINE_READAHEAD(ractl, NULL, inode->i_mapping, page_idx); > > + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > > + struct address_space *mapping = inode->i_mapping; > > + struct page *page; > > + pgoff_t redirty_idx = page_idx; > > + int i, page_len = 0, ret = 0; > > + > > + page_cache_ra_unbounded(&ractl, len, 0); > > Using page_cache_ra_unbounded() here looks wrong. See the comment above > page_cache_ra_unbounded(). > > > static long __f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned > > long arg) > > { > > switch (cmd) { > > @@ -4113,6 +4287,10 @@ static long __f2fs_ioctl(struct file *filp, unsigned > > int cmd, unsigned long arg) > > return f2fs_ioc_get_compress_option(filp, arg); > > case F2FS_IOC_SET_COMPRESS_OPTION: > > return f2fs_ioc_set_compress_option(filp, arg); > > + case F2FS_IOC_DECOMPRESS_FILE: > > + return f2fs_ioc_decompress_file(filp, arg); > > + case F2FS_IOC_COMPRESS_FILE: > > + return f2fs_ioc_compress_file(filp, arg); > > default: > > return -ENOTTY; > > } > > Where is the documentation and tests for these new ioctls? > > - Eric