Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21368408rwd; Thu, 29 Jun 2023 15:13:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlEO5+/JZXS24+5s9Dx0Z+sODzvcVXUSU48ZpwxAeYl2+GYXONpprq+aDrTDaJwBaPH2LcKg X-Received: by 2002:a17:902:c94c:b0:1b5:674d:2aa5 with SMTP id i12-20020a170902c94c00b001b5674d2aa5mr1371647pla.13.1688076792578; Thu, 29 Jun 2023 15:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688076792; cv=none; d=google.com; s=arc-20160816; b=pV/WDHoDtLtZuzhz3FGxceqYQLUf9eoIlVokdbmSGQmjmDS0PAtcwI9d2ItnoG+J06 Bp6WfOnddFor+6H0CeFt3xQ2Wz5Wt4zjze68ylPLdqJGuKpgWyI/OfqhNTZ5hlYzkUWK R/Y/jIo3XNIr8CLF8q/q3ArmNRAnK6Oftf0bz6T3qQimw4NqL7Ntof+YlA6ZkFeMCMpW 4Q3n93VLqZCSP1URcGjIDwAu3cDYaXMO9UTo6vVtegIFwLeRardt5XLKxDyQIygbQviS c0adSPqa6lClhn/bs0ET9wS/iZ0cIoLvc8ACJhQRFi6lGrrhkQYucGvUQDbt6m32iPb8 q2ew== 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=VqAL1afVs3VwQQxoVXsOQ91yHzULT56tCGgI4gabYgw=; fh=2/OepbD16sII06AHmQTJgD7xcw2OMNoUEY9t7KuTeGw=; b=U344dhGHyPOSRgafCdWXdAzIcTTcWi94mf9CGMKVBboFR88S5eNkKyWmClosiUNQg+ J2TDp8DTxaMNx8FrL9p6Gn0QjH2y0ZYcF5gDoIlL683vOlt9E7stllW52D3ofmUOB5IA 7YR4IG/RPMwHSIGjXpUNU3S2O1ruJwUiNZoVuc/4MJVoQFlHVEy4iQ9+Oow9m2DqMD85 1xvyssewxAIltoU5/WhJXFSWIcd9C9gqpRxU6bFy2takR758zBxj2EEBJ+0vIH+oQZdm iNt8zwFCqIJvoZJdpsWZ8aJFBDGzV63JRKmAiWxDb/MnLQuaQvrdSl6bJ/4wIcmWlXZt Dn0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=QMyCcPAU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a1709026e0900b001b83767e879si3558461plk.266.2023.06.29.15.12.59; Thu, 29 Jun 2023 15:13:12 -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=QMyCcPAU; 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 S230327AbjF2Vvd (ORCPT + 99 others); Thu, 29 Jun 2023 17:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjF2Vvc (ORCPT ); Thu, 29 Jun 2023 17:51:32 -0400 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7180730D1 for ; Thu, 29 Jun 2023 14:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1688075487; bh=C7lSYHOPm/Z4sI0GQts4IYgG0YiR3DHTQkmvN2BfzJ4=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=QMyCcPAU/yNJ7M8ZoRbSzy+TrDT7NltcM2XbOYbAuqoUHgof5TyMaFqFkhP+XrsxV 4OamwRXXx4SMlX+QsORhYPxfNVfIbf5ZKOF2GrnCVzzH5RFoG+qCaNqj4Il/RC1s3d 3oGZ3w/Cqg8MdcOw68SSXakl6nPfeZUkYxtaExvU= Received: by b221-1.in.mailobj.net [192.168.90.21] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 29 Jun 2023 23:51:27 +0200 (CEST) X-EA-Auth: P5HCG1ciElwbYgm7onYtMKqytCsT9R2NvTWwxi5496GTptuJln+k/TlBbmf/Liqh+qR0xtiWqaFWGGY8kby6/5SK7yiAPc69 Date: Fri, 30 Jun 2023 03:21:17 +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 4/6] gfs2: Replace kmap_atomic() by kmap_local_page() in lops.c Message-ID: <4817527acb9e015b3c6929517993ea50ba3427ad.1688073459.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in following functions of lops.c: - gfs2_jhead_pg_srch() - gfs2_check_magic() - gfs2_before_commit() 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 --- Changes in v3: - Patch included in patch series Changes in v2: - None fs/gfs2/lops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 1902413d5d12..a7c2296cb3c6 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -427,7 +427,7 @@ static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, { struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); struct gfs2_log_header_host lh; - void *kaddr = kmap_atomic(page); + void *kaddr = kmap_local_page(page); unsigned int offset; bool ret = false; @@ -441,7 +441,7 @@ static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, } } } - kunmap_atomic(kaddr); + kunmap_local(kaddr); return ret; } @@ -626,11 +626,11 @@ static void gfs2_check_magic(struct buffer_head *bh) __be32 *ptr; clear_buffer_escaped(bh); - kaddr = kmap_atomic(bh->b_page); + kaddr = kmap_local_page(bh->b_page); ptr = kaddr + bh_offset(bh); if (*ptr == cpu_to_be32(GFS2_MAGIC)) set_buffer_escaped(bh); - kunmap_atomic(kaddr); + kunmap_local(kaddr); } static int blocknr_cmp(void *priv, const struct list_head *a, @@ -699,10 +699,10 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, void *kaddr; page = mempool_alloc(gfs2_page_pool, GFP_NOIO); ptr = page_address(page); - kaddr = kmap_atomic(bd2->bd_bh->b_page); + kaddr = kmap_local_page(bd2->bd_bh->b_page); memcpy(ptr, kaddr + bh_offset(bd2->bd_bh), bd2->bd_bh->b_size); - kunmap_atomic(kaddr); + kunmap_local(kaddr); *(__be32 *)ptr = 0; clear_buffer_escaped(bd2->bd_bh); unlock_buffer(bd2->bd_bh); -- 2.34.1