Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp461063pxb; Thu, 26 Aug 2021 07:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydaNXJHoVnvOOKAOwPNYrKO4VQwG6xjuHXdnwW4016imJKTf0qgo5z6BJ1qRb4lzwCTzU4 X-Received: by 2002:a05:6e02:1d1a:: with SMTP id i26mr2827705ila.96.1629986862682; Thu, 26 Aug 2021 07:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629986862; cv=none; d=google.com; s=arc-20160816; b=nFnRbWjesSWU1LnbFXjxgLIZoDMt187LcB1eaXbu7J+PYNxWRwx2+1dYPmyKdQ3wIh 3fTS+wCsznaD89sewMm/Ix39kAanM2pGp1hBi9FycRw8QbE2Cn9nyyBoNwKvoydUw4jj mQf1yAyUbzuGNLEfblzbRvjhfR0TLDuQ9pYXrW9hYqA2UWihvvsFhle3Z+vNTyPV0AwF gCzGJneQASpUxX/Vgua0322S0onDiZT6//05QAw5jSOjywUXOs3yoxEGIFKeDFRgQxMN Sx0QSSJmbNsjkUK3XoN23Qg7LPZH3czzXF/qqFU5o3MjQsVypDGP/mCodJQOyxjDVSxl 97oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GQ/gJN8CFicuEaThGpULH2pYA5bMJDXYq/1YZIZJlJU=; b=jdlPkt5uF3EcFR825y2swkzvm7wk2OsNs9KEDORlWWCwsQrFEz5BeYa8Yk8bVuqTCs 8BYp17xBgs5eEsoX6umZMaWCJZFP7ADAGRtc+YtQfxZng7hPHPMXME63QjEzJB/CVhXg IT07rNH/Q8korjk/kqF7+dd+oysPLWcFDwz1sARV1i6XOi38wmhR+UHcHNqa1Z4hoc0h ygAtjEur+EcRRtOkUS15cjYqdlCg9qW2+1J4W2JZ6nFWqW+limHHPWQXWsrpodVHzA6Y +5YB9eAWDoQQbGjENieToGD9II/ZD4K14PhVSFSk1J3z6QK3hVTdAf+pqb5SxmNbk9AZ D3Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=efPqwyYf; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si2904629ios.4.2021.08.26.07.07.27; Thu, 26 Aug 2021 07:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=efPqwyYf; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbhHZOHj (ORCPT + 99 others); Thu, 26 Aug 2021 10:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhHZOHj (ORCPT ); Thu, 26 Aug 2021 10:07:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9FB6C061757; Thu, 26 Aug 2021 07:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=GQ/gJN8CFicuEaThGpULH2pYA5bMJDXYq/1YZIZJlJU=; b=efPqwyYfbcgScqpEVQt48wS6DM aedVSd2UoOhBVM+fs/kljIMt/bkMdcBWo2igLXpjdqpCkotLI2n1mnPpC+Wfg+ODvPEcpi86KGGQq xV2ZUVPjPlx9+tJ/ki1aC+CTElkPWOjs2iyVYY1wd1h3nf1STm9kydHEv62TnMcq5ce/jV2eXrTd8 qZxVnjoPiaYb517S/TmcfE0OaLSXGW7ZOoi8/YSyEa8elRtzULX0VaeUYd5IsGmacwZzRu3YJvdPi 4qQ5U1PjMHvOEtV49Xcy1EZUJ4VX47yjOJpiU4J5r2Mg+XTiTwe9gac27d6R370LCq63F6o0CmsRk PehupZAw==; Received: from [2001:4bb8:193:fd10:d9d9:6c15:481b:99c4] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJFyp-00DMYu-No; Thu, 26 Aug 2021 14:04:11 +0000 From: Christoph Hellwig To: Dan Williams , Vishal Verma , Dave Jiang Cc: Mike Snitzer , Matthew Wilcox , linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 8/9] xfs: factor out a xfs_buftarg_is_dax helper Date: Thu, 26 Aug 2021 15:55:09 +0200 Message-Id: <20210826135510.6293-9-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210826135510.6293-1-hch@lst.de> References: <20210826135510.6293-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Refactor the DAX setup code in preparation of removing bdev_dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/xfs/xfs_super.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 2c9e26a44546..5a89bf601d97 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -314,6 +314,14 @@ xfs_set_inode_alloc( return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; } +static bool +xfs_buftarg_is_dax( + struct super_block *sb, + struct xfs_buftarg *bt) +{ + return bdev_dax_supported(bt->bt_bdev, sb->s_blocksize); +} + STATIC int xfs_blkdev_get( xfs_mount_t *mp, @@ -1549,11 +1557,10 @@ xfs_fs_fill_super( xfs_warn(mp, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); - datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev, - sb->s_blocksize); + datadev_is_dax = xfs_buftarg_is_dax(sb, mp->m_ddev_targp); if (mp->m_rtdev_targp) - rtdev_is_dax = bdev_dax_supported( - mp->m_rtdev_targp->bt_bdev, sb->s_blocksize); + rtdev_is_dax = xfs_buftarg_is_dax(sb, + mp->m_rtdev_targp); if (!rtdev_is_dax && !datadev_is_dax) { xfs_alert(mp, "DAX unsupported by block device. Turning off DAX."); -- 2.30.2