Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2592513pxu; Mon, 7 Dec 2020 10:17:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOQVqG04kElJNAKlJcDFP6UASKwsyZWhFpVFaG3uHKQG+8QBNAV3EaQIjejo4USYEHxpfj X-Received: by 2002:a05:6402:b4d:: with SMTP id bx13mr21187352edb.93.1607365024945; Mon, 07 Dec 2020 10:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607365024; cv=none; d=google.com; s=arc-20160816; b=z76eXdW9kSwr3Gu0aNzMkn6CI5PD10/xCdkRACkkeE2hSUZz1SdtZWI6LFregK86yF PSu6JMWdZU8dJ+ZQcd9RKOofPXelXvGhGFNlKlYCQd/6eScF7unA/KJNcGZkwRQJu0MC TVUU6qJjQwZ+EhIeooqcLPXSo2kGF/FMJI+Re26kHhEVWauKR/cSq3TuztpqFTZIekCH K4dIRS/nx6nr9yswQYVqZM6cb4GH06dTSgWxE4yZnA56UvRYRrRV1ljLznPZ4p+4O9lR WEiOt+xUoxQt13biSIUdRUN3X8mlf1W6qnI0x+NpxAi2FmwhypcC6d4BjqIiIbwlLjQa o37g== 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:dkim-signature:date; bh=0BshWBmeSejK819DyzjjqY2Z/07/5z+4u5gQuDy13vU=; b=hyVDfUU/nqpOEqYtSUAtkpFyDFaD2OsduIg7l/6dLfPEIlG33DoaKhSZ1Didyw5Jv3 Q6DItgraP/GSLeKktROjze47ksqPWkGwA8jCtMGcD3UE57dzX9siu4LyqTwaVj+2fEUo AMLGeKNMNOaBeqf4EPdNdS4N3UlodD79pXRsH0nmQ0bsnEpVJi+BzKBoSG4jCrbBSlRv gHlE3foEt1eM6qrad5OdhozsQQY5s+E5Fq8IMUc4S4XCmOqCqm3eUYK4LjFK5cE4oEtT aniO7tf+QxXQY/42/Jzaw62FIzqV0a6jsgDXzEpoywifY6VvDkiaIBn/dgpfWUaiVBW+ Il5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MDj6p955; 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 c7si8376039edr.193.2020.12.07.10.16.40; Mon, 07 Dec 2020 10:17:04 -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=k20201202 header.b=MDj6p955; 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 S1726137AbgLGSNt (ORCPT + 99 others); Mon, 7 Dec 2020 13:13:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:56594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbgLGSNs (ORCPT ); Mon, 7 Dec 2020 13:13:48 -0500 Date: Mon, 7 Dec 2020 10:13:06 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607364787; bh=WA4Z5WMSDn1c5FX1KInte6wma4gAm1WZIUR0t0bLAeA=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=MDj6p9550nh/kmo2eBV+sSK1bKA6XsgWLdqpQDky9RqdxoFAv8T07+xDVmGRAgFRi sAE23IFyV5G70emWahdMg6pl7bTorbHxpSFQ4SdLFqb7ll5p7fm5ZD8TqqOsGZ8Fqs GmjC9SmJHqh6E9KmujPd4tY+RCjeW+mRr4R27jqzV5d6Ql5gekLjwqjgAmtGlubt26 mc2ysCjWRr9BG37SWFZAuog1V8aFIqjnxlztPkxRK3KvMmM/j5VoTlb7YsEwPOoL+N CH18aO/t3ffpDw39PptLXRYbl7qzaDMx8bIfUVLxIx3H5A1xFNuIj/dST+Mcv2iMaD jPH2t3GO84VrQ== From: Eric Biggers To: Chao Yu Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH v5 RESEND] f2fs: compress: add compress_inode to cache compressed blocks Message-ID: References: <20201207095220.73093-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201207095220.73093-1-yuchao0@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 05:52:20PM +0800, Chao Yu wrote: > diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst > index dae15c96e659..fd413d319e93 100644 > --- a/Documentation/filesystems/f2fs.rst > +++ b/Documentation/filesystems/f2fs.rst > @@ -268,6 +268,9 @@ compress_mode=%s Control file compression mode. This supports "fs" and "user" > choosing the target file and the timing. The user can do manual > compression/decompression on the compression enabled files using > ioctls. > +compress_cache Support to use address space of inner inode to cache > + compressed block, in order to improve cache hit ratio of > + random read. What is an "inner inode"? Mount options should be understandable without understanding filesystem implementation details. > +const struct address_space_operations f2fs_compress_aops = { > + .releasepage = f2fs_release_page, > + .invalidatepage = f2fs_invalidate_page, > +}; > + > +struct address_space *COMPRESS_MAPPING(struct f2fs_sb_info *sbi) > +{ > + return sbi->compress_inode->i_mapping; > +} > + > +void invalidate_compress_page(struct f2fs_sb_info *sbi, block_t blkaddr) > +{ > + if (!sbi->compress_inode) > + return; > + invalidate_mapping_pages(COMPRESS_MAPPING(sbi), blkaddr, blkaddr); > +} Global functions should have the "f2fs_" prefix. - Eric