Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1071002pxu; Mon, 23 Nov 2020 10:52:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3C4QzqsMq5Da/DTeXD2Nw+uSWu0n2Rvygi8e4kXJdRrt1ZEmLoX9FGzLssDkXIgygp9bv X-Received: by 2002:aa7:c45a:: with SMTP id n26mr609460edr.112.1606157567626; Mon, 23 Nov 2020 10:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606157567; cv=none; d=google.com; s=arc-20160816; b=Gn8KYATvkGheVZRa2HwXxzjBm6m6OcL9e0EnX2XuS6IK7YxyS0zyH27cIPeSLNm9fv U9/R9VGZuqUSIFkf0CeoqwMPunuqpIBYKy2/qAupOISAjJC4Te32oAWk7jCWB1Uo9jAt t/iaFoTPiPiXgIDVCulYoaBxeo7m45x98Dy3xQTJOJiP0bxXhQjH7GCSUMph485yuKFt Rf+TzlmAqhcr7wIKLABy9gOntHkIGugasAkPZ2rR6ebi6UbbHo0H2/1p0AF8/ancnBkz CT9E1P/91Z6Mo+iglz9OLCT3DG6FoObn7j00dJPNLpDqxp6LR3kyBEuZJhREQZtGOsgt eaqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nIx8Gbhqw1B+pAnBSnUJZq0OeejW3o9RJBuJ0feFx1w=; b=zVhiaIhI71XBtAfmeSy4W1aDNxLkWO8tLYGFXqagDj5rvL4ViZmcc8L2vffaEIjVf8 5QYOTxT2kezHrZbS8dyvKFWJ/E6ZeJVxSBWO1G83QPp+sK2Bi6/em2CmDw3qd94qiAEC 0BV2couoAk0rfN3GqI5IIreIEICjDEraXX+tISJYh5pEChPdp9ruEnC+wKGXfVRovH3N O5XIevex48oRG5FFQO32g3msxCOqTcBa+S0QDflvwbkTpy0P04gKeRy72FG8YCExzacU BfPYlzW4zhnMHuGGTKIAsySfKa+tt0N+GVIKHFOkt31NCyeF1xUGhHjupkm5PcoifyH0 VMgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uaRHRv6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si7022352edc.153.2020.11.23.10.52.24; Mon, 23 Nov 2020 10:52:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uaRHRv6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726745AbgKWSsX (ORCPT + 99 others); Mon, 23 Nov 2020 13:48:23 -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