From patchwork Sun Feb 7 19:04:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E27E6C433E9 for ; Sun, 7 Feb 2021 19:06:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFC7B64E3E for ; Sun, 7 Feb 2021 19:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbhBGTGS (ORCPT ); Sun, 7 Feb 2021 14:06:18 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:38248 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhBGTGR (ORCPT ); Sun, 7 Feb 2021 14:06:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612725675; x=1644261675; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F38JIOmH/bO60aVqbPLRnyXb9cZeXf1sDr0Po0447lk=; b=ah8/FYKWXv25NSnpIOscqUTMcvmyMjWYNGT1pTEfWBEcqZ1jJ4XqwOfz msgnlnwGOGn80QJfvDpBSQdwsOUDQDFPmSRB0xTcl1G8HIRX3DMVkWRzf +CU9XXha8EmPMoP0Ct2Zv/iTcpKe2g133rnmuVFdugU0gSaXSPdqpNbrr 4XideXGlfWJC8tv855/SfhGaWeVAtp29ZVgLmpS+x9fU/Cd58bcebURUG oUCuLmN9nokRJYLvuvpsJnKpjyMIEkMkOtph9Yu77rnWXyWnfd73jHwOv P/4X05g+DkrmA2/X/cbddSx1vIXeXHnqD3XsGNk0eQuxpl0eAMCzkozc5 w==; IronPort-SDR: DDgVYYJP4x/8VeelTOZWLgrZVeKK66mrVaagwp82s0DpYuo3+h5yGPOKbxD80KKbq96Xal6rK9 oPfjdMz7HJSw/dnv31423zxgkOJ5JQRejQYBaD5bkNXL0ezp+Y7RkOmnWcmJQqJkXpyYnUAM1E 1900t2yPsl5v3tKmec2bpMCxW9zFVys0HCCrAanOu0KjYc+THxitZ50rBDnRonVSHRbvZG2NSP 5wsRA0hjvqfOk84XpKYT8w8fKZnmQElPvLrBvwnUpbeQGjahhp8nX0ZyWMDW623z3kAenwnsRj seA= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="263497357" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:18:47 +0800 IronPort-SDR: CTpDn1GpWiAmWx7HWhnsQpO9wY4M5i274jtO4n6/z6+tyLr5RUu1A/9Lq/5j62ri1mcvy7fPoT ZQiR9iEROoltVHeTdEQKHIg+GZVMR4oE1np21pOgEvlcGZOEPpH8SV0GzTtjODrgcCfKACy8Ic 4OtFP9qL7z0gGApo69dmu7tjArKvoI3CiH3k9UeE+oWbAHNbJtGEOhK6ndfeYsPq/dvlYNWceg hxZe3eNGUijihhGvu+dLzgvzgLcl7+7g8hf9A9tKfUAedjldZOCYyTVmvLMY3YFZOjkoYUJ0Ns A+Jsszk6OcNBQgwU2mwA/kND Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:48:32 -0800 IronPort-SDR: 95X1JNQjuKEYeODWhVDVzpmJeAmRC+qi6PkDW1g7K+Lf+5rq7gnfFOS12ox+MhnE326Q1n/6S6 6EeT5PpazKBHTW6Af6ZI24rlL7mUtxPXZeOi2iq1msSf5Oh+xFVcV9PJ0eGtZs3Muxtfy8HpMz skaukzAmdnakYARnvPHY6ukLuiyfq8Uxxg4k+mgcLA4JpOAvz3OVHl6QDgN26CLYAB9XLT86O0 gjQoItL/O4VqWgBcHrgBs24UkssGH8iK8vn2r6od9A8XyvTcgMv+IOEk3E7gkqHk1Kum4mDhh7 05Q= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:04:39 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 1/8] brd: use memcpy_from_page() in copy_from_brd() Date: Sun, 7 Feb 2021 11:04:18 -0800 Message-Id: <20210207190425.38107-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/block/brd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index cb5c872ac9b2..d41b7d489e9f 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -226,11 +226,9 @@ static void copy_from_brd(void *dst, struct brd_device *brd, copy = min_t(size_t, n, PAGE_SIZE - offset); page = brd_lookup_page(brd, sector); - if (page) { - src = kmap_atomic(page); - memcpy(dst, src + offset, copy); - kunmap_atomic(src); - } else + if (page) + memcpy_from_page(dst, page, offset, copy); + else memset(dst, 0, copy); if (copy < n) { From patchwork Sun Feb 7 19:04:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1629AC433E6 for ; Sun, 7 Feb 2021 19:07:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE56A64E32 for ; Sun, 7 Feb 2021 19:06:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbhBGTGn (ORCPT ); Sun, 7 Feb 2021 14:06:43 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:39615 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhBGTGm (ORCPT ); Sun, 7 Feb 2021 14:06:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612725713; x=1644261713; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jVyWOzZt5w5fhEh8o7eS7+fG7L6zzNjoN92UbyfAIKQ=; b=fhUegeXtCpCNxvIC8FtU8wtCza+kfj12ia8ymkJsEj2UTsW9gf2D3bby qAEAoY11FWTmI+FQX1XYkggTrldZiG1/HVSrBHzdcDvcddL7uXul1CUYB 64IDjJ3JalzLDv70CTs14u7/jwjVO/+F9dcb9MmSnUblYox6qzuD+irN9 6bLPK1MtnVkVg3q9yTV6wIXN4SDruVzAs50lil1ijq9gtnCB3be7OYyHr BxAZWgS7UI1xRyjd673qVtvqNQRZuRM355D8tnKXRQmTgsj1Zi/m9IiJT udNiXSY2Dd5EZwK5OUiQQpAJYTe9mp66lipxWFYI5/Ydwa1eOnRFXsD5J g==; IronPort-SDR: Sk5TaCaqaQzsBdbSxIlgsIaZ/fcWfd5NbQtzzlkEDThnpWNk9FS5fL5ny/2mv1OBzh8z+Iuezi UJLTP3fVyZMxO5J8A7kZeNs4xdC6I/ars6AKZKc7q4smZ+zf5GEZSt7PiABzLv3O3ZNJz2BqXx R1IUooK6vV3vDsslgwrr/xrMO4oMz+RporrOB9Pdw+bOipGnSXXioZv9OQOQg9AB+yBP1Rg9uA ffKPxPm+6Y0tH+Nik+b5CbUFYnPtlrJnwIeLad2pydmr5KaOoO3HUO4QXBYaJaOEn40TIFo2D2 gSw= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="263497363" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:19:03 +0800 IronPort-SDR: O5pRkm4GtNflkibKekCTYFizVIhtbNVMn2NS3MtjCA/9sMie1pW1OtGvX9ZotQkIb4mGt1iTXB 5sml7Lfs7ydPM9eAgMQ+KQ6Q1pTr4NrVIW/+pUY/j0/FgMVFsRdW1f4VayGixDQLqpWK3Qa9co JM2UR09xzssrQyzdcEUWkMmkopSOEzhzbuJ5onUilkXycbilZND6tn59A9BrvBfDFwf1C78jv2 FPsjQRKJdkVOBC3HrT1JeE/LL6Leh2g26MtbuOb5aiMqXcvSaJhQ+tqOYWYmPp1NjkD0cl+86g 00uzcO1hWoxmaYbiVsKK8nbL Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:46:44 -0800 IronPort-SDR: kbuKIeO0AI9DEI+MIQQ6CERcLJnA/EyVGmtMpQ8f1jguskefPUd+f/2FtXU9VCEEsfvZoymzjR Nz9W5KtndcUDtWjZFQc7XM7vAsahBOcCZfV0oKzAfYlSOYyNK42W5Y8zjeMh6yHosSJBJfsVDk Kz/m/KtvRXAkvLuXXc8iKui771YFkmjT5p2omMAQY5MvQDwVKZwmINqJBiIGWIClOHouEqXGIA 5BFwvE6EyBVjXHK4MNwakyTD988bwcqPTepzRYwxBiNZ8RfhnV32rS5saUPih3CdycmFvOw7Z+ q8A= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:04:49 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 2/8] brd: use memcpy_from_page() in copy_from_brd() Date: Sun, 7 Feb 2021 11:04:19 -0800 Message-Id: <20210207190425.38107-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/block/brd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index d41b7d489e9f..c1f6d768a1b3 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -220,7 +220,6 @@ static void copy_from_brd(void *dst, struct brd_device *brd, sector_t sector, size_t n) { struct page *page; - void *src; unsigned int offset = (sector & (PAGE_SECTORS-1)) << SECTOR_SHIFT; size_t copy; @@ -236,11 +235,9 @@ static void copy_from_brd(void *dst, struct brd_device *brd, sector += copy >> SECTOR_SHIFT; copy = n - copy; page = brd_lookup_page(brd, sector); - if (page) { - src = kmap_atomic(page); - memcpy(dst, src, copy); - kunmap_atomic(src); - } else + if (page) + memcpy_from_page(dst, page, offset, copy); + else memset(dst, 0, copy); } } From patchwork Sun Feb 7 19:04:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD878C433DB for ; Sun, 7 Feb 2021 19:06:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7893064E2F for ; Sun, 7 Feb 2021 19:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbhBGTGH (ORCPT ); Sun, 7 Feb 2021 14:06:07 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:24872 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhBGTGG (ORCPT ); Sun, 7 Feb 2021 14:06:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612724766; x=1644260766; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bUHJh7WdO4b/toeg0AHLw0ztouu30XNNBjvj4mVAqXU=; b=MEGOBD0SUxSMma78+0AWH2c3ZlzZOiJSuuUCS1doO4+wr74a/n4zY3AZ 08Bl0VTpKxODg8bTYJAh/7onO0hpSyfQwLIBNZPMg6kJ/+NG7RaNJuJjn LjwO4FQqOE8o9eCFm4wRulaAN6v8H3XmeCkYp/+zZjKtt/Xo7q4/WTy8G OulswRKRlogjJ5HvUK50Le31vPQ1waN8SXAZY0HvpBWBIeWasvmzTd9vE 3/Rpd2eKHy2zOLvtvh58DwlmMo9X5pUcmQ7kEd/xDSl8Feuni7aZObnT1 8wKLJ7A48/JwBGSHsP/FKOjvi8ujJC2w7fwfNau7r/Re8CTHEj37qtxwC w==; IronPort-SDR: fuC609NQHBv4sVwfaP8nv/TaILqX5q7fvyUTHggPlee4x/t/LO7GkNbcXHp+2V2404pz1iJH2p Mefwxnxl0qMEyquFLejbk78ybegFR60ATtiutNnKEzw7FMaiv1sQeh0wWTl9Dx8w6N31lD33kt 766gFrqqAzRLtuODFr9N5fVGITEelY3QsltsGsw3QvMvPmvYGnRUb2EfMH8SVj6KmSxMYFP+LF OLuBGRlwLSVsBeP9J6BHrTNI2rCTWaco0ubeM9ehIq+94UPW1Y1QSzrddocvb9pfbomEUxJtvH zTU= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="163856618" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:05:01 +0800 IronPort-SDR: dmQc6zWHhlp1Kuo4d6RnAamUi/SO9d/n+KohGH2iyxGndllBfGZ36Jocs56ClcKJFD1zTt0kfS IlxaH54+MKitkkgn4tV5wFDW1wNfR+4a6zu4SMOsMK2jgeEyRVMHXpK64TeejRTyTrxA4lxfdf wNNdkUqqJ14VjvDzYlcA6FU48fPfNSxRKZylD0wRiGQo7Ecjksa+8eufIiKNA3Rhq/BiRbyL9U KLqeRff40qqcDOq1/Cnx0t2pRp2QjeVFX0IZ1RgDqamQhIAa+MkjDkgTmP2X5enQfYkevXL0Vg m8RuPADHo3gLeJx5AztQaG+n Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:48:54 -0800 IronPort-SDR: TvntBeAolPC47uEpAHveeRKqEAmQL1bLDsoSWx9UpeX47q4cyQVQy0/0wIpmXUs9xAT7lHssFB L57BvqnFnKJXULcHqEPvzUOsd8dD+lK3twgfLVgzhBoeVPuQ4CwxXf6ijN+9cS23SbxJwwC1ca OiM7KkSy/vLyrwoKEiE0ZKxRIxUziNbioNV1M/OyOdDwMEiYT1CCLSrTb6O8b05Bfrul78hTkm 1+OzN7Zu9sty6jW/ftaKVNTes1sB5dbW9tkCcjLxoqLUiryAVTdKBf9m197WEQaorT4hlklXpH B3I= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:05:01 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 3/8] null_blk: use memcpy_page() in copy_to_nullb() Date: Sun, 7 Feb 2021 11:04:20 -0800 Message-Id: <20210207190425.38107-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 d6c821d48090..c9b6db82b07c 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1010,7 +1010,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); @@ -1024,11 +1023,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 Sun Feb 7 19:04:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AB0CC4332B for ; Sun, 7 Feb 2021 19:07:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E2D064E2F for ; Sun, 7 Feb 2021 19:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbhBGTG4 (ORCPT ); Sun, 7 Feb 2021 14:06:56 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:24872 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhBGTGt (ORCPT ); Sun, 7 Feb 2021 14:06:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612724809; x=1644260809; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dehfSSqAC1aZX9IJSa3h7Royg46gKKUc/ViSk1Qqt4w=; b=WZwpNOty3BPUFHcDBJiSB3D7FUX6a3v1mkptWtGQyTzAICp7VgBWjhfN utkYiZosb6BOnAp2GpEaUa9piZ67gdcJ/h+TupEEiAREiM9ogXn/Usu8i vEMtfFKy8A0w04mKX4ZjQ4PGQEluBgWJg3+HEmH/C3Q+OBwLVrG8GFP3U oai1Umg50GFrXLfp3ULPCaufyiIfJ8vcar0qmlzzQTlnBBDZZdQryk9iu w1tGjNYGZxZr9xZmKkpY5Q5slnQG0hpu6dEzhDw2nxHH7/LrhvSinS/St /Kz6CqwdK3tvFdVmpK7yKljsECdWjwfLPalKd+QTD972Tnlyfka4j/Tmr A==; IronPort-SDR: F8gL0u8taR9K/hBBZq1ALYAkFd436qU+4N3isSJ64+pIGmiwg5Qhvix6w23kK7J6cHwvDcu2Wf nP4VJrAcC23uQpGxNOCUbmyRc4IsOPv/JRUnmqGM67lTJJpHw0CPU3a56SPhFtMre5AizvAbj1 5RNCHdfbPq7BQgSxjFMfKfWQAZGUXNfMSkUOfuSc6u1I8zyq48HssnSYqg8ZKpUbAZ5D/pbdlT cobpbyC5NuCOC6Fmp2NrV0WqYxGS/iK1cstutOcS215B6GUjv7iIZvJzWiHrN1qw9LJnqCIWjb 7Nc= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="163856632" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:05:18 +0800 IronPort-SDR: JhBGXGoCZTzrn2Hizeh1WT8BzOAmVixm+E4wE/KvnoefdXvEneGeitJbnUzk6LgFnV/i9sbDvc hmz4t26N3l55owuiFiRAb04cA2NNb+c6Mi5wTr8nr9O7zyE3w/UcNHEVrmhNxE/armoteTghXZ GA+jJd9u65vyTreWeIwESro4rrSQXWnN19iC784F7R1qUoKjT79NfHT8CMUSpy180aVT7W47dQ M7Yx69ibBgFakyyOJ7vLt2vOXNnTq6zD4m3SWoeJR6U1jEMCADwwR6yVYThjQ3IRjORatgNOwr wzMJT62loEnjYS+52+ePjbVx Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:47:13 -0800 IronPort-SDR: /NXkTLt/6qjduDdq2JFD7H6ZU+2oB0Rep9ax9+DK8GZwj+QwFm5xGHo/lvt8Jhf3VxkmGz9WKT ozZQT+ilXxLz9H78tNiiEyGRBVVQePcWqrOyWOs7rre3+lFVAGrVsUvOX5xKbv0BNnkxYqCDo6 lcfJ0FnspF3wCcBsGYidK8L/jGC7u9NuvCYsuTVkTuxmgmuxeG/bdTYhdVz/T5bsstD10Aa/nN IJw8c3dJ5LpA9hTAS8X5AegS9FKMJ7cCnR8aKsp4kZvUGwJoa3LEMV3Fa3PQRHONuomK97B3SY j1k= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:05:18 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 4/8] null_blk: use memcpy_page() in copy_from_nullb() Date: Sun, 7 Feb 2021 11:04:21 -0800 Message-Id: <20210207190425.38107-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 c9b6db82b07c..1c0e1a295e90 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1042,7 +1042,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); @@ -1051,16 +1050,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 Sun Feb 7 19:04:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E548C43381 for ; Sun, 7 Feb 2021 19:07:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1288064E3E for ; Sun, 7 Feb 2021 19:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbhBGTGy (ORCPT ); Sun, 7 Feb 2021 14:06:54 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:37278 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbhBGTGt (ORCPT ); Sun, 7 Feb 2021 14:06:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612724809; x=1644260809; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rNdz9k9ffw5LAUxhwO57X4gVRFYzjraWgYm8UMbARD0=; b=Qxk2wI7NgxZvhytLnF4rBHG+AjGMM3a16j+keLAmErcADUE3z7Ia2yPW pjVaEwTgtkej1IegbdrxZnisuf17zSjrIeFbeMMeuiM7Yd+m2hV0tnjAu AqzBm0Rn+l9JIINunamAg5/nyLAUM7++4WSRDTaGVGp8aeXUBJHNSuPme ew6hi7fMGjN+BQsF6kFUav8zoPgL/kdoPdHOZbsPMd5G6Ut1kIHUbyBmd 8nvBYhXMy70aou1c5S9xqYs+TV9vfmblRsUVtMg1sg4wR+jmX/NeOuq35 whrvOte32p//rV0x0bVUyZFNEjjh/R4J2imOe5acmBii4YY7POCW9EKMZ Q==; IronPort-SDR: dJxVxxCAkdcZUfi0xKPrUBXmmWM1JW4feusKWlrGNz2SdDpymbeTXjUegXj66zGXVmFEy9lMok WV5FsbexIqIUCGCOUhCVxATQ7DhrXhwOYacceIAo/HVO8/uXuD1NkKXIBvXQ3hB+u9k8OC6t+v phWvndStwEtCb7JERnQHIivHrLhJhcwhr5WaoyKF3HpWREWYn7mjI2W074AQI06xFNkI8xUeru UUecdrVBmgZsLGrTgrLbLqaFaYBsbwaMGwRZcR3oWr4uyHp7M4k10CfawiY3eFVu9qZjoz7XtG z8M= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="159399773" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:05:41 +0800 IronPort-SDR: h1t2WzGezVJR93Oxz5zJ0b7hqTneFgSxaJ/j8C00m4kVnto8z5Gfdfd/0LfVDMWeyUN20gWd0B 3rG5a8hs9oUuBa2ZeP9tizi95rTx9fi2xQqgDVrD3ubaF0fuWPhiV7AwSMtf5N76sRhhdQIuoG T8d8TydhcsoneAZZNFOmff1GJCWDKNEVtwLxLOlUngKVI4BPiqT/xgwoaLCqtqxCU4MK/54iGI 4UZ+ilxumN3hJpoXWApwZNBk1hlUUU4IP1sBvlphAVvRUZ1YWDOKOvXDjUjSOKQ3dKd4M9ZRoj kFYNsQ8fPqwv97nSgPMW+IbE Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:49:35 -0800 IronPort-SDR: Mqq4oD3AeYBOMQHpGBqpa7pFTs3cc0c1FqPIJAN7pudJdrjE1cjRu0dCs025PGzN1w2mJSwrI8 aLMozTCLuRjHR3U2Ava6HaEOdzuNs6BKCjySlUFnlbnsz2mfLlHcpwKmSdmyHd92gceMCoHjff SrgH+/UBPE/azNd55IrtFOrGh9hfZBqgwHFD1ONIv1Su/ou3XzTuek77zBP92E3JHf9gMZ3g5V C8UdjLamPyOsH/7UOibmR6FxstwDhtHmvtbREVOVNEGrv3OlsgYYoV5l9pJ5DScQGhniarovqX 2lg= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:05:42 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 5/8] ext4: use memcpy_from_page() in pagecache_read() Date: Sun, 7 Feb 2021 11:04:22 -0800 Message-Id: <20210207190425.38107-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- fs/ext4/verity.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c index 5b7ba8f71153..c8e07f8a792d 100644 --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -45,16 +45,13 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); struct page *page; - void *addr; page = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT, NULL); if (IS_ERR(page)) return PTR_ERR(page); - addr = kmap_atomic(page); - memcpy(buf, addr + offset_in_page(pos), n); - kunmap_atomic(addr); + memcpy_from_page(buf, page, offset_in_page(pos), n); put_page(page); From patchwork Sun Feb 7 19:04:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 177D8C433E0 for ; Sun, 7 Feb 2021 19:07:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3BA764E2F for ; Sun, 7 Feb 2021 19:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbhBGTG7 (ORCPT ); Sun, 7 Feb 2021 14:06:59 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:40046 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbhBGTGz (ORCPT ); Sun, 7 Feb 2021 14:06:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612725733; x=1644261733; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e4vze4agz5qI/6i5moaf/fwbfxYs65n7gouRgw41U/E=; b=DlQ0j0HOrgUAJh8BkLfusxY8/Maf3SU/RYNUNnoy+IzXc+QfxVUQKSHl 8gXtZaWKL8qvo6Y6JqIc+VNq6HM58pRPEhjl61BaI2pL8FhZonBrxZpCQ HQGcux6+RJqevV8VCDT4WS8I4u9ixTJjyraVg5dX/zrZv2eRPYca+zVen sxQb3KP+PZKY2faEdi9tKFelHdRHg8shjGB1X3fQJIS6dfRVZmMMyKB7w 9kzk5W6Hm2//nh3nCWvYkaWh5Q66iyv64w3zk1xv8cNWOGUY7NuXwE/gS Y0+Z5ssd5Lbin5CRql1DsnU4kcvpi/ZEIrOnX7iW7sQ+JBI9Jqr8Wcb/0 Q==; IronPort-SDR: U30CByVFb5OHGcMW2JkcskUggPjOS4+c57wsDPFAWwbVw4k8NlAFFk3k+lrCxusmj2PG1U57dw gZ4ENYwmW+9PgBXq66L+Q2fu5GX4Ctd9FMnKZ1H3Hrk1qrwaxEYSsk8AnoaAEz9k6Y4znT25c0 VkobfG9hYu0g20HIe6xhXFqY8qLCGhLit0NyJeTRwV2P8BwkT6eC9ljxOu9MBmsTKFarV3X3fz Qks1LOrMF3D7Ka6J/RCmTIc1ftE/EKCuJN/2N9DZZw1vSPmbuDgJHQ2RvCocdub7vFRSVZlH2K txU= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="263497385" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:20:34 +0800 IronPort-SDR: UpQXkqJ1ixAs5/BGHBnXZklTe8fLP5vV0g/vGLCGGTpYI/040rSUtP//bZf4o3rzZLsfwOZcXX XNai8I07MSLN524ZVPbn71uhi2EJn5Fp2b767lT2iAknnfkJwIpaP3X0R/Vin3X/HHx3CTGjP1 E+PFPdIp+qFb/E8OrFscmDZWLS/uQUMc2JneLvSNYlNKqmv8o7JZADpgrsC3mcejixtcwz7X3p yhEoahBJERU03UAFeRwAPIcwExUwjNatrlPJBd+QzWu/EFeW+s+vMAHzLO6ugKZjtSoimOBkT6 hh0MoVejfUGyBWW3kIGowMT8 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:49:43 -0800 IronPort-SDR: 43sJyMm+E8HHgPMk2LqQoOndsIqMY2uxtZc9Zo3NeUktByX5cUc+e7r1vsPvEqvYJHKVJ3Or86 BuXhCpv7P+wcwaPweZ7VodIlEaWUlqrDMhvfVz8SFeQ3Has/3V7k9knr6HZcWkazEioNxOtfai 8hgEan6PoOi7NG1nMyP9jcXGC5ycxVtppZHe9HkTB5axK67Hbr3QSjYHfNv0ADwQ5FPYBEchp3 kydAR4oGU5ktepD0fHi4lz5EhxbrcYGVM1q/wuv/rWZ4YmLA9nHQTC2SyNZ/YZTuUVDqYbhNGb Dl4= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:05:50 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 6/8] ext4: use memcpy_to_page() in pagecache_write() Date: Sun, 7 Feb 2021 11:04:23 -0800 Message-Id: <20210207190425.38107-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- fs/ext4/verity.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c index c8e07f8a792d..cc4b046490b0 100644 --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -77,7 +77,6 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, PAGE_SIZE - offset_in_page(pos)); struct page *page; void *fsdata; - void *addr; int res; res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0, @@ -85,9 +84,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, if (res) return res; - addr = kmap_atomic(page); - memcpy(addr + offset_in_page(pos), buf, n); - kunmap_atomic(addr); + memcpy_to_page(page, offset_in_page(pos), buf, n); res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n, page, fsdata); From patchwork Sun Feb 7 19:04:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBA12C433E0 for ; Sun, 7 Feb 2021 19:07:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9BE564E35 for ; Sun, 7 Feb 2021 19:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbhBGTHY (ORCPT ); Sun, 7 Feb 2021 14:07:24 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:42837 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbhBGTHH (ORCPT ); Sun, 7 Feb 2021 14:07:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612724826; x=1644260826; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/sU16hyrajvlrgbsNAHlb0pAxwxEoMR2N8xqIOC5Bzw=; b=IlSvpcgsf5xMpaTId9WLF92FMxEIR6V5Qzr9DM7/0scTpq+kKDsz/frr 1d5L6fDa43o2kkEgbhvcS7NWXu/kRNLhajAhtgvWNifcwE1P3rqtADH8h 0O768kWmVFBp+oGMVnxA7iZyyebNwWP1TvYORR0TGcUqLtm4/G+Yvmv9v KYjX4r4QI8yBZeQnre3/QE+lQUOMl8kwEAWF0D0MVzR8RtH293sYln+0o XL8esizqJMqcUlcGvQj/e/6JXSH+JiN3cpWRaxpnc29/T6Hs6T4zJPe1V vHHPng4BMRm61ePOR92lNef7i+EBakB4cHdo9aaea4gLHe37db1Xa3aTj g==; IronPort-SDR: s6ShBjTAjmrKNqAkshbBgjTbIJSsZgaOcaZdxGLhcvIoLVv4vHkrE91rX+WY+jNhsFUYBPpJlY mi145DmVuG2E1DA/ty1fbx8DL+R0OPCfUrA2WLM4THcXy8dWdXshp+EsgLgeAF1MjfH06WkOUZ Wt2JVm85Y1CaulW88xGPbrPtG1elCgeHjJ37Yksu/zkISr2NO3LxGKIjbF/Ov+Oxx06U8f7z9K S1BlhGTwlVNoofkmBEC3lc54Af9X4ZZM1NWEpXkptEbbJ5MU8LZsD8P2rDYuPXd9YTDiB16sft mAQ= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="159383150" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:05:58 +0800 IronPort-SDR: MIa54v5F2BKt7tb5J7OKkJ7hyuv1pTwFeboCPPYNTWzZWf2RVBBjDIs1fYowaBLhr+YD5dzuWZ Mi3zc0fI66FHXKGIx4g1keCq9/cdZskbeBT1Fpo80CKAzjdPcF567jMHeiFYn4HnvFye9ci6Uo dao1KPowoUFC/cTTvccsWrc6NY0I8uJJCuj5icMdYC++ZavDuizfey+2yfhQEWJHc/p+guN8lD +eq9FN2vTChhPAKiZF4F+EqiJYmzRMFieN9lep1kcCrnXFP1SXPApn8H223NFEMXbNYYzLq+Ma YNvrO86bJQeJgvtLhArMk7FX Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:47:54 -0800 IronPort-SDR: Fh0a8KOx8UaWk2LjpLfdutmd2ZUZW4sTiB+72pFPwJmhQv9cItQK4N4vh6QK1NTzhF2pNQ2OQX ek/hhLyR9dj/BahvaXDLEkuILAf/UIf19rwag54p+32immh2DiQpUSJrcb5f/xx2eQS90p2Xp7 Z/mNQDvFZUBz4EGwOtn/urCM1pO9tHUayhheIx7bB1AaDLfK2huaALMv7a0fnTRBE5ttLKIhl7 32xqGxR0tsvTklF7k0y2ddxPy0Pct+UY5PvBXkbrm5prRkgWzo8U6vI3ViIKd4YZXu9DTfWuQC f5c= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:05:58 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 7/8] f2fs: use memcpy_from_page() in pagecache_read() Date: Sun, 7 Feb 2021 11:04:24 -0800 Message-Id: <20210207190425.38107-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- fs/f2fs/verity.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index 054ec852b5ea..44e057bdc416 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -47,16 +47,13 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); struct page *page; - void *addr; page = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT, NULL); if (IS_ERR(page)) return PTR_ERR(page); - addr = kmap_atomic(page); - memcpy(buf, addr + offset_in_page(pos), n); - kunmap_atomic(addr); + memcpy_from_page(buf, page, offset_in_page(pos), n); put_page(page); From patchwork Sun Feb 7 19:04:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12073387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B207C433E6 for ; Sun, 7 Feb 2021 19:07:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 670BF64E2F for ; Sun, 7 Feb 2021 19:07:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbhBGTHE (ORCPT ); Sun, 7 Feb 2021 14:07:04 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:38248 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbhBGTG7 (ORCPT ); Sun, 7 Feb 2021 14:06:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612725738; x=1644261738; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X5WW6UV6FqDYJmbiL6yKTiQZQYZsZ0lHrvx/ZJ7Pr8o=; b=PzD2vK+Vg0jOIhPJfsltbJRxQFQrAYNpjlw1xGTVY4duAPkGwhfGqBpb toZeWUfdEFYWSo0Zz5qQEYyKJIScLKD9/FWBmvjsrg8HRx5ErCmzWmg0K 0EyvxWi7aeYBU3iiMU2rX2Fol2UwSlqXUkwtaQG7JRiXeE5PQgnvaF6Gd Z7smanLFI1dXcAd6R/fyXNZl1UNhZQTrSHxOw/Ifai6/1594t4+kLzYWC PgknU2a6SZat2wLdWQ+SiNLL5os738xEi25gXS1+lt7J06Pqa0lab5G5D ndw94xKEQySeISggH7Mfcg2veH4otI8uPChyZvYVNO2LMFTk/gRoM626M Q==; IronPort-SDR: QxUzXNWJRnrPDrU6Qa8fPqpFpxrmhnGv8SZrAw/piMlNhSNzDBjIvArwnNKGaD2DerDiT+P4DH hEzKKztMOgYu+XxCLsCJH/NrDJ47cnXPu+fcEcVv32kY/Ih6Ltual0GBY7cKip0SOWvQaePiFD d1ZlINI716xF2achmCqf2MUyPyjTSoqTPYU4subx4fJC1z6HvBWdkY64O7x/A5tcj4Nczy4uHF CS6zJHeIhQSTKrYAzDLjOHkigpdDHPglmlt2OlefkS+QhHQ6RHqLPah6DzgUSb7tYe7b5//ijZ KXs= X-IronPort-AV: E=Sophos;i="5.81,160,1610380800"; d="scan'208";a="263497401" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 08 Feb 2021 03:21:00 +0800 IronPort-SDR: 1xQQe7mQqWV1A44BD9I2B3dfdI5zcFJVsE+7u2RQCW5ZL0zWX9rWN7cyaB0R+zVasgKs0cfhtx IrVPpqz9+OhNWf2fMUELvRTJfi3yLj7XGe3TnU7+8UlYcUFFuecER8MW5XlyF9ROZHwvoX75pG GiOwVsrYqO7lRpH6vfQ2Zres08hdtEWuMqs7YxMOkvsFkq+lWgEw7qcZTzvQA6HGIClHlz1qEl B1hUqqLybGI4GRaPGCsq4casiHcCE9uQzDzS6s3Kj4xbeBALlcATbdQLoFv9+Vek43Wnh5EkVn y/eU+pqnPF88X2kuOacwY3tY Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2021 10:50:00 -0800 IronPort-SDR: eyQcbbPL+QE6lR4V/WtfUglic+gwcpaSMs80dOnTDv4VmXGl6LWoRb6mk/guyFq9if3KfEA4Y7 +tXG9BYvfbMPOgq037oqaHmEsxLw9V2PI5yErlrc6L+Mh7JJRASNpQxBfRv1jha4D9cZKuX2NR CEtpkb5dd411Mei9z3RfYAwX5MHsi5Vi8Lbnj8j8d6gvT1bJ8mcdu5dS6zyy6dputIXiXA8OjF EAX3KlQYEoDQohdZGm9+Ljm8wP8nr0e3RDoa13Z+INL4FM6854rdwUGB35CmhKO2Y25D1ePrlH 8Ts= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 07 Feb 2021 11:06:07 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, chaitanya.kulkarni@wdc.com, dongli.zhang@oracle.com, clm@fb.com, ira.weiny@intel.com, dsterba@suse.com, ebiggers@kernel.org, hch@infradead.org, dave.hansen@intel.com Subject: [RFC PATCH 8/8] f2fs: use memcpy_to_page() in pagecache_write() Date: Sun, 7 Feb 2021 11:04:25 -0800 Message-Id: <20210207190425.38107-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> References: <20210207190425.38107-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- fs/f2fs/verity.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index 44e057bdc416..ca019685a944 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -79,7 +79,6 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, PAGE_SIZE - offset_in_page(pos)); struct page *page; void *fsdata; - void *addr; int res; res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0, @@ -87,9 +86,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, if (res) return res; - addr = kmap_atomic(page); - memcpy(addr + offset_in_page(pos), buf, n); - kunmap_atomic(addr); + memcpy_to_page(page, offset_in_page(pos) buf, n); res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n, page, fsdata);