From patchwork Wed Jul 25 16:28:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10545391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95EB21822 for ; Thu, 26 Jul 2018 07:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8675A2A715 for ; Thu, 26 Jul 2018 07:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ABF52A7CB; Thu, 26 Jul 2018 07:48:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1750A2A715 for ; Thu, 26 Jul 2018 07:48:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34A2E5F744; Thu, 26 Jul 2018 07:48:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F308217134; Thu, 26 Jul 2018 07:48:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AB26B18037EF; Thu, 26 Jul 2018 07:48:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6PGTuXr032679 for ; Wed, 25 Jul 2018 12:29:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70C823083326; Wed, 25 Jul 2018 16:29:56 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A94F30012B1; Wed, 25 Jul 2018 16:29:51 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4B7C307D853; Wed, 25 Jul 2018 16:29:49 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id; b=aV/9QE9mzcksi9RQ982PkR6fOWTxeBmZRa5EG9AlJVRnenjEcIc8DtWb4pI3+TBdf3RoMYIkfu9U n0zjz2A81S23QBJY5as9RFwLMMbxqPru+BKLLuNPglPWzzPqO5PK Received: from YEHS1XR956R00D1.lenovo.com (114.245.13.10 [114.245.13.10]) by mx.zohomail.com with SMTPS id 15325361439801006.2989965103092; Wed, 25 Jul 2018 09:29:03 -0700 (PDT) From: Huaisheng Ye To: linux-nvdimm@lists.01.org, dan.j.williams@intel.com Date: Thu, 26 Jul 2018 00:28:43 +0800 Message-Id: <20180725162849.8320-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 25 Jul 2018 16:29:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 25 Jul 2018 16:29:50 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 26 Jul 2018 03:48:35 -0400 Cc: axboe@kernel.dk, linux-s390@vger.kernel.org, dave.jiang@intel.com, snitzer@redhat.com, martin.petersen@oracle.com, vishal.l.verma@intel.com, chengnt@lenovo.com, linux-fsdevel@vger.kernel.org, heiko.carstens@de.ibm.com, linux-kernel@vger.kernel.org, willy@infradead.org, colyli@suse.de, bart.vanassche@wdc.com, dm-devel@redhat.com, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, schwidefsky@de.ibm.com, jack@suse.cz, ross.zwisler@linux.intel.com, agk@redhat.com, Huaisheng Ye Subject: [dm-devel] [PATCH v2 0/6] kaddr and pfn can be NULL to ->direct_access() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 26 Jul 2018 07:48:57 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye Changes since v1 [1]: * Involve the previous patches for pfn can be NULL. * Reword the patch descriptions according to Christian's comment. * According to Ross's suggestion, replace local pointer dummy_addr with NULL within md/dm-writecache for direct_access. [1]: https://lkml.org/lkml/2018/7/24/199 Some functions within fs/dax, dax/super and md/dm-writecache don't need to get local pointer kaddr or variable pfn from direct_access. Assigning NULL to kaddr or pfn to ->direct_access() is more straightforward and simple than offering a useless local pointer or variable. So all ->direct_access() need to check the validity of pointer kaddr and pfn for NULL assignment. If either of them is equal to NULL, that is to say callers may have no need for kaddr or pfn, so this series of patch are prepared for allowing them to pass in NULL instead of having to pass in a local pointer or variable that they then just throw away. Huaisheng Ye (6): libnvdimm, pmem: kaddr and pfn can be NULL to ->direct_access() s390, dcssblk: kaddr and pfn can be NULL to ->direct_access() tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() dax/super: Do not request a pointer kaddr when not required md/dm-writecache: Don't request pointer dummy_addr when not required filesystem-dax: Do not request kaddr and pfn when not required drivers/dax/super.c | 3 +-- drivers/md/dm-writecache.c | 3 +-- drivers/nvdimm/pmem.c | 7 +++++-- drivers/s390/block/dcssblk.c | 8 +++++--- fs/dax.c | 13 ++++--------- tools/testing/nvdimm/pmem-dax.c | 12 ++++++++---- 6 files changed, 24 insertions(+), 22 deletions(-) Reviewed-by: Ross Zwisler