Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2574417imm; Mon, 16 Jul 2018 10:12:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQp8zvsCL1meSk9mFjC6v+o9SGhl+idjlsc+x5o+9fl/WbLqiSGdZ6hKtQyEewD1vq5Hf0 X-Received: by 2002:a63:338e:: with SMTP id z136-v6mr15902414pgz.171.1531761173872; Mon, 16 Jul 2018 10:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531761173; cv=none; d=google.com; s=arc-20160816; b=T7iGv3l/GLnu+yipXHEy9QV5jqglfpL07YX3e2CuCLzaVoj/yubZu9peV8T7UV/fcE MWFX95JbT7JNnWQHyCuPc5KAtxSNS71oYcl3UlHvYboDG6g1agZ/EhqxkdjQ387Pv/dl kwlXMc7g9xb0yDLT9VMAJMoyI4/9Ggfm6gaOjwjXxMv3abn+A/T7105o6v79YMCkoCIR sqLeVrtLpLc90YHMCJajgZCq4JBQ9c2EqAM33COofy2oovJTAniF2vPX2UYTucEZpExY 0Da1SUpcyKElg5IzYH+OnMVEDSeYsKF1iGQNnIGZGOj9efzPbdHSMO1unPNtiHvMOSco jrHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:arc-authentication-results; bh=i6kqJud/GbqdIh5IuQMfPAGc/5Bm77d6L3X+e3Zfv6g=; b=unH61n0p73QCxiCPI+Uv38SAYFLJHaXqtZr1AAMjP4kDADdCnyZ159i1jTYdGw9NMD XBobV9q9Fhgfvm3s49EJlKlxHsoZDRCAVIO2gz+6+6J/QHCnHNiUpLNV9rez7PMFBc5Q Cey2igzpwG8pktw/otJ3pxy++EB6w6jR5aLEMCXUNSyAJgbbeRRrq/H2gPRffyQnYR/K tsEfBWLrjxAc8vBhpbrBrh6BqDPP16hCSG7z/q0lic/BkabULrZ8QJRR2utqdc9HWCmh kLGzH03ITAvFi3vWjp2ftjthIZlRupRermrwJpV8JX035Bqv3I0/Zq3n/LbtLt5SSQva gFPA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z72-v6si29623239pgd.646.2018.07.16.10.12.38; Mon, 16 Jul 2018 10:12:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730933AbeGPRjw (ORCPT + 99 others); Mon, 16 Jul 2018 13:39:52 -0400 Received: from mga17.intel.com ([192.55.52.151]:13702 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727970AbeGPRjw (ORCPT ); Mon, 16 Jul 2018 13:39:52 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 10:11:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,362,1526367600"; d="scan'208";a="67428810" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga002.fm.intel.com with ESMTP; 16 Jul 2018 10:11:06 -0700 Subject: [PATCH v2 09/14] s390, dcssblk: Allow a NULL-pfn to ->direct_access() From: Dan Williams To: akpm@linux-foundation.org Cc: Huaisheng Ye , Jan Kara , vishal.l.verma@intel.com, hch@lst.de, linux-mm@kvack.org, jack@suse.cz, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Date: Mon, 16 Jul 2018 10:01:08 -0700 Message-ID: <153176046886.12695.7487453664953251895.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153176041838.12695.3365448145295112857.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153176041838.12695.3365448145295112857.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huaisheng Ye dcssblk_direct_access() needs to check the validity of pointer pfn for NULL assignment. If pfn equals to NULL, it doesn't need to calculate the value. This is in support of asynchronous memmap init and avoid page lookups when possible. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara Signed-off-by: Dan Williams --- drivers/s390/block/dcssblk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index ed607288e696..a645b2c93c34 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -923,8 +923,9 @@ __dcssblk_direct_access(struct dcssblk_dev_info *dev_info, pgoff_t pgoff, dev_sz = dev_info->end - dev_info->start + 1; *kaddr = (void *) dev_info->start + offset; - *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), - PFN_DEV|PFN_SPECIAL); + if (pfn) + *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), + PFN_DEV|PFN_SPECIAL); return (dev_sz - offset) / PAGE_SIZE; }