From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33418C2D0E4 for ; Mon, 23 Nov 2020 18:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9EB020684 for ; Mon, 23 Nov 2020 18:48:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uaRHRv6M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728841AbgKWSsY (ORCPT ); Mon, 23 Nov 2020 13:48:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:43948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbgKWSsX (ORCPT ); Mon, 23 Nov 2020 13:48:23 -0500 Received: from gmail.com (unknown [104.132.1.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A53E120657; Mon, 23 Nov 2020 18:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606157302; bh=5y8zxaS7HSYEX0hSfqLUMG8rA06A+WPmDFXRVahf/64=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uaRHRv6Mf58ZDhI+8qZXP+gdX6+8yOcMoYxj+x8S1b1vIrbKw/r2zQ7LrT/TOXzG9 Tb17uTUZhk0dWzO5GItPJpEJCAD2sJM4+VJtUL0/2hTySeIAv+1DL8cwEV6QBbNJ4Z h1//GrJOKMpcsVy896j3oGN1vSJu6FjsFLqCqZ/E= Date: Mon, 23 Nov 2020 10:48:21 -0800 From: Eric Biggers To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE Message-ID: <20201123184821.GB3694916@gmail.com> References: <20201123031751.36811-1-daeho43@gmail.com> <20201123031751.36811-2-daeho43@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201123031751.36811-2-daeho43@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 12:17:51PM +0900, Daeho Jeong wrote: > From: Daeho Jeong > > 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 > --- > 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