From patchwork Wed Mar 29 20:46:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13193201 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EE74C6FD18 for ; Wed, 29 Mar 2023 20:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbjC2Url (ORCPT ); Wed, 29 Mar 2023 16:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjC2Urk (ORCPT ); Wed, 29 Mar 2023 16:47:40 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A7AF1985 for ; Wed, 29 Mar 2023 13:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mu0WegAVAexOxcLTl58No04mchTSmjHE6UwIIR2ju/lFsZEoq3xssAomqFStln/7+WqchfUpOhkjlRKpl5QpcsIBbA4j4yyNko95Ndckg9i8mdwNKCe7myy8NoWCrCxuq9n+a3UZnNT8ygM2l1Sqjxv3q62JDuiTaum6hFQON+VaQpKkcnl2UP1x8HpCTi9wn/WUkYF5qAp2Igm6zTvAoTlcHmA8wEyMC1d02kPmjptZ6oDa1V/jT+bn9MX6U/CMW5JISzV+FVBcB/B3jZMMsflt/xEpRFvkWsS4qfi3UU3Q3omICnDgmrMzdglNIMvnS2j1UrwuYlEbcxbnwR0zNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lN3wDdbRiCYavdh8k2KrooPvWnt5IGsH5ll+fqkjac8=; b=GvjyFwvZBWAfFn1k/cdCJ7tsQYqtHTzrjfdGGBKOzsgJEZa9iuxzTxxfyIpIdGWPDFCuAlZ9PXyueKLGUevFvifRR9A9rQ8fhe/34vbv42HRH1QSRYoFiDgYH+wejDZ2UtLlG/9yWXAnY7YaPCu222cmEI8i2bdNEwgfckitD1blWrShq+8mZ2VFRreiHYCfce5vS87eMHIhnqOoG/nTRBx54LedWD03UnmmrFUCEXHr9GN+LDF+70jcQN4dMUCYptdk2diTLY5R/F4C9dSyzqbwPHG9ERqfAr45RWV1MxQmTMqn4x4cEsLWhZCGe9oM6C0b7O3Ty483vWnnMi401g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lN3wDdbRiCYavdh8k2KrooPvWnt5IGsH5ll+fqkjac8=; b=IBqZsGilFj9lOy3ZhO/edUJdW28ziPv0nzDTAWQqyLDp8fjSR1tHfJ8ci8lJYcI8MvS7KI7UpLjVnrQgL6F7kizZ4Gp8CSQvaaEJ+SMZsj57WYIHcIrz0ziZG2bamIW+cg1UsyZa/WKtZ1MowlZWy7rHQKkLLpfOl+jpVrw/5npTPT2Pxja5dg6qhzCaASWAxIz57ofzQczQzH22XKdXgLrmHhoRLP7De6P1MTo4J4SSJeUVh8qu+rISqnFjpoUCAmUgikLF+M4nVzPqFpMMxz2VSkbefmKyYOFnDed4i+EKtz6FRFvExbWHImx6GVZLHGfCySqK3lhWBjbXGTHeLg== Received: from DM6PR07CA0048.namprd07.prod.outlook.com (2603:10b6:5:74::25) by SA0PR12MB4382.namprd12.prod.outlook.com (2603:10b6:806:9a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Wed, 29 Mar 2023 20:47:22 +0000 Received: from DS1PEPF0000E62F.namprd02.prod.outlook.com (2603:10b6:5:74:cafe::49) by DM6PR07CA0048.outlook.office365.com (2603:10b6:5:74::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 20:47:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF0000E62F.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.30 via Frontend Transport; Wed, 29 Mar 2023 20:47:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 29 Mar 2023 13:47:11 -0700 Received: from dev.nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 29 Mar 2023 13:47:10 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Chaitanya Kulkarni Subject: [PATCH 1/4] null_blk: use memcpy_page() in copy_to_nullb() Date: Wed, 29 Mar 2023 13:46:49 -0700 Message-ID: <20230329204652.52785-2-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20230329204652.52785-1-kch@nvidia.com> References: <20230329204652.52785-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E62F:EE_|SA0PR12MB4382:EE_ X-MS-Office365-Filtering-Correlation-Id: b7f231c8-d279-4a28-5294-08db3096cb5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RH2uUgXB8wmDLyF2M1mMTv4udosfqsS+MJBDu/ElgsjEbn4qiHvLL0Bdv9f+k3oDZwVrIFQn3xw3eYtktPTlydovAVXVSXAm/I6012Vae5dZjc+Zep8aYa3StNTW2h5LqhbOVRKb8DhPzuI2lqk+62K7AadBNF7NhZ/nYmI16QuyizAveNi3JH4rySOwag6NbtyP9yXMdp2C7CG88MCXjwb1DcYpGwC1eVA7WkXHzWvozWSjYljDTYZU7LIKvqI24nJvWXiH/8ou+vK/MkXSJq++xPb2H97kV3f4RtBegidSzWRO5+6lta+t2ADHWKZmFRZWWdZbHHQnU0eqzQ0GESOwF7bkJ1MqoTf6RbkWW2xYD6dTg+NykENcvOeaHLHPVpqDaXcgTm2itL6oc/SH7vK3i3OhwQeJuQjM2qEOybAAZgWxOq/11a9ik7axwST+lwyb+SZwxadHvFgXayTf8xNt4gnxoJd05zdD4tQMWb+kJnefpiuRYZkDBfQo4oc2kJ0kHjDmhCB/soaVEJyhSU5zep4iAzmvCoDy9wF1HlCmZA4fiCt58+s95+eYSdmkmGvz4GTNgduVtBaFyi40gO0KloV0MKKeiq5kDH8lj3p1mA1mSKpqN4O3Wp7hPRx9v4b+WrmNxsRfp/IEkOL3+FKEIiXXIc68YGdKcFF/qSuCnE916lSIISOpCfACR4vWrTVgmNMeiKXzGcTvrQBBcC+aGJfNAd5MmkroPvvrCm1A7VLnOQQXsyA87Krf5/Nt X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(46966006)(36840700001)(40470700004)(336012)(47076005)(426003)(70206006)(316002)(83380400001)(36860700001)(70586007)(7696005)(6666004)(107886003)(2616005)(26005)(54906003)(1076003)(186003)(478600001)(5660300002)(16526019)(2906002)(40480700001)(82310400005)(82740400003)(36756003)(40460700003)(7636003)(8676002)(41300700001)(6916009)(356005)(4326008)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 20:47:21.6834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7f231c8-d279-4a28-5294-08db3096cb5e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E62F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4382 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use library helper memcpy_page() to copy source page into destination instead of having duplicate code. This also removes deprecated API kmap_atomic() from :include/linux/highmem.h: "kmap_atomic - Atomically map a page for temporary usage - Deprecated!" Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 9e6b032c8ecc..947bba174e1e 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1112,7 +1112,6 @@ static int copy_to_nullb(struct nullb *nullb, struct page *source, size_t temp, count = 0; unsigned int offset; struct nullb_page *t_page; - void *dst, *src; while (count < n) { temp = min_t(size_t, nullb->dev->blocksize, n - count); @@ -1126,11 +1125,7 @@ static int copy_to_nullb(struct nullb *nullb, struct page *source, if (!t_page) return -ENOSPC; - src = kmap_atomic(source); - dst = kmap_atomic(t_page->page); - memcpy(dst + offset, src + off + count, temp); - kunmap_atomic(dst); - kunmap_atomic(src); + memcpy_page(t_page->page, offset, source, off + count, temp); __set_bit(sector & SECTOR_MASK, t_page->bitmap); From patchwork Wed Mar 29 20:46:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13193202 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BE89C74A5B for ; Wed, 29 Mar 2023 20:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjC2Urx (ORCPT ); Wed, 29 Mar 2023 16:47:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjC2Urv (ORCPT ); Wed, 29 Mar 2023 16:47:51 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2054.outbound.protection.outlook.com [40.107.212.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90084C30 for ; Wed, 29 Mar 2023 13:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EX8JzWiSYNZ5Y19qQPAI651WfZSQ4dMTJfl8BreQn0FJsh0u274pdrbuGon6Rlr4wQ4dZ7tfvJtt2wJr1bWj+/v0nYASERwwaSc0XIfgLErl1gxi7nPX3LIs7cU4D73uVVBYgQA2PnEvL70SS7M9iH+rvoV4y4DsdZOrVOhAOx5bQuLca+YdweynVC6gSRS03R2jbNGP2xQT1zxyfcclHUbfzaXBGS5LePuGlN5ahQvZk+m09iY+lculgSq4T15npTZfbpjqhJOGrsAMFf2NSnzalOfHlDulvpXtZXC0aKEBYoPBMiyd1jIKpqGc+w+MGJCrVxIH0eyU+wRzicRviA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UwTeG1Fg0h4XFbMPuGPABmD+RK0S4M+NKz5lIgyblnU=; b=JC6nOoVcmAJzJ7MfCpow0uJd0GUCPS+mUi+pB6OQwvZiNZYS9yar4lAqZ9j02TmD8PSbJwgCNstz187weinuk1A6lQx/ezQxjP7CAKrP7Vbj95I8AMxM5aD+Q1YtJQmeVwOSOj18aa3twA/ZWL3lQBWSh7iy/VXTEXGHyCh9Me6W9sjRU7wnac7JEqrYI4DnXtqscY+2M+z298u6sKl8vCv/+Jle/hW6e+/7b0Bm8tczXSzXfzKBhxZConRiJxZ+SR5rjrTyBOCvpYQCqxWR+Jwprl4BMkU8hObEDlQfLgyRDODDNJJ/0gPbSlzK4NUOWOOCtI1CCUAkn8q4PBLMWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UwTeG1Fg0h4XFbMPuGPABmD+RK0S4M+NKz5lIgyblnU=; b=LNy9vdTBPPv1yuvds9hf3V5tpawfwZerkylmAiBQaiXjPDpevnh7gae/TQ1dB1RqoatVXJlhj+d6XCCLdd0vXuEiGZQaqFlhRBPNithf29bjdIGInTmuGJcc+7QxBq9jE+FR0JDlZvMfNyqzVWdMgjl1PzLE9njbTlRUF8C4dHQYXx4p0iPQacU4XFB909Bh1TQCcU/zbQLqr5mYYS9+B0tqiQA3Oks+2XWwxKslWoHVp9NkFmqdzXa8xlAdkvXuu+Tzom68C5fpSpcclqOXCTDHQKDuKPz2EaZ8aBSMQltQ9r4KJqTdUhYoA2nxEeS/JWMt4dgofTQqX9/A8gn21A== Received: from DM6PR07CA0069.namprd07.prod.outlook.com (2603:10b6:5:74::46) by SN7PR12MB6931.namprd12.prod.outlook.com (2603:10b6:806:261::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Wed, 29 Mar 2023 20:47:31 +0000 Received: from DS1PEPF0000E62F.namprd02.prod.outlook.com (2603:10b6:5:74:cafe::54) by DM6PR07CA0069.outlook.office365.com (2603:10b6:5:74::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 20:47:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF0000E62F.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.30 via Frontend Transport; Wed, 29 Mar 2023 20:47:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 29 Mar 2023 13:47:22 -0700 Received: from dev.nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 29 Mar 2023 13:47:22 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Chaitanya Kulkarni Subject: [PATCH 2/4] null_blk: use memcpy_page() in copy_from_nullb() Date: Wed, 29 Mar 2023 13:46:50 -0700 Message-ID: <20230329204652.52785-3-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20230329204652.52785-1-kch@nvidia.com> References: <20230329204652.52785-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E62F:EE_|SN7PR12MB6931:EE_ X-MS-Office365-Filtering-Correlation-Id: 53bad0df-04b3-4b59-2657-08db3096d0c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rWR8JJdut5ZJu/GucW/8axTkRyjTg8OkYSs4ishKEXjv1PQcL3qm6wEP/XkXyLmZkhE6SM5NqRgXHuxmeu9oYS8x02whKOu3jPaTqwSAW/4eMb8wIktPbObDjp+02RLZYVWhzv9k22fFR+sEuaYl1h81Y4lu/IAywZqCz94p50A79uBjv2UeSWy63iapKfPjVYTFIvjntR+5TNrd8CwVT1PRgDS86+GQbfdmsd3PwthZh5mw/o02psbRWRj6idNt1PHL3+Vrj09CKjGETg4IGYFGc+mt1rKpWq1yZ6ZTeDE6uh4L+goRAhHIkCP7w94wkulVkcF/W4JJSg6xDO00GjMiAIr0tbSASmCIPKAeX/TNgyL7mhPzHctvzPJ3QC8tZ/WNmWi7kY8W+J/DG5sm1WswOULPyC6BkxfE1gxgERPF4a3qqT0aOJfMt35YAPeqG36Zq7ILe9ToRCPkf3tAEgobO/fmW38mGM0wllHZbPTA1EICN8AWOF8Rf7P06t/cG96jlornNABexDqk3de/q/hgbhX3jnuM6YkVfl+x2wrjs6MYNSwKiLM5TY4kaqSrQrce+qCEHp31qHJ8DQdzoncV2Aj+J/mDK41jlrgx88Z3ZbPliFuE0JfMp15q+DD+MEfCCBii3n+DXmz6jmIzJwT4yxnzGDmQhX9VoXVMW392tugOcfrGzZGu7InmrgJPy0u47PjFAXeezy+hUpONouJU6o20xa8HtxfaSa6mxFwOaiIeKwSDWR2SO7LKGRLi X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(36756003)(6916009)(70206006)(4326008)(316002)(6666004)(41300700001)(7696005)(70586007)(478600001)(54906003)(5660300002)(40480700001)(82310400005)(8676002)(2616005)(8936002)(2906002)(36860700001)(7636003)(356005)(82740400003)(1076003)(186003)(16526019)(47076005)(107886003)(83380400001)(426003)(336012)(26005)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 20:47:30.7303 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53bad0df-04b3-4b59-2657-08db3096d0c5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E62F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6931 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use library helper memcpy_page() to copy source page into destination instead of having duplicate code and zero_user() instead of memset as this removes deprecated API from :include/linux/highmem.h: "kmap_atomic - Atomically map a page for temporary usage - Deprecated!" Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk/main.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 947bba174e1e..2b344dcb4382 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1144,7 +1144,6 @@ static int copy_from_nullb(struct nullb *nullb, struct page *dest, size_t temp, count = 0; unsigned int offset; struct nullb_page *t_page; - void *dst, *src; while (count < n) { temp = min_t(size_t, nullb->dev->blocksize, n - count); @@ -1153,16 +1152,11 @@ static int copy_from_nullb(struct nullb *nullb, struct page *dest, t_page = null_lookup_page(nullb, sector, false, !null_cache_active(nullb)); - dst = kmap_atomic(dest); - if (!t_page) { - memset(dst + off + count, 0, temp); - goto next; - } - src = kmap_atomic(t_page->page); - memcpy(dst + off + count, src + offset, temp); - kunmap_atomic(src); -next: - kunmap_atomic(dst); + if (t_page) + memcpy_page(dest, off + count, t_page->page, offset, + temp); + else + zero_user(dest, off + count, temp); count += temp; sector += temp >> SECTOR_SHIFT; From patchwork Wed Mar 29 20:46:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13193203 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60EC6C74A5B for ; Wed, 29 Mar 2023 20:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjC2Ur5 (ORCPT ); Wed, 29 Mar 2023 16:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjC2Ur4 (ORCPT ); Wed, 29 Mar 2023 16:47:56 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2063.outbound.protection.outlook.com [40.107.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9647461B9 for ; Wed, 29 Mar 2023 13:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AGdaiJXp7sX7rzAudJJwJRsOycymzMscMtBTAdEoFZ4o0/9LEVwMvGwIxv3MOa8EgHYIHuE/C9T3WUwYMCywSktf5holi+pR9znTZiBkwTEjZZsnAxuh//tocH5awJAjdemEpFC/IuspvOpmF4rVPVpBGZ4mNtKY2V194KqxtOPaj0xyotywFbL1D4+dcQ99KLC955QADN9ERoxNBLGW+SN6sq3ghwaEX9/adnBoFlKsRUJFIXL4ZMMRu1Wzo0FcNsX9PeCZ8ggFw5JwriczfY5+gYNNZRDAtLOTBQib8DOIji9loPFnePVKVMwXQ5+HEuwyDplEZtPcXmmw9P28fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DNAC7FxQ9HSzysDNPoc/e9E7FJns/Gzq3j9TnvIDYEw=; b=CElCFKkQ7TM1/sb4a4VWlUBJYO5/eodlmBOvAqTTGDaUftOyDB3u4/eEBEBB9kzVGcz5exXQ+/cTkhSbRtuL/1rIf8/Auu3pfbVDoxDErq75Tqlxlh1EjKgAtD7ZBZ1gsFBUpydxFb1l3xWdZlI8854bm6d0nY9fygk0gnA9tMvNnRzRdu+Ry7wWamXgIVnLfEEfD+3n7BBsuRxcO/kOc/j947OLIoYs7An2cI3NcMM78sG0x8Q5W7ghp7YHru5zuELEW3i2rvYzVW/o0NmdSyjEU+itp+nlxHxIty/vI3UuBLYrCv7eFtmo2E6CBWQ6+TzUocXCFYsdgkaDswveAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DNAC7FxQ9HSzysDNPoc/e9E7FJns/Gzq3j9TnvIDYEw=; b=NSEr9c8Nkq5qknL10S2mTc4ppPHuT9Mvols0YMZ2/RDxzA8jSw2AiRwSN5F25w1m/KWRkGchNIxVEXSP90mdGeaVy0VnS+VCpwwB6s/kWEwzkYJJKKMj5zyBHegKkGr9CkXTTvdwMzpJL91gicEt8DQWZdAPo0nxMnvIu6nQmLFR8NpdLHpP1aI11bY/p0k4CpMNX/q4XeOfyRl58ft2ha1eFxh3mvEhx+TCzzLGrioREphEykuwwRSYgibwU20M/YDMsB34Ah3iFzVa1DWbs4WkkXlPYH5W+EEF1dUbTblyKMVgwX6X3EU/AfRVt8GNVPLh5sQlPTytEmrlZHwyoQ== Received: from DM6PR07CA0108.namprd07.prod.outlook.com (2603:10b6:5:330::14) by SA1PR12MB7127.namprd12.prod.outlook.com (2603:10b6:806:29e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.30; Wed, 29 Mar 2023 20:47:47 +0000 Received: from DS1PEPF0000E644.namprd02.prod.outlook.com (2603:10b6:5:330:cafe::74) by DM6PR07CA0108.outlook.office365.com (2603:10b6:5:330::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 20:47:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF0000E644.mail.protection.outlook.com (10.167.17.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.30 via Frontend Transport; Wed, 29 Mar 2023 20:47:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 29 Mar 2023 13:47:33 -0700 Received: from dev.nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 29 Mar 2023 13:47:33 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Chaitanya Kulkarni Subject: [PATCH 3/4] null-blk: use memset_page() to fill page pattern Date: Wed, 29 Mar 2023 13:46:51 -0700 Message-ID: <20230329204652.52785-4-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20230329204652.52785-1-kch@nvidia.com> References: <20230329204652.52785-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E644:EE_|SA1PR12MB7127:EE_ X-MS-Office365-Filtering-Correlation-Id: ea02b794-4116-43a2-b554-08db3096dab7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8WChj+NzITuwf0hce9xNQbo5mva9vw+GKJ9yGxWp0YY4tutqxbpdPuiqxEjYh53KWkRRtxUFienmP8jyesjAqWighD0hX8GmSK8EZ+llWdPPLnhNV6z2EQciV31TNZxoql1WIT5/437vYOBv89shoU3yn6/PKtHqA1warXkkbXxV1m5ndXyEJ9gnt4kn6M/2V/zpJoZoz3aC2P8kVZU6uqa836kNF1AMv9NJ2N0ef/DK7c5qc089GMwUySdv2pc+XXzKVK2JLubWJPlzd16wRM9magl5g9KoT3A58R3hz3T1wZKzy1Cie3KQrv9JL0tslWcULQ8jJbe1zCrIRyOiUEtfzezXspKVXbIHCP7y9wfEm+ylKojJ6EopqyvpmHf6wPmHD7f5gvy9ctf6BwuDvY7qX1E7MK9ZJiAu0zL12TblOpc29It+npdyQtKKMaa6TMPiEQwElij3mhyMfc4lyA0oaauEWgsNaxzracfIfUrWdfbwKtmtt9ZPDJv1EhXwpVXZ4CJUXQ74R3AfzS6xfz17ttNM/E3jUInHJ2HxsMt8LqJkcW6b7N3Qhs22wnE+vW8cPnMfjIPQ8WBlxAAbGN4wbt4Dbk4Fp/QdHY7IMg9Fg1yrzd8h0/VHLTiLdRDhpcEcRd+7XvEg5vOla5EdJNau8Ie1MR8cyERtw2LUSgk3Wttttxrggdz62KmXIF57flFtqDqDADyfwumt7MONjLFIIW/yxXyud1CEmA/vEDqiS4F5/peIaR7K0lwadaWK X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(346002)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(316002)(36860700001)(40460700003)(478600001)(54906003)(82740400003)(356005)(7636003)(82310400005)(8936002)(5660300002)(36756003)(70586007)(4744005)(4326008)(70206006)(8676002)(2906002)(6916009)(40480700001)(41300700001)(426003)(1076003)(186003)(107886003)(6666004)(16526019)(26005)(2616005)(336012)(83380400001)(47076005)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 20:47:47.4194 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea02b794-4116-43a2-b554-08db3096dab7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E644.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7127 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use library helper memset_page() to set the buffer to 0xFF instead of having duplicate code. This also removes deprecated API kmap_atomic() from :include/linux/highmem.h: "kmap_atomic - Atomically map a page for temporary usage - Deprecated!" Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 2b344dcb4382..41da75a7f75e 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1167,11 +1167,7 @@ static int copy_from_nullb(struct nullb *nullb, struct page *dest, static void nullb_fill_pattern(struct nullb *nullb, struct page *page, unsigned int len, unsigned int off) { - void *dst; - - dst = kmap_atomic(page); - memset(dst + off, 0xFF, len); - kunmap_atomic(dst); + memset_page(page, off, 0xff, len); } blk_status_t null_handle_discard(struct nullb_device *dev, From patchwork Wed Mar 29 20:46:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13193204 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D4E1C74A5B for ; Wed, 29 Mar 2023 20:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjC2UsF (ORCPT ); Wed, 29 Mar 2023 16:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjC2UsD (ORCPT ); Wed, 29 Mar 2023 16:48:03 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10hn2228.outbound.protection.outlook.com [52.100.155.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C2444B8 for ; Wed, 29 Mar 2023 13:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nzLzElLyutkR/aO5cXm0PYaxAi0b5ae3HHINgbGRdNNqn20uXZ14JnXVWDi/jpZyWiENByaQszZZciWAu1N4nmdPWP4SrZVCW4iy4WQ9mU6LHDwp/KxwE2XaOj4o9eSyH+R5R4vrv2tEgmiYiMK530YFUSP/QP8UlPaJVdT8WMKfCSJ9ANzPWQ5vF+8njGfLYb4FvNyftyHB/E4SrCbNP0Oko4coehBwRlWzAoCMTnpLe0JLVzftblA8V3/9qufvMWg/tzFCatIkHYrRJeKbX/qxM7/vlFzsYa7+3VrxGoEC4yVOuI3qbcq4PoLUM1emQhnNNYhaMCiOJoKwfzZIbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oe/xv6g1oimWIxOkSZBCMqmkdMvjYyoJ01N1ZMeibGw=; b=Qfd5aVFXnDyx33V2l/0C4VNIngRK49fXiHiSsnBtmoA4JXRdmmFdnYAiEn2u9Uz3GRmacTtEYTAz5TDHRLEO13LbLuzgidI9VsAA67+8wyG6+a66AIHWS12FSwFy6r7arjtiP0tXXSbkTyxKNfyQj3sT7IAQ/xfW8GjyoBAFva7AONuZ5djriwahSk/585R1ACAtcpZi0/amEsPrZdvINHXb37yLWlushbNfCix1eJKC8QVmxOcCrQT7b/FXQSeutVJuBVlX/73mW/K/bsxE2sSF44OlRHN5V//PkI425jUWpdhgCJI+VFVOz2VFaHLE9WCn4OY6QVaOf1676jcitg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oe/xv6g1oimWIxOkSZBCMqmkdMvjYyoJ01N1ZMeibGw=; b=LWj5EmQ2N1hTXWSWy+9LDQl49L3pCrI8xUDujoZwLJmwibbQUAcBg1pFySU6JLxW4OKc3xJSt+eGBwkYQ/P2JUKc/c09mNumxqLxBrCZS8YpfoV05ZxYWPAmKNmr0Nodo9aNlpSPMt7auvw3/jCFTzsT2P09URrynQgek5REK7l4WMilO3k/y/ZRZqv2gjqSjo4wdr3sCf0tWosV4Hi3QVE19xEhkqGtvyrwUCTBUlQ7Q1ZCTdvpnydTpAIx3nnx0kDAaOR5/ycBFdTsCkYtiIF+ETViD84cRWGDw59rkxv7sABR0L80lPXVi43agB5QEWAreZCcN7q+503LvwQMcg== Received: from MW4PR03CA0029.namprd03.prod.outlook.com (2603:10b6:303:8f::34) by PH8PR12MB7111.namprd12.prod.outlook.com (2603:10b6:510:22d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Wed, 29 Mar 2023 20:48:00 +0000 Received: from CO1NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::b2) by MW4PR03CA0029.outlook.office365.com (2603:10b6:303:8f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Wed, 29 Mar 2023 20:48:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT073.mail.protection.outlook.com (10.13.174.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.17 via Frontend Transport; Wed, 29 Mar 2023 20:48:00 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 29 Mar 2023 13:47:45 -0700 Received: from dev.nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 29 Mar 2023 13:47:44 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Chaitanya Kulkarni Subject: [PATCH 4/4] null_blk: use kmap_local_page() and kunmap_local() Date: Wed, 29 Mar 2023 13:46:52 -0700 Message-ID: <20230329204652.52785-5-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20230329204652.52785-1-kch@nvidia.com> References: <20230329204652.52785-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT073:EE_|PH8PR12MB7111:EE_ X-MS-Office365-Filtering-Correlation-Id: bb857d1c-d33a-4a7c-24a1-08db3096e25f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zCMPG51RUAaQHyNJ5q5czgsbluugwlpq6oX+JET1HQubshXMCcXSdtbh5JYkC1pWkMXua3OCQfSFUfEUSTXRCEWq14T+DgjpVdWO9RVvZb+4udQmTr3/Hyi+B8SgbHRry+Adtq9tKhE08XNtHF6G4gctUZd3c8/RiEbUx2dfyY69Qw5kO7RR1TsiGu0YgrMH3YokbJjrQxc4BmBE5XhQ86DR2ERhEiJbwM8tRb0YqwlA8yxKAReAoRp3ODojMJHVWHulc/gzh7IFzFd6ra9uOqppGwZIdqq9wg5+qAeW6w3qsULqK/hcoca9hWMbypr70Bv+Su5Sui0VWrnbW2e9NRtG8HDvsBVq5vgEBOenTwmyHfNVvBVpseNCMopwXq0IgduQuDeuDZja9yHeM2UxtMB8lH8QRqICc22fncHmVPHdLa21RAOC2BlN4rMbl13615lmnbIK76vTy4WxRzPKxN49wjlUcih/813g2NcWljmw32Nil/ImZ4CE9vjdV3tRqHm332D4JjGb5uyy/RhrITWlmYKKuSkTTu21pwmgn6komQr1I3fYkeBcO71reggAkDXGQXVQsMgnDtVLn1m1A5OVqJeErYw8O24TvgWYnUx8E9P5WdvoTddehS1xSJC+qGneEMymP3tV2QMArxQSQ+3z3CYalLT/AMfnhiQB1M7ZQriBVm93KVkfu5wsvMCqSIiSM7+VfLULIv+1pCmGsBvZeAyUEX4E90TW2kt3Xe3h7bXU/XXAKc2dvjr3Agj7SXJiQE6XklFScdrLFMTfm0GrgYWd2CdNI8cpINlAY6I= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(451199021)(5400799015)(36840700001)(46966006)(478600001)(83380400001)(2906002)(36860700001)(7696005)(426003)(336012)(1076003)(356005)(2616005)(8936002)(82310400005)(5660300002)(54906003)(7636003)(107886003)(6666004)(316002)(82740400003)(186003)(34020700004)(26005)(40480700001)(16526019)(6916009)(41300700001)(47076005)(8676002)(70206006)(4326008)(70586007)(36756003)(12100799027);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 20:48:00.2608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb857d1c-d33a-4a7c-24a1-08db3096e25f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7111 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Replace the deprecated API kmap_atomic() and kunmap_atomic() with kmap_local_page() and kunmap_local() in null_flush_cache_page(). Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 41da75a7f75e..bc2c58724df3 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1030,8 +1030,8 @@ static int null_flush_cache_page(struct nullb *nullb, struct nullb_page *c_page) if (!t_page) return -ENOMEM; - src = kmap_atomic(c_page->page); - dst = kmap_atomic(t_page->page); + src = kmap_local_page(c_page->page); + dst = kmap_local_page(t_page->page); for (i = 0; i < PAGE_SECTORS; i += (nullb->dev->blocksize >> SECTOR_SHIFT)) { @@ -1043,8 +1043,8 @@ static int null_flush_cache_page(struct nullb *nullb, struct nullb_page *c_page) } } - kunmap_atomic(dst); - kunmap_atomic(src); + kunmap_local(dst); + kunmap_local(src); ret = radix_tree_delete_item(&nullb->dev->cache, idx, c_page); null_free_page(ret);