From patchwork Wed Feb 12 17:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378847 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3412109A for ; Wed, 12 Feb 2020 17:08:09 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83D7720658 for ; Wed, 12 Feb 2020 17:08:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OKzpNeRG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83D7720658 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581527288; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=j6fYQP34rVHPIzuQcWjNnELC6MElr+eBCrivsbt6/C0=; b=OKzpNeRGd7GfXhiQq2vLJE3hdSNPbxVKwR8tzZjDkWETfnZDX9SEqKDd3S3RvmFQ1k1flr nDTgc49QZJASE6T/SNoLgCeJhaK9B0YKKn5SH4z2kmyU1gMYxV8PI2LwikU9etqq+VmxAI 2XVnxQZst7b32f46TbpdTZ/gw43KLhc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-fSRxAMuUM2W9a9wEB-C0QQ-1; Wed, 12 Feb 2020 12:08:05 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCBAB19251A0; Wed, 12 Feb 2020 17:07:58 +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 BDB195DA7C; Wed, 12 Feb 2020 17:07:58 +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 856B41803C38; Wed, 12 Feb 2020 17:07:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7oX7001118 for ; Wed, 12 Feb 2020 12:07:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 04EB360BF4; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from horse.redhat.com (unknown [10.18.25.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3098E60BF1; Wed, 12 Feb 2020 17:07:47 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id BB6FD2257D6; Wed, 12 Feb 2020 12:07:46 -0500 (EST) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, dan.j.williams@intel.com, hch@infradead.org Date: Wed, 12 Feb 2020 12:07:31 -0500 Message-Id: <20200212170733.8092-5-vgoyal@redhat.com> In-Reply-To: <20200212170733.8092-1-vgoyal@redhat.com> References: <20200212170733.8092-1-vgoyal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 4/6] dax, dm/md: Use dax_pgoff() instead of bdev_dax_pgoff() 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: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: fSRxAMuUM2W9a9wEB-C0QQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Replace usage of bdev_dax_pgoff() with dax_pgoff(). Signed-off-by: Vivek Goyal --- drivers/md/dm-linear.c | 9 ++++++--- drivers/md/dm-log-writes.c | 9 ++++++--- drivers/md/dm-stripe.c | 8 +++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 8d07fdf63a47..05f654044185 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -167,7 +167,8 @@ static long linear_dax_direct_access(struct dm_target *ti, pgoff_t pgoff, sector_t dev_sector, sector = pgoff * PAGE_SECTORS; dev_sector = linear_map_sector(ti, sector); - ret = bdev_dax_pgoff(bdev, dev_sector, nr_pages * PAGE_SIZE, &pgoff); + ret = dax_pgoff(get_start_sect(bdev), dev_sector, nr_pages * PAGE_SIZE, + &pgoff); if (ret) return ret; return dax_direct_access(dax_dev, pgoff, nr_pages, kaddr, pfn); @@ -182,7 +183,8 @@ static size_t linear_dax_copy_from_iter(struct dm_target *ti, pgoff_t pgoff, sector_t dev_sector, sector = pgoff * PAGE_SECTORS; dev_sector = linear_map_sector(ti, sector); - if (bdev_dax_pgoff(bdev, dev_sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(bdev), dev_sector, ALIGN(bytes, PAGE_SIZE), + &pgoff)) return 0; return dax_copy_from_iter(dax_dev, pgoff, addr, bytes, i); } @@ -196,7 +198,8 @@ static size_t linear_dax_copy_to_iter(struct dm_target *ti, pgoff_t pgoff, sector_t dev_sector, sector = pgoff * PAGE_SECTORS; dev_sector = linear_map_sector(ti, sector); - if (bdev_dax_pgoff(bdev, dev_sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(bdev), dev_sector, ALIGN(bytes, PAGE_SIZE), + &pgoff)) return 0; return dax_copy_to_iter(dax_dev, pgoff, addr, bytes, i); } diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index 99721c76225d..204fbceeb97e 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -952,7 +952,8 @@ static long log_writes_dax_direct_access(struct dm_target *ti, pgoff_t pgoff, sector_t sector = pgoff * PAGE_SECTORS; int ret; - ret = bdev_dax_pgoff(lc->dev->bdev, sector, nr_pages * PAGE_SIZE, &pgoff); + ret = dax_pgoff(get_start_sect(lc->dev->bdev), sector, + nr_pages * PAGE_SIZE, &pgoff); if (ret) return ret; return dax_direct_access(lc->dev->dax_dev, pgoff, nr_pages, kaddr, pfn); @@ -966,7 +967,8 @@ static size_t log_writes_dax_copy_from_iter(struct dm_target *ti, sector_t sector = pgoff * PAGE_SECTORS; int err; - if (bdev_dax_pgoff(lc->dev->bdev, sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(lc->dev->bdev), sector, + ALIGN(bytes, PAGE_SIZE), &pgoff)) return 0; /* Don't bother doing anything if logging has been disabled */ @@ -989,7 +991,8 @@ static size_t log_writes_dax_copy_to_iter(struct dm_target *ti, struct log_writes_c *lc = ti->private; sector_t sector = pgoff * PAGE_SECTORS; - if (bdev_dax_pgoff(lc->dev->bdev, sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(lc->dev->bdev), sector, + ALIGN(bytes, PAGE_SIZE), &pgoff)) return 0; return dax_copy_to_iter(lc->dev->dax_dev, pgoff, addr, bytes, i); } diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 63bbcc20f49a..337cdc6e0951 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -316,7 +316,8 @@ static long stripe_dax_direct_access(struct dm_target *ti, pgoff_t pgoff, dax_dev = sc->stripe[stripe].dev->dax_dev; bdev = sc->stripe[stripe].dev->bdev; - ret = bdev_dax_pgoff(bdev, dev_sector, nr_pages * PAGE_SIZE, &pgoff); + ret = dax_pgoff(get_start_sect(bdev), dev_sector, nr_pages * PAGE_SIZE, + &pgoff); if (ret) return ret; return dax_direct_access(dax_dev, pgoff, nr_pages, kaddr, pfn); @@ -336,7 +337,7 @@ static size_t stripe_dax_copy_from_iter(struct dm_target *ti, pgoff_t pgoff, dax_dev = sc->stripe[stripe].dev->dax_dev; bdev = sc->stripe[stripe].dev->bdev; - if (bdev_dax_pgoff(bdev, dev_sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(bdev), dev_sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) return 0; return dax_copy_from_iter(dax_dev, pgoff, addr, bytes, i); } @@ -355,7 +356,8 @@ static size_t stripe_dax_copy_to_iter(struct dm_target *ti, pgoff_t pgoff, dax_dev = sc->stripe[stripe].dev->dax_dev; bdev = sc->stripe[stripe].dev->bdev; - if (bdev_dax_pgoff(bdev, dev_sector, ALIGN(bytes, PAGE_SIZE), &pgoff)) + if (dax_pgoff(get_start_sect(bdev), dev_sector, ALIGN(bytes, PAGE_SIZE), + &pgoff)) return 0; return dax_copy_to_iter(dax_dev, pgoff, addr, bytes, i); }