Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp488610pxb; Thu, 26 Aug 2021 07:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFQ9tzmEfjMZW7FVD2xeVpR5HrzO4een+kHUIjbTnX1qVaCLtbt441co1haJ5pSi8saJTJ X-Received: by 2002:a5e:8403:: with SMTP id h3mr3340776ioj.136.1629988731734; Thu, 26 Aug 2021 07:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629988731; cv=none; d=google.com; s=arc-20160816; b=RXOomntJe6OPDzS4h20Tj5gtN7GRxab6iDGD8UHv0T2/m26p7pCN7Twv6aziwq7enJ pJbMA/aSIecDnIIHgAx6GcQJY17xZmPfdrvoktUaOjmFZWcx45pI7qOGJ3Zs8RHPsrNq NsovWfYfHLDBNykgeaqCTf4194fJkAwXX8UuSSZV5b+0NuwwAFhVrz9hwtBBeUR33SXw pEl+0gUYSKwLWMC+846dSUPktFsCyg1vmf+QZKXfKnQCGblyi2RoGIMMD1oyz0kYIJDr 8CiB6AgBug4pi6cet5REIfESzjFnp1F4EPhox/R7xkfLkBWFaI1pA2Jn+/zgnLNFx0eH WBew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V2HF2Xls84jUZ7suMHbKiqQQLoSKjQ0Sp55OfKg/g+s=; b=DNCIxLzILm4Foz4YucW6e9gp7Wx4oayDviOFiVHTZH4Tzbsz/9IpGmYzlJvBVeBrwP qiDTFCB94nBiAdQfAgbEWgnVuB4OdzAB+tpO8yd4iylAybIjs97kuokapcJLSdJYvJCb TYkfbxZYOJ2JXvgKLpV+YWd8hneh1B4//Y6p3IeD5dIzxKcAWQm6J8y6GRkT/UxlU0+V 2LbfG5e+CgYjZ4umNMbbPzLx4twBPr+jf8G7DYYH0EcPyB4QMaoyuX0ETRqv5E3PcHBI 1pqQNatJs+qmHu9WHFdf2KDTkiMlkSASlJRc/GJBZs4jbfIS531IVhWFbBfdaHlly/8W JcpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Dco0Ve1H; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si3633680ilh.18.2021.08.26.07.38.32; Thu, 26 Aug 2021 07:38:51 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Dco0Ve1H; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242884AbhHZOi2 (ORCPT + 99 others); Thu, 26 Aug 2021 10:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242820AbhHZOi2 (ORCPT ); Thu, 26 Aug 2021 10:38:28 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01EC1C0613C1 for ; Thu, 26 Aug 2021 07:37:41 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id y11so2910094pfl.13 for ; Thu, 26 Aug 2021 07:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V2HF2Xls84jUZ7suMHbKiqQQLoSKjQ0Sp55OfKg/g+s=; b=Dco0Ve1HsF5HR6fQPSDcbsON7RovI6+GXbCjwy05Qf/MIvb+uEReb2jP0tUbbZNBUc RDLIpbZxUIgA2DcUbnEPUcoa+gAsV3xXBk0QJbhyJ6AN0mBlTsAOZgRyAYEF+kjGHOUq LAYslifFUXbJ5Kk6yi/lbXXokRTgOPv+Y5EQ3uNcweWCWEqgB8Z5VtwNKT+Yx9Jeg74V NSoDfvU5VDppT5xzPl0U17d/zETFIEcB8wplMdGZiW+W4bQDUs4XrknFSI+mRn3FrAoY ffP5hmJ6LWFsNAaXH9PegEQu0nH284g/XB2yoZc81qwEmGJMYlrhSyIHm3yufqyzLf7N vRHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V2HF2Xls84jUZ7suMHbKiqQQLoSKjQ0Sp55OfKg/g+s=; b=o8P4ux4NDucr2a3Gh62kDlFikZgK79dKyNH5VjtuJDXS44McGZk2odQ1BOXF/yM8+/ hZN2uEAiBUeE29mIIiH0atoVrCva/tlDmbxkPSHOxHNcat3lr0sOakTPchUILwcUZ5vt hboBjYuE+z1WVUygiG7V67n3ppeQFW7IRlTen+5HR+B9zzss/ejYE+qCHlT977glxq6c kr1Dcz0HKGVJj3gBVzxnomlUlST/Ucxlfi2g0rFdFfSfcCuag6FR1I/yIdNnfFf1/lPN jTtjMsOWBfxNnvI/tS6QGR9qb/cmRXaSYLy4hOVcmvqJQYypk7F+sflKVW0APBBp17Yq NbOw== X-Gm-Message-State: AOAM533x+0ZRP3PRpUOI30NuSZ9YZV+iiUyoGlmlXWSwt9bNiDwasGrW Jr2+RMyyOiYmbATwkh+t3gD+7XfZFeFDFwm7PqWh3w== X-Received: by 2002:a65:47c6:: with SMTP id f6mr3651187pgs.450.1629988660383; Thu, 26 Aug 2021 07:37:40 -0700 (PDT) MIME-Version: 1.0 References: <20210826135510.6293-1-hch@lst.de> <20210826135510.6293-9-hch@lst.de> In-Reply-To: <20210826135510.6293-9-hch@lst.de> From: Dan Williams Date: Thu, 26 Aug 2021 07:37:29 -0700 Message-ID: Subject: Re: [PATCH 8/9] xfs: factor out a xfs_buftarg_is_dax helper To: Christoph Hellwig Cc: Vishal Verma , Dave Jiang , Mike Snitzer , Matthew Wilcox , linux-xfs , Linux NVDIMM , linux-fsdevel , linux-ext4 , "Darrick J. Wong" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org [ add Darrick ] On Thu, Aug 26, 2021 at 7:07 AM Christoph Hellwig wrote: > > 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(-) Darrick, any concerns with me taking this through the dax tree? > > 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 > >