From patchwork Thu Jun 29 21:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 114457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9944257vqr; Thu, 29 Jun 2023 15:11:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kRy+Tjq57rS1PzYEa8NnkirPyX6JPTlT3yyI/IZFwRWJ59eB+QwPPJQAvrWBQK6JVr07d X-Received: by 2002:a05:6a20:1586:b0:11f:7829:6d6c with SMTP id h6-20020a056a20158600b0011f78296d6cmr1279729pzj.3.1688076710956; Thu, 29 Jun 2023 15:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688076710; cv=none; d=google.com; s=arc-20160816; b=aeOSodf1Q4Ek82VsdGDKS+m8qoDFiLO7DC287KHwUEm56nnzTAZzELIET4F7FklQ7+ DZfXUyMUJdWLSEuuJlW01JcIkCCRcruSVmBCAhs6xDzQFPqyGY0qKCTidLknHVaYs9kz ur5ZARWM2gy7Jp3ptfKkWjhkp1FdaMjpHxNeGqgh5vvoXXWJ8hI4yG+KAiZoGjVi2upC hFYPdl60/ROJslkmE1AuMDGRjbNRjroj2KfQzXJEBMXyduS6s1YohcQRMZ8/P5lxCjDk pq1E68AF8nSuogoY1nK04B6sr3bNC5keFtDqCNvGyblgrkqiCjzFRAgXbMnnCQSBknjZ NLQQ== 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=XHh/jI/bdXc93KNn2kIm/kDXKE1qBvxy+TINr4YmCdA=; fh=2/OepbD16sII06AHmQTJgD7xcw2OMNoUEY9t7KuTeGw=; b=Or6O1APmGI7bHHxm/rC5Sw/6aYEOBnIXdSdOT8U5oh8Wvro5OVz1cEa5Zz50g4I/51 +Ss1Xg4cpP3psvVhbU6ebIHyakwlEXHCOPv9GnHq4SF87lGWavEtf6C4CVFqnq4isX8f Amnp3AWBWmXRfxJ9BVQnrTQTegZrbzIFe7vdKK3/b+wEU52JEj+WKztVp1bl43yfRIzZ abQYCuukShrVg0wyOktTIHWBD/E0yYGAiraWGRo8UNMpC4tF4dfSgzchWOLRu557UOOs Ix2zdsvyMbxHv0RzF766kA7zPK7pXSXQBU3Y/dLzXJSnKSAFA8AzMUPMAX40vzjRj2qy G82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=k0Fa9zvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902c40900b001afd000029bsi11349078plk.581.2023.06.29.15.11.36; Thu, 29 Jun 2023 15:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=k0Fa9zvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbjF2Vtx (ORCPT + 99 others); Thu, 29 Jun 2023 17:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231787AbjF2Vtq (ORCPT ); Thu, 29 Jun 2023 17:49:46 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A068530C4 for ; Thu, 29 Jun 2023 14:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1688075378; bh=Js+wviSqbRoPvM+R8wP9vofgFSlATI7fQH4Z+TLAhBM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=k0Fa9zvD/neTdeo9mrtsWdPMl5QyAU47R0HPgkV0n3DfUxzs+HW9bCbv4lnoCY40F er7hsbCoE5Bc+gThNcAGF4dxuvBZu8KLnBmCVsvuJ1JIMe3YJ4eSxIoRcyB4A8cL3m BJTdzrUAxFN56lr07AN7OrVIsIaAxV35ZwLdNjKs= Received: by b221-2.in.mailobj.net [192.168.90.22] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 29 Jun 2023 23:49:38 +0200 (CEST) X-EA-Auth: bfXx7m6mBHf0bbbEInyNo09c2pO3FAllciMTjbbMOaPyxDfwVkN/aN/2e4+nmIyLXNLywzBzQgffhdOIJnAiNivQauo1214l Date: Fri, 30 Jun 2023 03:19:29 +0530 From: Deepak R Varma To: Bob Peterson , Andreas Gruenbacher , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Cc: Ira Weiny , "Fabio M. De Francesco" , Sumitra Sharma , Deepak R Varma Subject: [PATCH v3 1/6] gfs2: Replace kmap_atomic() by kmap_local_page() in stuffed_readpage Message-ID: <1955d9c440240f4c97efd80f3efca550871fe0ef.1688073459.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770076725375224913?= X-GMAIL-MSGID: =?utf-8?q?1770076725375224913?= kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in stuffed_readpage(). kmap_atomic() disables page-faults and preemption (the latter only for !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in stuffed_readpage() does not depend on the above-mentioned side effects. Therefore, a mere replacement of the old API with the new one is all that is required (i.e., there is no need to explicitly add any calls to pagefault_disable() and/or preempt_disable()). Suggested-by: Fabio M. De Francesco Signed-off-by: Deepak R Varma Reviewed-by: Fabio M. De Francesco --- Changes in v3: - split into 2 patches - included in the patch set. Was sent as standalone patch previously Changes in v2: - Update patch description to correct the replacement function name from kmap_local_page to kmap_local_folio fs/gfs2/aops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 3b41542d6697..3eac4f2f5c27 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -432,10 +432,10 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page) if (error) return error; - kaddr = kmap_atomic(page); + kaddr = kmap_local_page(page); memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), dsize); memset(kaddr + dsize, 0, PAGE_SIZE - dsize); - kunmap_atomic(kaddr); + kunmap_local(kaddr); flush_dcache_page(page); brelse(dibh); SetPageUptodate(page);