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.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 D02C4C48BDF for ; Mon, 21 Jun 2021 02:40:58 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9349560E0C; Mon, 21 Jun 2021 02:40:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9349560E0C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lv9rs-0004hL-Fx; Mon, 21 Jun 2021 02:40:56 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv9rb-0004fa-AR for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Jun 2021 02:40:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JgjIeekDbanTO+e1c9pWtywPrBcSZp7nltvbQa4+mmQ=; b=nDBZLo7u+cqnrmw8zj+J/feR6m nv/NUg9fQj1x2vbR7P7ijpNMadjYodoFOw4vtTmQoyCr5RtuUBDq1wb6LrLgoJH3Eot3SydfElDgs bBG/DAhoL0XZCwzmDGyj4z3uQoghrQfufd72gL4BCaIfCZZ8fHaAK7rHIb8FTjHmCyVo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=JgjIeekDbanTO+e1c9pWtywPrBcSZp7nltvbQa4+mmQ=; b=X DZjli4HJ3Zlk7LIn0zzyWhNj39I77Qz+3Fq7Dke5KDboVw7rXxjfGwDXNydNCWHKBlv4B52wCKBfu 1bq7YEyS8Fc+At1DtJGxhooFA19JHQnLmQNtd1bKGz6xYE0v2OebC2lfBEoFHj+TXYce5vFSkfGlz /RzFG4oS8XFOcfvs=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lv9rV-0005Ed-90 for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Jun 2021 02:40:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A9506117A; Mon, 21 Jun 2021 02:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624243229; bh=kvA/863X51D5uuCExsqTAZJw9OimySqMMSVIU2Op2YE=; h=From:To:Cc:Subject:Date:From; b=CZv9pbMWPrzni0vevDUjAs3JnoDYWodl76e62ay6jo0FyyVcun5R/YRxyneOIAngX zKRoNdMairPxKeihcsJa7McHeMdVuEHPzjQ/Wywt/afdKsyZg9HglfxXvDnY04oHUm OHyqeWq3uG1P4GXh9djNKNsOYYD2FXdxYlPoYviW6utjMIoxWvQ2EaTGe+zRGCuHHV KZXGnYw4FfgD3tCq/vd4pXmV1KIL3vjEAcwRXZzjLOX9CjwSBzazEIJMgh8CGhgj1q sHLoTnmChbrJrROcL8OmY/XEHSMnkeENN+h90537IrgNw7XognJLWTGCmH2QMhUyca aBk07OdNgHKyA== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Date: Sun, 20 Jun 2021 19:40:27 -0700 Message-Id: <20210621024027.1511092-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog MIME-Version: 1.0 X-Headers-End: 1lv9rV-0005Ed-90 Subject: [f2fs-dev] [PATCH] f2fs: enable extent cache for compression files in read-only X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim , Daeho Jeong Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Daeho Jeong Let's allow extent cache for RO partition. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index d84e78dabdbe..16ce1ade9fa6 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3148,25 +3148,6 @@ static inline bool is_dot_dotdot(const u8 *name, size_t len) return false; } -static inline bool f2fs_may_extent_tree(struct inode *inode) -{ - struct f2fs_sb_info *sbi = F2FS_I_SB(inode); - - if (!test_opt(sbi, EXTENT_CACHE) || - is_inode_flag_set(inode, FI_NO_EXTENT) || - is_inode_flag_set(inode, FI_COMPRESSED_FILE)) - return false; - - /* - * for recovered files during mount do not create extents - * if shrinker is not registered. - */ - if (list_empty(&sbi->s_list)) - return false; - - return S_ISREG(inode->i_mode); -} - static inline void *f2fs_kmalloc(struct f2fs_sb_info *sbi, size_t size, gfp_t flags) { @@ -4201,6 +4182,26 @@ F2FS_FEATURE_FUNCS(casefold, CASEFOLD); F2FS_FEATURE_FUNCS(compression, COMPRESSION); F2FS_FEATURE_FUNCS(readonly, RO); +static inline bool f2fs_may_extent_tree(struct inode *inode) +{ + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); + + if (!test_opt(sbi, EXTENT_CACHE) || + is_inode_flag_set(inode, FI_NO_EXTENT) || + (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && + !f2fs_sb_has_readonly(sbi))) + return false; + + /* + * for recovered files during mount do not create extents + * if shrinker is not registered. + */ + if (list_empty(&sbi->s_list)) + return false; + + return S_ISREG(inode->i_mode); +} + #ifdef CONFIG_BLK_DEV_ZONED static inline bool f2fs_blkz_is_seq(struct f2fs_sb_info *sbi, int devi, block_t blkaddr) -- 2.32.0.288.g62a8d224e6-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel