From patchwork Wed Feb 12 17:07:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378841 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 A003D924 for ; Wed, 12 Feb 2020 17:08:05 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F24C206D7 for ; Wed, 12 Feb 2020 17:08:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BIeKNJE9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F24C206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3EB7110FC3390; Wed, 12 Feb 2020 09:11:18 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=vgoyal@redhat.com; receiver= 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 ml01.01.org (Postfix) with ESMTPS id 3801C10FC317F for ; Wed, 12 Feb 2020 09:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581527277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0QSDN4zqZX6JQThUAoXPpSXd0mGJ9FYDGlAgc1x+IyE=; b=BIeKNJE9IH21MlTFoU8IdIDKPcwHbeI0WbdzAR6xD2Vf7bcsWaUkM4t/nTX+M8ykSagalO wwF79z5PFVHeLR8CuBnZDAGyvPJtouL6cAZNNa+4ARyMhgfBeTbgJTQPN7XZBw+dIyJeRP uKOWXOf5rv0wNGekUchZ65qbLnyTXuI= 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-273-k3JbxwhlOA2CwoxrbWTETw-1; Wed, 12 Feb 2020 12:07:51 -0500 X-MC-Unique: k3JbxwhlOA2CwoxrbWTETw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B7008017CC; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20668388; Wed, 12 Feb 2020 17:07:47 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id AEE932257D3; 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 Subject: [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument Date: Wed, 12 Feb 2020 12:07:28 -0500 Message-Id: <20200212170733.8092-2-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.84 on 10.5.11.23 Message-ID-Hash: WY5FSCC57WWVG7YUQQLFWSYOOFE2QTMK X-Message-ID-Hash: WY5FSCC57WWVG7YUQQLFWSYOOFE2QTMK X-MailFrom: vgoyal@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: dm-devel@redhat.com, jack@suse.cz X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Create a new helper dax_pgoff() which will replace bdev_dax_pgoff(). Difference between two is that dax_pgoff() takes in "sector_t dax_offset" as an argument instead of "struct block_device". dax_offset specifies any offset into dax device which should be added to sector while calculating pgoff. Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 12 ++++++++++++ include/linux/dax.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0aa4b6bc5101..e9daa30e4250 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -56,6 +56,18 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, } EXPORT_SYMBOL(bdev_dax_pgoff); +int dax_pgoff(sector_t dax_offset, sector_t sector, size_t size, pgoff_t *pgoff) +{ + phys_addr_t phys_off = (dax_offset + sector) * 512; + + if (pgoff) + *pgoff = PHYS_PFN(phys_off); + if (phys_off % PAGE_SIZE || size % PAGE_SIZE) + return -EINVAL; + return 0; +} +EXPORT_SYMBOL(dax_pgoff); + #if IS_ENABLED(CONFIG_FS_DAX) struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) { diff --git a/include/linux/dax.h b/include/linux/dax.h index 328c2dbb4409..5101a4b5c1f9 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -111,6 +111,7 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, struct writeback_control; int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); +int dax_pgoff(sector_t dax_offset, sector_t, size_t, pgoff_t *pgoff); #if IS_ENABLED(CONFIG_FS_DAX) bool __bdev_dax_supported(struct block_device *bdev, int blocksize); static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize) 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: 11378815 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 D1E17191F for ; Wed, 12 Feb 2020 17:07:59 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACC5F21739 for ; Wed, 12 Feb 2020 17:07:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BDtF5561" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACC5F21739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E891610FC3379; Wed, 12 Feb 2020 09:11:15 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=205.139.110.120; helo=us-smtp-1.mimecast.com; envelope-from=vgoyal@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5BE841007B1FC for ; Wed, 12 Feb 2020 09:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581527275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4/c2s2GuSGDBWl7JNFoYav/ggi3RBj2wTD17cdDeOIw=; b=BDtF5561WN1SS62WBmKO4rAx8ODzkVCW4ttktz3qB0jH5shWyZIVN6g/t/s+FIIP75gf7I 8OZ8E9uuradkOpbnTN6osCVfS4bLPUQPV2APjyLJDw9T0HvVJtNIiFqrKy2Un2OuWPlre/ SU96itbmQdDI4STxLEUBdoOQIefCdc8= 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-64-tIVHKbPON-S-T3zmRJIxnQ-1; Wed, 12 Feb 2020 12:07:51 -0500 X-MC-Unique: tIVHKbPON-S-T3zmRJIxnQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0762010054E3; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) 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 Subject: [PATCH 4/6] dax, dm/md: Use dax_pgoff() instead of bdev_dax_pgoff() 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 Message-ID-Hash: JFXKJMFMNMEYCF57MCDQESVCN4QG7WVS X-Message-ID-Hash: JFXKJMFMNMEYCF57MCDQESVCN4QG7WVS X-MailFrom: vgoyal@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: dm-devel@redhat.com, jack@suse.cz X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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); } From patchwork Wed Feb 12 17:07:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378831 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 3A73D18B8 for ; Wed, 12 Feb 2020 17:08:02 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16C142465D for ; Wed, 12 Feb 2020 17:08:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gNcbxa1i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16C142465D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0591210FC337F; Wed, 12 Feb 2020 09:11:16 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=vgoyal@redhat.com; receiver= 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 ml01.01.org (Postfix) with ESMTPS id 0219B10FC317F for ; Wed, 12 Feb 2020 09:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581527275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Kx97YjoepQpQ0kz210ikU62VnqPVqaOjhm9SlazRBo=; b=gNcbxa1isplaIvP9rBjxqY2ejICIZ/qnU8BEf+6rbzT1vqz273d3oXqK5vyv5SZo7Ejh74 4fxcjGLwl/mXcQgtpT/ZjK+LSzXnQG2imJYukUvz6oayGDHzYO7oQjiyLsuREvTZtgVSw9 /OQFYYMhcpUJR8Fa19OrWJtwCHybt0k= 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-367-e1m5cTtcPZ-n_WXIgSZPsQ-1; Wed, 12 Feb 2020 12:07:51 -0500 X-MC-Unique: e1m5cTtcPZ-n_WXIgSZPsQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 432DF800D41; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21BC25C1B2; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id C052D2257D7; 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 Subject: [PATCH 5/6] drivers/dax: Use dax_pgoff() instead of bdev_dax_pgoff() Date: Wed, 12 Feb 2020 12:07:32 -0500 Message-Id: <20200212170733.8092-6-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.16 Message-ID-Hash: 6RZCOTNZ56ZFENU7CCHNP74RQJCTPERW X-Message-ID-Hash: 6RZCOTNZ56ZFENU7CCHNP74RQJCTPERW X-MailFrom: vgoyal@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: dm-devel@redhat.com, jack@suse.cz X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Start using dax_pgoff() instead of bdev_dax_pgoff(). Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index e9daa30e4250..ee35ecc61545 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -97,7 +97,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, return false; } - err = bdev_dax_pgoff(bdev, start, PAGE_SIZE, &pgoff); + err = dax_pgoff(get_start_sect(bdev), start, PAGE_SIZE, &pgoff); if (err) { pr_debug("%s: error: unaligned partition for dax\n", bdevname(bdev, buf)); @@ -105,7 +105,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, } last_page = PFN_DOWN((start + sectors - 1) * 512) * PAGE_SIZE / 512; - err = bdev_dax_pgoff(bdev, last_page, PAGE_SIZE, &pgoff_end); + err = dax_pgoff(get_start_sect(bdev), last_page, PAGE_SIZE, &pgoff_end); if (err) { pr_debug("%s: error: unaligned partition for dax\n", bdevname(bdev, buf)); From patchwork Wed Feb 12 17:07:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378845 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 7D68B13A4 for ; Wed, 12 Feb 2020 17:08:07 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C7AC2168B for ; Wed, 12 Feb 2020 17:08:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fais9dnF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C7AC2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5881310FC3393; Wed, 12 Feb 2020 09:11:24 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=vgoyal@redhat.com; receiver= 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 ml01.01.org (Postfix) with ESMTPS id 315F210FC3170 for ; Wed, 12 Feb 2020 09:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581527284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EFXOBK5kg+//3C1Cq5RJK/z4kqT5swnlhwxFrx47y84=; b=fais9dnFIufZPu49DWXnNHpwnAiSgOsB8/0CyMufSdBL4vQh57qPVROZqn4W5s469gPq1u qifgpBsareelXTdFy/FbNSar7+KfoqJR8C9ShQs7IIr8PinvrZaDsVuX0J/zX1qag9TY+t mX3mD7GqeoR25MBmjp/y5nSTTTjLyjA= 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-309-mUGUErWkMiihwvXwGDO0Wg-1; Wed, 12 Feb 2020 12:07:54 -0500 X-MC-Unique: mUGUErWkMiihwvXwGDO0Wg-1 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 C8EF5107ACCA; Wed, 12 Feb 2020 17:07:52 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 200F15D9E2; Wed, 12 Feb 2020 17:07:50 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id CAEF32257D8; 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 Subject: [PATCH 6/6] dax: Remove bdev_dax_pgoff() helper Date: Wed, 12 Feb 2020 12:07:33 -0500 Message-Id: <20200212170733.8092-7-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.14 Message-ID-Hash: VDYMQFC6LH4N3U42OUOGQS5PG762O4X4 X-Message-ID-Hash: VDYMQFC6LH4N3U42OUOGQS5PG762O4X4 X-MailFrom: vgoyal@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: dm-devel@redhat.com, jack@suse.cz X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Now there don't seem to be anyuser of bdev_dax_pgoff(). All users have been moved to dax_pgoff(). So remove this helper. Signed-off-by: Vivek Goyal --- drivers/dax/super.c | 13 ------------- include/linux/dax.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ee35ecc61545..371e391e6b1e 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -43,19 +43,6 @@ EXPORT_SYMBOL_GPL(dax_read_unlock); #ifdef CONFIG_BLOCK #include -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, - pgoff_t *pgoff) -{ - phys_addr_t phys_off = (get_start_sect(bdev) + sector) * 512; - - if (pgoff) - *pgoff = PHYS_PFN(phys_off); - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) - return -EINVAL; - return 0; -} -EXPORT_SYMBOL(bdev_dax_pgoff); - int dax_pgoff(sector_t dax_offset, sector_t sector, size_t size, pgoff_t *pgoff) { phys_addr_t phys_off = (dax_offset + sector) * 512; diff --git a/include/linux/dax.h b/include/linux/dax.h index 5101a4b5c1f9..84ed0e993190 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -110,7 +110,6 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, #endif struct writeback_control; -int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); int dax_pgoff(sector_t dax_offset, sector_t, size_t, pgoff_t *pgoff); #if IS_ENABLED(CONFIG_FS_DAX) bool __bdev_dax_supported(struct block_device *bdev, int blocksize);