From patchwork Tue Aug 9 02:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Shaoqin" X-Patchwork-Id: 12939294 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94971C00140 for ; Tue, 9 Aug 2022 02:33:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD81F6B0071; Mon, 8 Aug 2022 22:33:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B85686B0072; Mon, 8 Aug 2022 22:33:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4DC48E0001; Mon, 8 Aug 2022 22:33:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 96D5D6B0071 for ; Mon, 8 Aug 2022 22:33:51 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 59CB74089C for ; Tue, 9 Aug 2022 02:33:51 +0000 (UTC) X-FDA: 79778483862.06.C7F32AE Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf31.hostedemail.com (Postfix) with ESMTP id 315B620160 for ; Tue, 9 Aug 2022 02:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660012430; x=1691548430; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DcvovoVmdksGZwiTR1O+x3IyDAP+vKNhNIIHB5O4qlY=; b=fCrw0hLGN3BaxnTWVXPyiO6Tra4i2Ccb3nD4WLRVnGUKF2UhGurLc156 Y2kWSf3j7jPzby5s1HxhhhRol7hhM9LCloG9fYfmgvDAMsM1O2UpNy5eV 5pGvFHO3JUr0Dcem5q5a9gLrvFxPWbGS1TFXF27Me2D/YMRDIUQIRYvJk wF2t9SEZovOAMTtyHL3HNQl1fS29Ikx8xwAwRn0DcmUgm2exjKn4g8Mjh XSklkgFborJviLdGqH+6jDYK6l5Cxi5Bv8Q3tGRDjPJeeJFz/ryG2PdLL 0f2bbO+B/qyXQsv/3oSqrTiVq3TCF+9fUzdXDueFXSsMMOcHQZzSSxYst Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10433"; a="289493829" X-IronPort-AV: E=Sophos;i="5.93,223,1654585200"; d="scan'208";a="289493829" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 19:33:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,223,1654585200"; d="scan'208";a="932311003" Received: from q.bj.intel.com ([10.238.154.102]) by fmsmga005.fm.intel.com with ESMTP; 08 Aug 2022 19:33:46 -0700 From: shaoqin.huang@intel.com To: linux-mm@kvack.org, willy@infradead.org Cc: Shaoqin Huang , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] filemap: Convert page_endio() to use a folio Date: Tue, 9 Aug 2022 10:32:56 +0800 Message-Id: <20220809023256.178194-1-shaoqin.huang@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660012430; a=rsa-sha256; cv=none; b=k8jOoQdhmjHc8TchwjYQKpEvL+VNiQn3W33vvZF+2Daapt2Ktx4kV07CYvWqIPicmSbs9T iLPXYPbsx3yX4oZgHAtQ33xGQd1PLrw9C237OMyGKhCsYmRHMnV7I99NphVJvdV+kxrpsW cRpRG1im2OaeAtu37ffP7Xu5XALXr78= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=fCrw0hLG; spf=pass (imf31.hostedemail.com: domain of shaoqin.huang@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660012430; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=oK53sS15LtZ207GLi9iwnwTFVO+ADeliLeiHUlgi5/Q=; b=QiuQYtK974BtJTkiwns6ewhKXoHszPf5eB2Ckck+N/GzJQxKU1IjoMC7ud1nanarunSwQx 5nIch9f2k11a1i36VrCPm2wPdBPOwg0AOEsuj/lSwwRXM8/GD46jDgCmcZhW7kSv5kxG0Q NK7qNpwHg47NirhPLwmmbIGh8HjBRv8= X-Rspamd-Queue-Id: 315B620160 X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf31.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=fCrw0hLG; spf=pass (imf31.hostedemail.com: domain of shaoqin.huang@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: kpu3tm6w3cqit1twj8uotetekb8s5czj X-HE-Tag: 1660012429-939197 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Shaoqin Huang Replace three calls to compound_head() with one. Signed-off-by: Shaoqin Huang --- mm/filemap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 15800334147b..cb740a6b7227 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1633,24 +1633,26 @@ EXPORT_SYMBOL(folio_end_writeback); */ void page_endio(struct page *page, bool is_write, int err) { + struct folio *folio = page_folio(page); + if (!is_write) { if (!err) { - SetPageUptodate(page); + folio_mark_uptodate(folio); } else { - ClearPageUptodate(page); - SetPageError(page); + folio_clear_uptodate(folio); + folio_set_error(folio); } - unlock_page(page); + folio_unlock(folio); } else { if (err) { struct address_space *mapping; - SetPageError(page); - mapping = page_mapping(page); + folio_set_error(folio); + mapping = folio_mapping(folio); if (mapping) mapping_set_error(mapping, err); } - end_page_writeback(page); + folio_end_writeback(folio); } } EXPORT_SYMBOL_GPL(page_endio);