From: Huaisheng Ye <yehs2007@zoho.com> To: linux-nvdimm@lists.01.org Cc: axboe@kernel.dk, linux-s390@vger.kernel.org, mawilcox@microsoft.com, chengnt@lenovo.com, jack@suse.com, heiko.carstens@de.ibm.com, linux-kernel@vger.kernel.org, bart.vanassche@wdc.com, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, schwidefsky@de.ibm.com, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless Date: Wed, 4 Jul 2018 14:40:58 +0800 [thread overview] Message-ID: <20180704064058.1344-3-yehs2007@zoho.com> (raw) In-Reply-To: <20180704064058.1344-1-yehs2007@zoho.com> From: Huaisheng Ye <yehs1@lenovo.com> Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. Signed-off-by: Huaisheng Ye <yehs1@lenovo.com> --- fs/dax.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index aaec72de..aa75dfd 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -550,7 +550,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; @@ -559,7 +558,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; @@ -961,7 +960,6 @@ 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) @@ -969,7 +967,7 @@ int __dax_zero_page_range(struct block_device *bdev, id = dax_read_lock(); rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, - &pfn); + NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1024,7 +1022,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; @@ -1036,7 +1033,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 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
WARNING: multiple messages have this Message-ID (diff)
From: Huaisheng Ye <yehs2007@zoho.com> To: linux-nvdimm@lists.01.org Cc: dan.j.williams@intel.com, ross.zwisler@linux.intel.com, mawilcox@microsoft.com, 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.com, chengnt@lenovo.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, Huaisheng Ye <yehs1@lenovo.com> Subject: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless Date: Wed, 4 Jul 2018 14:40:58 +0800 [thread overview] Message-ID: <20180704064058.1344-3-yehs2007@zoho.com> (raw) In-Reply-To: <20180704064058.1344-1-yehs2007@zoho.com> From: Huaisheng Ye <yehs1@lenovo.com> Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. Signed-off-by: Huaisheng Ye <yehs1@lenovo.com> --- fs/dax.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index aaec72de..aa75dfd 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -550,7 +550,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; @@ -559,7 +558,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; @@ -961,7 +960,6 @@ 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) @@ -969,7 +967,7 @@ int __dax_zero_page_range(struct block_device *bdev, id = dax_read_lock(); rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, - &pfn); + NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1024,7 +1022,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; @@ -1036,7 +1033,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
next prev parent reply other threads:[~2018-07-04 6:42 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-04 6:40 [PATCH 1/3] nvdimm/pmem: check the validity of the pointer pfn Huaisheng Ye 2018-07-04 6:40 ` Huaisheng Ye 2018-07-04 6:40 ` [PATCH 2/3] drivers/s390/block/dcssblk: " Huaisheng Ye 2018-07-04 6:40 ` Huaisheng Ye 2018-07-04 6:40 ` Huaisheng Ye [this message] 2018-07-04 6:40 ` [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless Huaisheng Ye 2018-07-04 11:30 ` Jan Kara 2018-07-04 11:30 ` Jan Kara 2018-07-04 13:07 ` Huaisheng Ye 2018-07-04 13:07 ` Huaisheng Ye 2018-07-04 13:07 ` Huaisheng Ye 2018-07-04 14:37 ` Dan Williams 2018-07-04 14:37 ` Dan Williams 2018-07-04 14:41 ` Dan Williams 2018-07-04 14:41 ` Dan Williams 2018-07-04 15:35 ` [External] " Huaisheng HS1 Ye 2018-07-04 15:35 ` Huaisheng HS1 Ye 2018-07-04 14:40 ` [PATCH 1/3] nvdimm/pmem: check the validity of the pointer pfn Dan Williams 2018-07-04 14:40 ` Dan Williams 2018-07-04 15:35 ` [External] " Huaisheng HS1 Ye 2018-07-04 15:35 ` Huaisheng HS1 Ye
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20180704064058.1344-3-yehs2007@zoho.com \ --to=yehs2007@zoho.com \ --cc=axboe@kernel.dk \ --cc=bart.vanassche@wdc.com \ --cc=chengnt@lenovo.com \ --cc=gregkh@linuxfoundation.org \ --cc=heiko.carstens@de.ibm.com \ --cc=jack@suse.com \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=linux-s390@vger.kernel.org \ --cc=mawilcox@microsoft.com \ --cc=schwidefsky@de.ibm.com \ --cc=viro@zeniv.linux.org.uk \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.