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: 11378849 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 DA418109A for ; Wed, 12 Feb 2020 17:08:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 981FB20658 for ; Wed, 12 Feb 2020 17:08:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xhltet9V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 981FB20658 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=1581527290; 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=fr3O0+18BaXwvEerXklK2JqZwCeRTmRR0gTzYVqoLK0=; b=Xhltet9VKbZKtpIC6Gcy+R+DCQX7XXB1KOK3o7cj4+5DvHVTWOCERlLgXcU3ZvI2IIsJMK 97swQQEFP3yGvvfH2zjk+NzhVvqjjI6cH/luGLryER6NE84ptHp1KIiRt3sTqU0ZtVVpvO NJc6nSgJ+7t3WBGIR42aAL4d+DU4/ao= 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-Nye9_V1yN4el50I2FpduhQ-1; Wed, 12 Feb 2020 12:08:07 -0500 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 2EFD7DBA5; Wed, 12 Feb 2020 17:08:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F354D60BF1; Wed, 12 Feb 2020 17:08:01 +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 94C4B8B2AD; Wed, 12 Feb 2020 17:08:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7oMd001119 for ; Wed, 12 Feb 2020 12:07:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 07F8226FB6; 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 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 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 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument 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.12 X-MC-Unique: Nye9_V1yN4el50I2FpduhQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378835 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 908AB1986 for ; Wed, 12 Feb 2020 17:08:02 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.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 4FCFC206D7 for ; Wed, 12 Feb 2020 17:08:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JoCLpq1o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FCFC206D7 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=1581527281; 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=GpCidgZh6ewl83zD5LjZnY8ofFVxm3xj2xYIUups2Qk=; b=JoCLpq1o6cUKIeGJm/9EKKyZ2TzNuCeeXxSrD/zh+PDRrx71Iuhbvv8JzFqhsog2ApFGuR NSAcPmkrGk4BGYpq5qQNjx+AfIGe9XPGP3uMpTCDvZJ9SCR/J9u4Z0VwZ1rZp7IGDkvhHO 9XEa8k/W2FXKKu5rbnmlV+mlZFyxJ70= 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-33-LAfQldrSP3Cdg0NULYzPPQ-1; Wed, 12 Feb 2020 12:07:56 -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 44EDF801E66; Wed, 12 Feb 2020 17:07:52 +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 1F18B5DA7C; Wed, 12 Feb 2020 17:07:52 +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 B20741803C32; Wed, 12 Feb 2020 17:07:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7nwi001103 for ; Wed, 12 Feb 2020 12:07:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9FC5B5C102; Wed, 12 Feb 2020 17:07:49 +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 281445C101; Wed, 12 Feb 2020 17:07:47 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id B29462257D4; 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:29 -0500 Message-Id: <20200212170733.8092-3-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.15 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 2/6] dax, iomap, ext4, ext2, xfs: Save dax_offset in "struct iomap" 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: LAfQldrSP3Cdg0NULYzPPQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Add a new field "sector_t dax_offset" to "struct iomap". This will be filled by filesystems and dax code will make use of this to convert sector into page offset (dax_pgoff()), instead of bdev_dax_pgoff(). This removes the dependency of having to pass in block device for dax operations. Signed-off-by: Vivek Goyal --- fs/ext2/inode.c | 1 + fs/ext4/inode.c | 1 + fs/xfs/xfs_iomap.c | 2 ++ include/linux/iomap.h | 1 + 4 files changed, 5 insertions(+) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index c885cf7d724b..5c3379e78d49 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -823,6 +823,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length, iomap->bdev = inode->i_sb->s_bdev; iomap->offset = (u64)first_block << blkbits; iomap->dax_dev = sbi->s_daxdev; + iomap->dax_offset = get_start_sect(iomap->bdev); if (ret == 0) { iomap->type = IOMAP_HOLE; diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 1305b810c44a..0ea7fbb8076f 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3330,6 +3330,7 @@ static void ext4_set_iomap(struct inode *inode, struct iomap *iomap, iomap->bdev = inode->i_sb->s_bdev; iomap->dax_dev = EXT4_SB(inode->i_sb)->s_daxdev; + iomap->dax_offset = get_start_sect(iomap->bdev); iomap->offset = (u64) map->m_lblk << blkbits; iomap->length = (u64) map->m_len << blkbits; diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index bb590a267a7f..ad8b18fc96fd 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -80,6 +80,7 @@ xfs_bmbt_to_iomap( iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount); iomap->bdev = target->bt_bdev; iomap->dax_dev = target->bt_daxdev; + iomap->dax_offset = get_start_sect(iomap->bdev); iomap->flags = flags; if (xfs_ipincount(ip) && @@ -103,6 +104,7 @@ xfs_hole_to_iomap( iomap->length = XFS_FSB_TO_B(ip->i_mount, end_fsb - offset_fsb); iomap->bdev = target->bt_bdev; iomap->dax_dev = target->bt_daxdev; + iomap->dax_offset = get_start_sect(iomap->bdev); } static inline xfs_fileoff_t diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 8b09463dae0d..cac5d667aa74 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -84,6 +84,7 @@ struct iomap { u16 flags; /* flags for mapping */ struct block_device *bdev; /* block device for I/O */ struct dax_device *dax_dev; /* dax_dev for dax operations */ + sector_t dax_offset; /* offset in dax device */ void *inline_data; void *private; /* filesystem private */ const struct iomap_page_ops *page_ops; From patchwork Wed Feb 12 17:07:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 11378837 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 3997F1984 for ; Wed, 12 Feb 2020 17:08:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E794224650 for ; Wed, 12 Feb 2020 17:07:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CP/Qs6AY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E794224650 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=1581527278; 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=JLMjw/35JB8QyMUG6l91OamzqgGlEOH8lAcIAZYMZrw=; b=CP/Qs6AYqAoXHBxNriaKHM5lGdsiYlJF2ZoFohLnYyTjThVqeo2iLHaE0phuzaQIx/w/p2 bNXUjkHiadY2GnHZhoBRHEEWEx+tYArVLjR1kvAVs/+lY9fLNrdIjDGetfSPB59xCpW0K3 tuS97cTADYKeMQkvrtaR7Iek0bIPF7I= 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-204-tjeQ7uj2NYmydJjkH_ds_A-1; Wed, 12 Feb 2020 12:07:56 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61C18100550E; Wed, 12 Feb 2020 17:07:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18A465C101; Wed, 12 Feb 2020 17:07:52 +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 19F838B2A3; Wed, 12 Feb 2020 17:07:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7nXx001108 for ; Wed, 12 Feb 2020 12:07:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id B9CF05C1BB; Wed, 12 Feb 2020 17:07:49 +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 26F8F5C1B2; Wed, 12 Feb 2020 17:07:47 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id B766D2257D5; 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:30 -0500 Message-Id: <20200212170733.8092-4-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 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 3/6] fs/dax.c: Start using 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.15 X-MC-Unique: tjeQ7uj2NYmydJjkH_ds_A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Replace usage of bdev_dax_pgoff() with dax_pgoff() in fs/dax.c Signed-off-by: Vivek Goyal --- fs/dax.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 35da144375a0..921042a81538 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -680,7 +680,7 @@ int dax_invalidate_mapping_entry_sync(struct address_space *mapping, return __dax_invalidate_entry(mapping, index, false); } -static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, +static int copy_user_dax(struct dax_device *dax_dev, sector_t dax_offset, sector_t sector, size_t size, struct page *to, unsigned long vaddr) { @@ -689,7 +689,7 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, long rc; int id; - rc = bdev_dax_pgoff(bdev, sector, size, &pgoff); + rc = dax_pgoff(dax_offset, sector, size, &pgoff); if (rc) return rc; @@ -990,7 +990,7 @@ static int dax_iomap_pfn(struct iomap *iomap, loff_t pos, size_t size, int id, rc; long length; - rc = bdev_dax_pgoff(iomap->bdev, sector, size, &pgoff); + rc = dax_pgoff(iomap->dax_offset, sector, size, &pgoff); if (rc) return rc; id = dax_read_lock(); @@ -1065,7 +1065,7 @@ int __dax_zero_page_range(struct block_device *bdev, long rc, id; void *kaddr; - rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff); + rc = dax_pgoff(get_start_sect(bdev), sector, PAGE_SIZE, &pgoff); if (rc) return rc; @@ -1087,7 +1087,6 @@ static loff_t dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct iomap *iomap, struct iomap *srcmap) { - struct block_device *bdev = iomap->bdev; struct dax_device *dax_dev = iomap->dax_dev; struct iov_iter *iter = data; loff_t end = pos + length, done = 0; @@ -1132,7 +1131,7 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, break; } - ret = bdev_dax_pgoff(bdev, sector, size, &pgoff); + ret = dax_pgoff(iomap->dax_offset, sector, size, &pgoff); if (ret) break; @@ -1312,7 +1311,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp, clear_user_highpage(vmf->cow_page, vaddr); break; case IOMAP_MAPPED: - error = copy_user_dax(iomap.bdev, iomap.dax_dev, + error = copy_user_dax(iomap.dax_dev, iomap.dax_offset, sector, PAGE_SIZE, vmf->cow_page, vaddr); break; default: 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); } 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: 11378843 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 6D967924 for ; Wed, 12 Feb 2020 17:08:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DB0220658 for ; Wed, 12 Feb 2020 17:08:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bhxABBeq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB0220658 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=1581527286; 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=s0AopkiRpXBcaCQnbNmZ0p9UpQuFH17/1+aevvwZmPc=; b=bhxABBeq+1sD9Tz8g1hbgCdldt7itp7jyo/r9Hz/Jra3r3wB5DvMw5vq6ydJv9rE7JmV8n LPCaN0Swbws5AM14wikqRWo+7szKL6iV6cs2W3xuVPKWRyuFZdkeyZabmhQdNr2o8+kaz7 frkvFKUlLpeB9+I0BqhWhTUTHQtHNmU= 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-331-W4N6z7YNP_WF9Rw_03aR_g-1; Wed, 12 Feb 2020 12:08:04 -0500 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 DCAE0DBA6; Wed, 12 Feb 2020 17:07:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA1AA60BF4; 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 813CC8B2AD; Wed, 12 Feb 2020 17:07:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7o83001128 for ; Wed, 12 Feb 2020 12:07:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 40D8F5C1C3; 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 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 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 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 5/6] drivers/dax: 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.12 X-MC-Unique: W4N6z7YNP_WF9Rw_03aR_g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: 11378851 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 8FAB3924 for ; Wed, 12 Feb 2020 17:08:12 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E69420658 for ; Wed, 12 Feb 2020 17:08:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TEEixgBm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E69420658 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=1581527291; 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=Bd3rEXPUIAsIPUE+EWvAtvgwslLC0d4NDpJj77CRp5Q=; b=TEEixgBmARN4Y9Qc9jsIJ20WWVoxswRJOGm1tUkV1k3jz6dVw0lzdmc8aWlrU89QOelE+m Xypu3GAi/QL2EklD+7iHuIlKPoG5ReOxVpGRSzmW/ho3nXMcOn/8eFHW0786JmWDlnCg+h 0sbHeyOdCE+JjWj1MJtqajWDqRTQv30= 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-310-durpG8LfORWcMXMDw3HTPA-1; Wed, 12 Feb 2020 12:08:08 -0500 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 35DB2107B278; Wed, 12 Feb 2020 17:08:02 +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 0F1EA38C; Wed, 12 Feb 2020 17:08:02 +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 AB2941803C40; Wed, 12 Feb 2020 17:08:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01CH7qTY001161 for ; Wed, 12 Feb 2020 12:07:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id C67E85DA83; Wed, 12 Feb 2020 17:07:52 +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 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 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 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, jack@suse.cz, vgoyal@redhat.com Subject: [dm-devel] [PATCH 6/6] dax: Remove bdev_dax_pgoff() helper 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.84 on 10.5.11.23 X-MC-Unique: durpG8LfORWcMXMDw3HTPA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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);