Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp343302rdb; Mon, 22 Jan 2024 06:07:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxc0pnoxYoazJ8ON9y3UpTuWj1pBYnCYTsYV3dBwoyIu9r7z2iM1l34Q9DqagGUtvF7K3R X-Received: by 2002:a05:6808:318c:b0:3bd:949b:330c with SMTP id cd12-20020a056808318c00b003bd949b330cmr6283890oib.23.1705932438416; Mon, 22 Jan 2024 06:07:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705932438; cv=pass; d=google.com; s=arc-20160816; b=X42ZcTP4d0pboM+zN1tGBHKGGd8VocyqIsSwXc6+ZRKISZ7wQemrdM9C1OXsnMAcL2 DzscpcK7G7PGTQqNZRUgM7haQKoOapzhcEhbdeZatc/kxvfVh592Y+CHBEpWmFkOgg2h X6yyDbIR+CxxRTHfHBlFmcJnAIXQD9rB7mVQxDWKU8GMR5iBv/b5wmqr34sA6pw+K959 ZHX2YpxmTYdfdG2e4B11DUIc9BcsGsOv7P6VnVdKlyBybskIa/A1dvU93MecRHW8Sjsz 08nHCWB/pcsBKEtb6dmp/3dceYECCFQg6sXeg57NvZ3ffJ311DQsgTi/j71J9N9WeL2/ SIng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PvBkLR1lVhjBBWSewqJTTBchTYH/kw10gm2qf5zMfKM=; fh=M4BPaMQ5Q3X2+FKbhXoDpy+/1kcj8JGJnMEJ6o+yvT4=; b=LdmJY19okXKcN8qWjudfg74Gq6u+z//FeLgP2WD5pxqIZSCzl3fciJY2HnTrWyS1As 9VB4ac/7O9jF3RiIYfKR0wY9TzGNPrtoITriAmThFG9PcwLXcgGnLtccBpa1UpaIjGV/ TIa0AP4ZE/6LTt8PCQ0/4/HYkx/FcoSAtZVZ/tti2lwbKS3Ac/A1q6sxlvkWjcXjOGSK hYqaa5hjtDmXO7tuRK5KnDBtyr1GHRAdZ+tLtGo0Bkme9IvmiOurMzblZ3rSV5+torZR +uKQd00qlSOf2Qgvd68LBb9Fp+MWVlY0DAvvEfVrW2UbN1T/IGtSkIoS6fM5eWROhMet bGQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="g/F34LrP"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y24-20020a67c998000000b0046a2ab2dde9si52830vsk.232.2024.01.22.06.07.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="g/F34LrP"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E2B7B1C23806 for ; Mon, 22 Jan 2024 14:05:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAE463EA88; Mon, 22 Jan 2024 14:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g/F34LrP" Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFFCD3EA87; Mon, 22 Jan 2024 14:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705932159; cv=none; b=YyERmYLaXdpFnNZIfYjKFAWNWZRb2Pz3oF1nLbqCsF9f0qxEccNysuE3tZHlbhmcgThgmfLzX3W6vw6jnz7O+aTB8cPs6257AV6Bs8qnTJK1FTDHSqHNLEXpN0rrBBQ4R1A+QZuxUL2Dn5D+27gTzkn1hNpzY8LvlJRGKzLUZA0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705932159; c=relaxed/simple; bh=PXIW79wR4xxUjQK7k2LVAWHAMpl6SNEqE+BBtUMs9C4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UIXjX/6/9Xkmqb0/q+J+QCUqMg+gPklVJRL6Lt13zdZCboTCfJqIq4U710r4eOIhkzexziXO7LBriPxKnCoSNYvdatK37AbVdzByPSkiCuid7i6JE9EInOVtmdbZvLdaX5oEpaSE1oxUCHeOGKYj92p4tnIjucmWzrkVl/DEie4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g/F34LrP; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6daa89a6452so1869967b3a.2; Mon, 22 Jan 2024 06:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705932157; x=1706536957; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PvBkLR1lVhjBBWSewqJTTBchTYH/kw10gm2qf5zMfKM=; b=g/F34LrPiNceVObdYdIe1y30VZys2rMq2yjd67wS7GO0JaR4Ox8jJvXyJ0qofTV6Zh TKfE5xHBhNfLe4J3KT/RzN4PywdBlXqpdvwKUdGUSEZQ3cs8NtBI2a4QbCb91SUBfW3f SmGNbSXeE5weiu9c1vzQhOlskbmfB9LZ3X87+R90zk0ABf5ZgCVCYmltTq+L+cFBsFcO qIhubf8pJJvUeU0IQE6dbf5AsbJt926/GMVRF/DQiPotlpa3FVpGdH5n74RBws/ozRS/ r8qgOBVTQgxtALyPns1Vu7X00wRubAlsJ226AkMOspq/xrZfKW/yZW5CIZWNnIAzukhT lQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705932157; x=1706536957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PvBkLR1lVhjBBWSewqJTTBchTYH/kw10gm2qf5zMfKM=; b=KGRNRAIoO7EQ1USkq/c7jihAsNUe0Ovypy0xMs87sVeX3ZWr8/PbxThK+LcYrcrCnf KvxdYj6eS8a5BUcJG90reYz47MBCwb+3rq1y5TE+QguZUlOfgGELc8X8v19BcE29IQIm O0qicr4HRKLXNilREOzJIupF4vPwUde1tZ0UT94KCglOr+BbZmP0Nh5AcJtfbrtaCuN9 6DLFUNabR5aoycYswzbyNB6aYDW1tQ1jrzaCgDWpdCyfH0+Dq6ADBlv7a1GC50vGGT0F hksTGuKMPYMEjkg9oCvQa9XNuvB5juAccIAUy5qkYx4hC2JO7NYsoYXTBKFImm3g+1HC qclA== X-Gm-Message-State: AOJu0YzGuSqZXVGr+jPIBRBabAm9jkLCfKiQDK67kG5YuylsvbdhWpB+ vL1tnuV76/fmyq4rry/Aw5uai8qPxxg+zsS4jdAgT1TwXpN/bgeo+EW9v6W+ X-Received: by 2002:a05:6a20:9e4a:b0:19c:4b98:5e7d with SMTP id mt10-20020a056a209e4a00b0019c4b985e7dmr529625pzb.54.1705932155673; Mon, 22 Jan 2024 06:02:35 -0800 (PST) Received: from carrot.. (i223-218-154-72.s42.a014.ap.plala.or.jp. [223.218.154.72]) by smtp.gmail.com with ESMTPSA id n14-20020a62e50e000000b006da2aad58adsm9901913pff.176.2024.01.22.06.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:02:34 -0800 (PST) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/15] nilfs2: convert ifile to use kmap_local Date: Mon, 22 Jan 2024 23:01:57 +0900 Message-Id: <20240122140202.6950-11-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122140202.6950-1-konishi.ryusuke@gmail.com> References: <20240122140202.6950-1-konishi.ryusuke@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Convert deprecated kmap() and kmap_atomic() to use kmap_local for the ifile metadata file used to manage disk inodes. In some usages, calls to kmap_local and kunmap_local are split into different helpers, but those usages can be safely changed to local thread kmap. Signed-off-by: Ryusuke Konishi --- fs/nilfs2/ifile.c | 4 ++-- fs/nilfs2/ifile.h | 7 +++---- fs/nilfs2/inode.c | 6 +++--- fs/nilfs2/segment.c | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/nilfs2/ifile.c b/fs/nilfs2/ifile.c index a8a4bc8490b4..e9538fa46ff2 100644 --- a/fs/nilfs2/ifile.c +++ b/fs/nilfs2/ifile.c @@ -115,11 +115,11 @@ int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino) return ret; } - kaddr = kmap_atomic(req.pr_entry_bh->b_page); + kaddr = kmap_local_page(req.pr_entry_bh->b_page); raw_inode = nilfs_palloc_block_get_entry(ifile, req.pr_entry_nr, req.pr_entry_bh, kaddr); raw_inode->i_flags = 0; - kunmap_atomic(kaddr); + kunmap_local(kaddr); mark_buffer_dirty(req.pr_entry_bh); brelse(req.pr_entry_bh); diff --git a/fs/nilfs2/ifile.h b/fs/nilfs2/ifile.h index 35c5273f4821..b71ab0a81dc4 100644 --- a/fs/nilfs2/ifile.h +++ b/fs/nilfs2/ifile.h @@ -21,15 +21,14 @@ static inline struct nilfs_inode * nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh) { - void *kaddr = kmap(ibh->b_page); + void *kaddr = kmap_local_page(ibh->b_page); return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr); } -static inline void nilfs_ifile_unmap_inode(struct inode *ifile, ino_t ino, - struct buffer_head *ibh) +static inline void nilfs_ifile_unmap_inode(struct nilfs_inode *raw_inode) { - kunmap(ibh->b_page); + kunmap_local(raw_inode); } int nilfs_ifile_create_inode(struct inode *, ino_t *, struct buffer_head **); diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index b9d40f5e94d3..a475095a5e80 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -520,7 +520,7 @@ static int __nilfs_read_inode(struct super_block *sb, inode, inode->i_mode, huge_decode_dev(le64_to_cpu(raw_inode->i_device_code))); } - nilfs_ifile_unmap_inode(root->ifile, ino, bh); + nilfs_ifile_unmap_inode(raw_inode); brelse(bh); up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); nilfs_set_inode_flags(inode); @@ -529,7 +529,7 @@ static int __nilfs_read_inode(struct super_block *sb, return 0; failed_unmap: - nilfs_ifile_unmap_inode(root->ifile, ino, bh); + nilfs_ifile_unmap_inode(raw_inode); brelse(bh); bad_inode: @@ -814,7 +814,7 @@ void nilfs_update_inode(struct inode *inode, struct buffer_head *ibh, int flags) raw_inode->i_device_code = cpu_to_le64(huge_encode_dev(inode->i_rdev)); - nilfs_ifile_unmap_inode(ifile, ino, ibh); + nilfs_ifile_unmap_inode(raw_inode); } #define NILFS_MAX_TRUNCATE_BLOCKS 16384 /* 64MB for 4KB block */ diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index b512e7728465..3657918328ea 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -966,7 +966,7 @@ static void nilfs_fill_in_file_bmap(struct inode *ifile, raw_inode = nilfs_ifile_map_inode(ifile, ii->vfs_inode.i_ino, ibh); nilfs_bmap_write(ii->i_bmap, raw_inode); - nilfs_ifile_unmap_inode(ifile, ii->vfs_inode.i_ino, ibh); + nilfs_ifile_unmap_inode(raw_inode); } } -- 2.34.1