[{"id":1760515,"web_url":"http://patchwork.ozlabs.org/comment/1760515/","msgid":"<20170830213951.GU4757@magnolia>","list_archive_url":null,"date":"2017-08-30T21:39:51","subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","submitter":{"id":18086,"url":"http://patchwork.ozlabs.org/api/people/18086/","name":"Darrick Wong","email":"darrick.wong@oracle.com"},"content":"On Wed, Aug 30, 2017 at 12:43:52PM -0700, Dan Williams wrote:\n> Add a helper that can replace the following common pattern:\n> \n> \tif (blk_queue_dax(bdev->bd_queue))\n> \t\tfs_dax_get_by_host(bdev->bd_disk->disk_name);\n> \n> This will be used to move dax_device lookup from iomap-operation time to\n> fs-mount time.\n> \n> Cc: Jan Kara <jack@suse.cz>\n> Cc: Christoph Hellwig <hch@lst.de>\n> Signed-off-by: Dan Williams <dan.j.williams@intel.com>\n\nReviewed-by: Darrick J. Wong <darrick.wong@oracle.com>\n\n> ---\n>  drivers/dax/super.c |   10 ++++++++++\n>  include/linux/dax.h |    6 ++++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/drivers/dax/super.c b/drivers/dax/super.c\n> index 938eb4868f7f..b699aac268a6 100644\n> --- a/drivers/dax/super.c\n> +++ b/drivers/dax/super.c\n> @@ -46,6 +46,8 @@ void dax_read_unlock(int id)\n>  EXPORT_SYMBOL_GPL(dax_read_unlock);\n>  \n>  #ifdef CONFIG_BLOCK\n> +#include <linux/blkdev.h>\n> +\n>  int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,\n>  \t\tpgoff_t *pgoff)\n>  {\n> @@ -59,6 +61,14 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,\n>  }\n>  EXPORT_SYMBOL(bdev_dax_pgoff);\n>  \n> +struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)\n> +{\n> +\tif (!blk_queue_dax(bdev->bd_queue))\n> +\t\treturn NULL;\n> +\treturn fs_dax_get_by_host(bdev->bd_disk->disk_name);\n> +}\n> +EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev);\n> +\n>  /**\n>   * __bdev_dax_supported() - Check if the device supports dax for filesystem\n>   * @sb: The superblock of the device\n> diff --git a/include/linux/dax.h b/include/linux/dax.h\n> index df97b7af7e2c..ac8afa18f707 100644\n> --- a/include/linux/dax.h\n> +++ b/include/linux/dax.h\n> @@ -57,6 +57,7 @@ static inline void fs_put_dax(struct dax_device *dax_dev)\n>  \tput_dax(dax_dev);\n>  }\n>  \n> +struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev);\n>  #else\n>  static inline int bdev_dax_supported(struct super_block *sb, int blocksize)\n>  {\n> @@ -71,6 +72,11 @@ static inline struct dax_device *fs_dax_get_by_host(const char *host)\n>  static inline void fs_put_dax(struct dax_device *dax_dev)\n>  {\n>  }\n> +\n> +static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)\n> +{\n> +\treturn NULL;\n> +}\n>  #endif\n>  \n>  int dax_read_lock(void);\n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe linux-xfs\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjJnj6sn0z9s8P\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 07:40:09 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751525AbdH3VkI (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 17:40:08 -0400","from userp1040.oracle.com ([156.151.31.81]:17359 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751519AbdH3VkG (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Wed, 30 Aug 2017 17:40:06 -0400","from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v7ULdsM8022578\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Wed, 30 Aug 2017 21:39:55 GMT","from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7ULdsYc024498\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Wed, 30 Aug 2017 21:39:54 GMT","from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11])\n\tby aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id\n\tv7ULdr8u021376; Wed, 30 Aug 2017 21:39:53 GMT","from localhost (/10.145.179.124)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Wed, 30 Aug 2017 14:39:53 -0700"],"Date":"Wed, 30 Aug 2017 14:39:51 -0700","From":"\"Darrick J. Wong\" <darrick.wong@oracle.com>","To":"Dan Williams <dan.j.williams@intel.com>","Cc":"linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,\n\tJan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,\n\tlinux-nvdimm@lists.01.org","Subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","Message-ID":"<20170830213951.GU4757@magnolia>","References":"<150412222686.10177.8031279869867070772.stgit@dwillia2-desk3.amr.corp.intel.com>\n\t<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Source-IP":"userv0021.oracle.com [156.151.31.71]","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}},{"id":1760736,"web_url":"http://patchwork.ozlabs.org/comment/1760736/","msgid":"<20170831082515.GF7897@quack2.suse.cz>","list_archive_url":null,"date":"2017-08-31T08:25:15","subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","submitter":{"id":363,"url":"http://patchwork.ozlabs.org/api/people/363/","name":"Jan Kara","email":"jack@suse.cz"},"content":"On Wed 30-08-17 12:43:52, Dan Williams wrote:\n> Add a helper that can replace the following common pattern:\n> \n> \tif (blk_queue_dax(bdev->bd_queue))\n> \t\tfs_dax_get_by_host(bdev->bd_disk->disk_name);\n> \n> This will be used to move dax_device lookup from iomap-operation time to\n> fs-mount time.\n> \n> Cc: Jan Kara <jack@suse.cz>\n> Cc: Christoph Hellwig <hch@lst.de>\n> Signed-off-by: Dan Williams <dan.j.williams@intel.com>\n\nLooks good to me. You can add:\n\nReviewed-by: Jan Kara <jack@suse.cz>\n\n\t\t\t\t\t\t\t\tHonza","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjb692vlVz9t16\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 18:25:21 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1750928AbdHaIZT (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 31 Aug 2017 04:25:19 -0400","from mx2.suse.de ([195.135.220.15]:56280 \"EHLO mx1.suse.de\"\n\trhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP\n\tid S1750848AbdHaIZS (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tThu, 31 Aug 2017 04:25:18 -0400","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 57B04AD1A;\n\tThu, 31 Aug 2017 08:25:17 +0000 (UTC)","by quack2.suse.cz (Postfix, from userid 1000)\n\tid CFDFA1E340B; Thu, 31 Aug 2017 10:25:15 +0200 (CEST)"],"X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","Date":"Thu, 31 Aug 2017 10:25:15 +0200","From":"Jan Kara <jack@suse.cz>","To":"Dan Williams <dan.j.williams@intel.com>","Cc":"linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,\n\tJan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,\n\tlinux-nvdimm@lists.01.org","Subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","Message-ID":"<20170831082515.GF7897@quack2.suse.cz>","References":"<150412222686.10177.8031279869867070772.stgit@dwillia2-desk3.amr.corp.intel.com>\n\t<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}},{"id":1760796,"web_url":"http://patchwork.ozlabs.org/comment/1760796/","msgid":"<20170831095541.GA21443@lst.de>","list_archive_url":null,"date":"2017-08-31T09:55:41","subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","submitter":{"id":82,"url":"http://patchwork.ozlabs.org/api/people/82/","name":"Christoph Hellwig","email":"hch@lst.de"},"content":"Looks fine,\n\nReviewed-by: Christoph Hellwig <hch@lst.de>","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjd6S4x5pz9t16\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 19:55:44 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1750915AbdHaJzn (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 31 Aug 2017 05:55:43 -0400","from verein.lst.de ([213.95.11.211]:54315 \"EHLO newverein.lst.de\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750883AbdHaJzm (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tThu, 31 Aug 2017 05:55:42 -0400","by newverein.lst.de (Postfix, from userid 2407)\n\tid 317159EDA3; Thu, 31 Aug 2017 11:55:41 +0200 (CEST)"],"Date":"Thu, 31 Aug 2017 11:55:41 +0200","From":"Christoph Hellwig <hch@lst.de>","To":"Dan Williams <dan.j.williams@intel.com>","Cc":"linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,\n\tJan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,\n\tlinux-nvdimm@lists.01.org","Subject":"Re: [PATCH v3 1/4] dax: introduce a fs_dax_get_by_bdev() helper","Message-ID":"<20170831095541.GA21443@lst.de>","References":"<150412222686.10177.8031279869867070772.stgit@dwillia2-desk3.amr.corp.intel.com>\n\t<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<150412223265.10177.11004612169458058274.stgit@dwillia2-desk3.amr.corp.intel.com>","User-Agent":"Mutt/1.5.17 (2007-11-01)","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}}]