Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp990098imm; Wed, 25 Jul 2018 09:32:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdD6I06dKNlJexjFRyqW3oEA5iLy3EKhGTMkN3KBnChVOEn9KJlBG/ro4whJWpgo6p8rIn5 X-Received: by 2002:a63:5204:: with SMTP id g4-v6mr21550608pgb.274.1532536324460; Wed, 25 Jul 2018 09:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532536324; cv=none; d=google.com; s=arc-20160816; b=sfpJgvkdHspE2CaLyN3Vtz5zEUxVPHE8DD77MBNU5oJw0JNX437PXQRE8M5xQ5MQtv sAz71765D7RvyBquYtlT5XtAGLlkSQc0MMAQCtCKC6bokmBbRAwI5lzl7w2PlPbd72MK EiIRZ+SslmRkoH6F4sZhBtNmIwvFLYOxAH4hYXFGzCMmtt3a/m12QbNKPML++LkQQ3jg vvRAVE3nuIWBgjN68fuoihaH/iUkGbQMsrwGXIUhBbKDBjJxPu9nJir0t7JfgmBm+vIR +8SqIGUMbPIkFABMM9c9N39FAMuGA+aiCEetpO6ORMc0mvMgqcnxlXwJb/AezoEG/ciJ HYLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:domainkey-signature:arc-authentication-results; bh=uI0ItH37raG6ccn7aAKUKp0hRvnhDtneWn0RJ4O/GPM=; b=EZwMBZhRl3n6chtCN3E2xqp6x0pjq1a44/OEKI7AbGwiYbqh79Lh1ohri1I0lKsLuX koqxNFNeujz22B2y84C99qTU6yDLQZTjWRP6qYUBE6SUe7l0EBmFQuZOeLzDZlqawPOl at1vskl9D5fNxp8CLoc9UAaZ441kyao94xmHCu5qn7fiekfsWJgIxT9TAsNe9O9qC0Tc B+3sqnMfETi0QaEipL2VFTOLIbudtf6mIGzISNbEEoMMDnQW1G/eItQwiQ7CVd4akLQw nHLrbgwohEOJnsAFdfsMTmssCHW1IXg8NpRjq3jVENM+ehqwtvjkGkZdUGpahxuBeqmr UJ/A== 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 m126-v6si16051375pfb.126.2018.07.25.09.31.49; Wed, 25 Jul 2018 09:32:04 -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 S1729852AbeGYRm5 (ORCPT + 99 others); Wed, 25 Jul 2018 13:42:57 -0400 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25364 "EHLO sender-pp-092.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbeGYRm5 (ORCPT ); Wed, 25 Jul 2018 13:42:57 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=buHtnRQIztHU6fFkQS7zGn0jfsJgNhXixsLxPNOJQW8u8WGirxU6EdVVObI5EWEzIVoeGmk24XQB lSkjSOr4HuTWKf57lSBjPz0DTNj4J+t3V7XJGJr9Fd7O03ecyyeT Received: from YEHS1XR956R00D1.lenovo.com (114.245.13.10 [114.245.13.10]) by mx.zohomail.com with SMTPS id 1532536203055619.6206658358504; Wed, 25 Jul 2018 09:30: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 6/6] filesystem-dax: Do not request kaddr and pfn when not required Date: Thu, 26 Jul 2018 00:28:49 +0800 Message-Id: <20180725162849.8320-7-yehs2007@zoho.com> X-Mailer: git-send-email 2.17.0.windows.1 In-Reply-To: <20180725162849.8320-1-yehs2007@zoho.com> References: <20180725162849.8320-1-yehs2007@zoho.com> 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 Some functions within fs/dax don't need to get local pointer kaddr or variable pfn from direct_access. Using NULL instead of having to pass in useless pointer or variable that caller then just throw away. Signed-off-by: Huaisheng Ye --- fs/dax.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 6411928..959a533 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -647,7 +647,6 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, { void *vto, *kaddr; pgoff_t pgoff; - pfn_t pfn; long rc; int id; @@ -656,7 +655,7 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, &pfn); + rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -967,7 +966,6 @@ static int dax_iomap_pfn(struct iomap *iomap, loff_t pos, size_t size, { const sector_t sector = dax_iomap_sector(iomap, pos); pgoff_t pgoff; - void *kaddr; int id, rc; long length; @@ -976,7 +974,7 @@ static int dax_iomap_pfn(struct iomap *iomap, loff_t pos, size_t size, return rc; id = dax_read_lock(); length = dax_direct_access(iomap->dax_dev, pgoff, PHYS_PFN(size), - &kaddr, pfnp); + NULL, pfnp); if (length < 0) { rc = length; goto out; @@ -1052,15 +1050,13 @@ int __dax_zero_page_range(struct block_device *bdev, pgoff_t pgoff; long rc, id; void *kaddr; - pfn_t pfn; rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff); if (rc) return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, - &pfn); + rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1116,7 +1112,6 @@ int __dax_zero_page_range(struct block_device *bdev, ssize_t map_len; pgoff_t pgoff; void *kaddr; - pfn_t pfn; if (fatal_signal_pending(current)) { ret = -EINTR; @@ -1128,7 +1123,7 @@ int __dax_zero_page_range(struct block_device *bdev, break; map_len = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), - &kaddr, &pfn); + &kaddr, NULL); if (map_len < 0) { ret = map_len; break; -- 1.8.3.1