Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp988740imm; Wed, 25 Jul 2018 09:30:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcavil4YL7QdQ0RvxWB9kt/ZX8FEua3JiAiMrrI+kI2/E1FLSsaIYlFMSxMlNAlPsY2WgEo X-Received: by 2002:a63:5b51:: with SMTP id l17-v6mr20740279pgm.165.1532536250711; Wed, 25 Jul 2018 09:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532536250; cv=none; d=google.com; s=arc-20160816; b=ebkFfAaZWNtR67UHGgxMqt9diyqdzZFccwFXtr2dd/2O4vCNLJPw6vB75tIvX53mjG 47u/1zM/a1CbDcpka6epHFHtUdgS+hCAPz9ILlSb6vjVa/cSHfH6xpsssfc4CpMs22ew sLJVcdrsVlQ17VfRGG/xk3wiSoe3pJvnW41wXN93cAK+LlVhbibCXeG0oNU+5BCZ91TO LSJwIplCXfhkc1AGsMAmngfW3NFHjACVAayjx32HgqJT2OEsaeKIFBPXNsmcz4VNEMj5 jXqcb5TfINybrXZ6ozD500CyGBB5/1WHAzIXGguUymPd5zWI2iKyL8pt7HAyqw0WDYeo kxQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :domainkey-signature:arc-authentication-results; bh=C+S+5mZXkFzP9NW59wmPgs0ckYS8NnX67dJt97LxaBw=; b=YRO6r6l1eySw3Np6pJEoy6Ew3fzJQGy52LCM7Bjg1CbdIQjuK5jZpraaldAZXxxROB 68en7mFcf2eEYa/y5hs5/DVFR/o3GwE5bI3LRZ4XKDB4fVXHJOwfw+vyiJURXFNIQuPU yneFIzLj/quPcPDPHMLZGbo7c+Ew58hqCVX2ushjeL1DF1F6iJ8UskG0qqh6Xmw/flzi x2ljdlI8lT/QojgERAni3SaLnrSeVqrJI7nZinTA8E7vmMT+mJoHRaoatccfmRYcYkRv sQm+K7o1JF5sAXuJO9tIiLy4aAqsUESquHGn6LR/hwXWPZpC3s3uCgq8cftcNUQikLYr ywsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o73-v6si13879717pfk.356.2018.07.25.09.30.35; Wed, 25 Jul 2018 09:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729169AbeGYRmC (ORCPT + 99 others); Wed, 25 Jul 2018 13:42:02 -0400 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25476 "EHLO sender-pp-092.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbeGYRmC (ORCPT ); Wed, 25 Jul 2018 13:42:02 -0400 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 Cc: ross.zwisler@linux.intel.com, willy@infradead.org, vishal.l.verma@intel.com, dave.jiang@intel.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, viro@zeniv.linux.org.uk, martin.petersen@oracle.com, axboe@kernel.dk, gregkh@linuxfoundation.org, bart.vanassche@wdc.com, jack@suse.cz, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, chengnt@lenovo.com, colyli@suse.de, Huaisheng Ye Subject: [PATCH v2 0/6] kaddr and pfn can be NULL to ->direct_access() Date: Thu, 26 Jul 2018 00:28:43 +0800 Message-Id: <20180725162849.8320-1-yehs2007@zoho.com> X-Mailer: git-send-email 2.17.0.windows.1 X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.8.3.1