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=-7.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,URIBL_DBL_ABUSE_MALW,USER_AGENT_GIT autolearn=unavailable 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 10E3EC33CB3 for ; Sat, 1 Feb 2020 15:09:07 +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 D357B20661 for ; Sat, 1 Feb 2020 15:09:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="fF2t/DVR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="ThEZ97cS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PpI0y0aB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D357B20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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 1ixuOP-0001S3-Rf; Sat, 01 Feb 2020 15:09:05 +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 1ixuOM-0001RI-9F for linux-f2fs-devel@lists.sourceforge.net; Sat, 01 Feb 2020 15:09:02 +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=Oin9omXum+K1vH3lIpfU4JhSOHeXHB2IvOy+kBmeirY=; b=fF2t/DVR3SYnNAgT5UqXLSHmx/ hthVAHkCzeZ6tCPSSy9/jCKM+GbX/8br1vDVImR5LUDnrt1eF/6ueXT8MqxKwrd53346tucoldiRy yOQrUGmcqYKjdfzSOApIlZrGN9thdiabC22HsDD1JXzTd2Omb4kTYH9te8enWJ0gTid0=; 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=Oin9omXum+K1vH3lIpfU4JhSOHeXHB2IvOy+kBmeirY=; b=T hEZ97cSVCtUZRMgOxN+fx3zbYi5bwjLxYVdouRqljl/BGN02vknQ8P4OfDNxsITWPuXYs6IOCzq2J W0+JJAlbGofkB7xYRuyWAJfDS+b9+c8bQdM/A6lK1jEjfDPHwBZo3pB3MEnYR11+WbVnXeP8zdL/H wfWzgMQDBkHuJNQ8=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ixuOI-007HiS-Ao for linux-f2fs-devel@lists.sourceforge.net; Sat, 01 Feb 2020 15:09:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=Oin9omXum+K1vH3lIpfU4JhSOHeXHB2IvOy+kBmeirY=; b=PpI0y0aBsE6Y602fQ4rH5EZff iaqvLOaNDrb0ZLJFmk6+Hr0Qn04JlYzFLXKwGa2kuizi92mOUR/DmJ1+ss0rC2nu9OcHz0GseFKve EuvAeX418NwSs4ncInCjGkocnIZQsjHPInqkRdDCIq6Fe1mZ4THnf+YfJ36RIxT/JGMC2driUPaF2 coau+YuI1FCzeCCyWk3pj/d+pZrx8llnXof2UfSYyyJNwSgrxYWWEK6BFCDhDHDLvZ2cifPT77FX/ VeuIo8B7GLPFha2ji58aWIwAMzbBUwzeWKjcKWtNqq7HMqQEHw7apEmLHpHv7f4dI6xTOdiMZD/DS TS9Jn8spw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixuNa-0004fn-Ja; Sat, 01 Feb 2020 15:08:14 +0000 From: Matthew Wilcox To: Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Date: Sat, 1 Feb 2020 07:08:07 -0800 Message-Id: <20200201150807.17820-1-willy@infradead.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-Headers-End: 1ixuOI-007HiS-Ao Subject: [f2fs-dev] [PATCH] f2fs: Make f2fs_readpages readable again 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: "Matthew Wilcox \(Oracle\)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: "Matthew Wilcox (Oracle)" Remove the horrendous ifdeffery by slipping an IS_ENABLED into f2fs_compressed_file(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 6 ------ fs/f2fs/f2fs.h | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8bd9afa81c54..41156a8f60a7 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2203,7 +2203,6 @@ int f2fs_mpage_readpages(struct address_space *mapping, goto next_page; } -#ifdef CONFIG_F2FS_FS_COMPRESSION if (f2fs_compressed_file(inode)) { /* there are remained comressed pages, submit them */ if (!f2fs_cluster_can_merge_page(&cc, page->index)) { @@ -2230,14 +2229,11 @@ int f2fs_mpage_readpages(struct address_space *mapping, goto next_page; } read_single_page: -#endif ret = f2fs_read_single_page(inode, page, max_nr_pages, &map, &bio, &last_block_in_bio, is_readahead); if (ret) { -#ifdef CONFIG_F2FS_FS_COMPRESSION set_error_page: -#endif SetPageError(page); zero_user_segment(page, 0, PAGE_SIZE); unlock_page(page); @@ -2246,7 +2242,6 @@ int f2fs_mpage_readpages(struct address_space *mapping, if (pages) put_page(page); -#ifdef CONFIG_F2FS_FS_COMPRESSION if (f2fs_compressed_file(inode)) { /* last page */ if (nr_pages == 1 && !f2fs_cluster_is_empty(&cc)) { @@ -2257,7 +2252,6 @@ int f2fs_mpage_readpages(struct address_space *mapping, f2fs_destroy_compress_ctx(&cc); } } -#endif } BUG_ON(pages && !list_empty(pages)); if (bio) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5355be6b6755..398d5a1f2867 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2706,7 +2706,8 @@ static inline int f2fs_has_inline_xattr(struct inode *inode) static inline int f2fs_compressed_file(struct inode *inode) { - return S_ISREG(inode->i_mode) && + return IS_ENABLED(CONFIG_F2FS_FS_COMPRESSION) && + S_ISREG(inode->i_mode) && is_inode_flag_set(inode, FI_COMPRESSED_FILE); } -- 2.24.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel