From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AF5A68 for ; Mon, 1 Nov 2021 16:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635784122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=AvCPbg1FTPfLMjWc7ypl3iG98diUCbhNwGIK33qkzkphpEsehtLzuq/IYpiYpQgrCy2L7+ c3v1KDixloqG3Ng3ccyy3cjQGIe8vA5LCddSAnMrItTSCPBgIsoibsijzZcddq7PkRalMS 2V2TvGAHoAUFgWvumnraXAfhel7N1zI= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-O4oMTBzlNL2mefWN-pjPyQ-1; Mon, 01 Nov 2021 12:28:41 -0400 X-MC-Unique: O4oMTBzlNL2mefWN-pjPyQ-1 Received: by mail-qt1-f199.google.com with SMTP id b9-20020ac87fc9000000b002ac69ae062bso5521892qtk.7 for ; Mon, 01 Nov 2021 09:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=pvXJVUdBdXNoS4taf6z7CuDhCcZt83TfGhQgZUP6hO4MAdEQUOiUDyQTFsBLnmLvm8 T736WUc8OtDqqMUdasOe7ae7AXnLYHRsxqQ2mBiew/rN6/xZ4l6lPJ9StD//w/7WJTqu mrhIBrLV6znO2QMPEytrYNk9qrYCl5BzPQF1IafAeIWoqhzzMrkK4Gs5P2zwvEFbiFeD 75XJv74AKVDl6jDe9sGBRFSxYyqTRLlVsvpKxdd7WiDHfXzKQfqIuZoUMdoA2icdeeSL ReWOyE0bfH2aMO00xuj3AgaH/h+pjoHUsKD26XQq6hhxCgUtXjtsSz9J950qEFBa0DPu xLrg== X-Gm-Message-State: AOAM532hVZLhWUvl1uyMPBbN/uZ0banxRutJ/DGz3WOkz51Dasfa9DK+ dpkg0qHL4AfHmL7MX4oh0i50bPW5S1tMupwQY46zsEC8QVlFG72ST3bxES/900Vz9Qa8E5hrWim oEJSzIuGO1DHPGhE= X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863861qvc.58.1635784120280; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnnToYfIdlwewHO/8stJwOwIrIwZDJizj1Vl7BOinzg8bNzbcfCyJ9R9K4APUV9a9jX59VOw== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863844qvc.58.1635784120140; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) Received: from localhost (pool-68-160-176-52.bstnma.fios.verizon.net. [68.160.176.52]) by smtp.gmail.com with ESMTPSA id u185sm10250817qkd.48.2021.11.01.09.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 09:28:39 -0700 (PDT) Date: Mon, 1 Nov 2021 12:28:38 -0400 From: Mike Snitzer To: Christoph Hellwig Cc: Dan Williams , Ira Weiny , dm-devel@redhat.com, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 03/11] dax: simplify the dax_device <-> gendisk association Message-ID: References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-4-hch@lst.de> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20211018044054.1779424-4-hch@lst.de> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=snitzer@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 18 2021 at 12:40P -0400, Christoph Hellwig wrote: > Replace the dax_host_hash with an xarray indexed by the pointer value > of the gendisk, and require explicitl calls from the block drivers that > want to associate their gendisk with a dax_device. > > Signed-off-by: Christoph Hellwig ... > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 79737aee516b1..a0a4703620650 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1683,6 +1683,7 @@ static void cleanup_mapped_device(struct mapped_device *md) > bioset_exit(&md->io_bs); > > if (md->dax_dev) { > + dax_remove_host(md->disk); > kill_dax(md->dax_dev); > put_dax(md->dax_dev); > md->dax_dev = NULL; > @@ -1784,10 +1785,11 @@ static struct mapped_device *alloc_dev(int minor) > sprintf(md->disk->disk_name, "dm-%d", minor); > > if (IS_ENABLED(CONFIG_FS_DAX)) { > - md->dax_dev = alloc_dax(md, md->disk->disk_name, > - &dm_dax_ops, 0); > + md->dax_dev = alloc_dax(md, &dm_dax_ops, 0); > if (IS_ERR(md->dax_dev)) > goto bad; > + if (dax_add_host(md->dax_dev, md->disk)) > + goto bad; > } > > format_dev_t(md->name, MKDEV(_major, minor)); Acked-by: Mike Snitzer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0DAAC433EF for ; Mon, 1 Nov 2021 16:28:50 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 6A31A610D2 for ; Mon, 1 Nov 2021 16:28:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6A31A610D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3359660604; Mon, 1 Nov 2021 16:28:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TYirllTg8P3D; Mon, 1 Nov 2021 16:28:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id D7E8F605F7; Mon, 1 Nov 2021 16:28:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF1C3C0019; Mon, 1 Nov 2021 16:28:48 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7AFCFC000E for ; Mon, 1 Nov 2021 16:28:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5595B401D3 for ; Mon, 1 Nov 2021 16:28:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W6VU7ObFpYAn for ; Mon, 1 Nov 2021 16:28:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4D5F740171 for ; Mon, 1 Nov 2021 16:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635784125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=H3BL2sO8tZdO7jApOtbVv+jBbGXwXcgS14tJ6qV4WC847WMLA2A9odKqXIEoV64Qb+lu42 fX6vyNjXEEgw+31uAOiB5L9bHJD/4bTru0BLjQtZP6vtDXs+5eU9DtaDuWp7tfaCQuY9Au o51Ww9Fs1nZnMG1Iji8fxElXnQRq89A= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-6vFAYT2KMGit_qICbfMZ7Q-1; Mon, 01 Nov 2021 12:28:41 -0400 X-MC-Unique: 6vFAYT2KMGit_qICbfMZ7Q-1 Received: by mail-qk1-f199.google.com with SMTP id w2-20020a3794020000b02903b54f40b442so10921439qkd.0 for ; Mon, 01 Nov 2021 09:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=2SaFpCrRFRS3yhj4o+r7Ch5xIWCgyMTj3NWSUkHzuN6MOv2kbnSXwzDWZUNsnw1MXZ MD5FP+HYqVgJS8aEuIn5iqS7RF8ayZQgJA1WVTk9au//c6yhrw03sWFXji8u0HTsOM65 vwDCdVLIfDv0X0ieZDxPHpr/Rskxo/Eah7estR1N24OvqTtPN5JxHVtdHy0oDDV5fsPy 5XCUfxsHFJ7G4Z71TYQZLXcH+aIhGc3BgfLJ5O/5WKCxHgHyO+t0JxCHPV4XbB0crPQt GFqVlneV3K/c7FYs89jBHj/391P5SX3IosMZXFKdYnSQiKgBEU2MlxLmlLIlcwRVp2O4 QeZQ== X-Gm-Message-State: AOAM530gRlGgLl4omy3lU4rN9PFppi33oEGpCBiKTxtdHMGbH8BOwu4D GbQsjf51jtCbFD8/r0e2a0AuZqZh01mNpXsJ3kW+Q0uzVbOBJ/p4LgRJRNeTrbKUpUR/bUD/Mjx 7Xc4JtneTxKAZyecyGD/sI1XzKiWn5yWmlCy1zm/7 X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863860qvc.58.1635784120280; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnnToYfIdlwewHO/8stJwOwIrIwZDJizj1Vl7BOinzg8bNzbcfCyJ9R9K4APUV9a9jX59VOw== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863844qvc.58.1635784120140; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) Received: from localhost (pool-68-160-176-52.bstnma.fios.verizon.net. [68.160.176.52]) by smtp.gmail.com with ESMTPSA id u185sm10250817qkd.48.2021.11.01.09.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 09:28:39 -0700 (PDT) Date: Mon, 1 Nov 2021 12:28:38 -0400 From: Mike Snitzer To: Christoph Hellwig Subject: Re: [PATCH 03/11] dax: simplify the dax_device <-> gendisk association Message-ID: References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-4-hch@lst.de> MIME-Version: 1.0 In-Reply-To: <20211018044054.1779424-4-hch@lst.de> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=snitzer@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Dan Williams , linux-ext4@vger.kernel.org, Ira Weiny X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Mon, Oct 18 2021 at 12:40P -0400, Christoph Hellwig wrote: > Replace the dax_host_hash with an xarray indexed by the pointer value > of the gendisk, and require explicitl calls from the block drivers that > want to associate their gendisk with a dax_device. > > Signed-off-by: Christoph Hellwig ... > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 79737aee516b1..a0a4703620650 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1683,6 +1683,7 @@ static void cleanup_mapped_device(struct mapped_device *md) > bioset_exit(&md->io_bs); > > if (md->dax_dev) { > + dax_remove_host(md->disk); > kill_dax(md->dax_dev); > put_dax(md->dax_dev); > md->dax_dev = NULL; > @@ -1784,10 +1785,11 @@ static struct mapped_device *alloc_dev(int minor) > sprintf(md->disk->disk_name, "dm-%d", minor); > > if (IS_ENABLED(CONFIG_FS_DAX)) { > - md->dax_dev = alloc_dax(md, md->disk->disk_name, > - &dm_dax_ops, 0); > + md->dax_dev = alloc_dax(md, &dm_dax_ops, 0); > if (IS_ERR(md->dax_dev)) > goto bad; > + if (dax_add_host(md->dax_dev, md->disk)) > + goto bad; > } > > format_dev_t(md->name, MKDEV(_major, minor)); Acked-by: Mike Snitzer _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C599EC433EF for ; Mon, 1 Nov 2021 16:28:54 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 50339610FD for ; Mon, 1 Nov 2021 16:28:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 50339610FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Hjdl86rYqz2yN6 for ; Tue, 2 Nov 2021 03:28:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AvCPbg1F; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AvCPbg1F; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=snitzer@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AvCPbg1F; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AvCPbg1F; dkim-atps=neutral X-Greylist: delayed 941 seconds by postgrey-1.36 at boromir; Tue, 02 Nov 2021 03:28:45 AEDT Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Hjdl201NYz2xRn for ; Tue, 2 Nov 2021 03:28:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635784122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=AvCPbg1FTPfLMjWc7ypl3iG98diUCbhNwGIK33qkzkphpEsehtLzuq/IYpiYpQgrCy2L7+ c3v1KDixloqG3Ng3ccyy3cjQGIe8vA5LCddSAnMrItTSCPBgIsoibsijzZcddq7PkRalMS 2V2TvGAHoAUFgWvumnraXAfhel7N1zI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635784122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=AvCPbg1FTPfLMjWc7ypl3iG98diUCbhNwGIK33qkzkphpEsehtLzuq/IYpiYpQgrCy2L7+ c3v1KDixloqG3Ng3ccyy3cjQGIe8vA5LCddSAnMrItTSCPBgIsoibsijzZcddq7PkRalMS 2V2TvGAHoAUFgWvumnraXAfhel7N1zI= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-xihgqj-6NCWTR3wpUN_1Rg-1; Mon, 01 Nov 2021 12:28:41 -0400 X-MC-Unique: xihgqj-6NCWTR3wpUN_1Rg-1 Received: by mail-qt1-f198.google.com with SMTP id p14-20020a05622a00ce00b002abb50567a6so10368961qtw.5 for ; Mon, 01 Nov 2021 09:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=OsIc4GQd8NYeAKrnqwMBf+QM6XIztYARTbPOrl6wN2w72V16TyJuN6JYw2Rd0IU6j8 z8qgxj7m39MYhbh2gr0Fwk0d48cdq+YQA34Nm4lhp/F/VsoQO/6b90syAT3M22Cxq6cI bMH/iGzpgVwkBI2xF9f39viGsrdKLPzXAjO0MQbbk4dxjSBGuSf8MAbY17SG8Z9ntGXS K/h9gGql1ye1jjGKYV2koIL1QK1TazCocpzdlFe8oCjJkKOazm2m3OkK3pwoxNgji+59 3qmvpaGqgN7/c1ceYssERuEb4EOWFktjm31wFT6Ix1eprZtbyCXmq38z1S7E9sNtxgsY RmXQ== X-Gm-Message-State: AOAM531CNclqbaUuj00Ah3OuqumHYhQ2nqDSAhjcIgljl1VtN35A/8D2 /g/GqDomLK38x/YNLu3rfg6s+U7kQjlbr3g9QAVpv7mijRBjH7FQQt6EtUGN1nJZYw5+Fh/XV62 lf5X6449O/536OLzBV5tjwWU= X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863865qvc.58.1635784120283; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnnToYfIdlwewHO/8stJwOwIrIwZDJizj1Vl7BOinzg8bNzbcfCyJ9R9K4APUV9a9jX59VOw== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863844qvc.58.1635784120140; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) Received: from localhost (pool-68-160-176-52.bstnma.fios.verizon.net. [68.160.176.52]) by smtp.gmail.com with ESMTPSA id u185sm10250817qkd.48.2021.11.01.09.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 09:28:39 -0700 (PDT) Date: Mon, 1 Nov 2021 12:28:38 -0400 From: Mike Snitzer To: Christoph Hellwig Subject: Re: [PATCH 03/11] dax: simplify the dax_device <-> gendisk association Message-ID: References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-4-hch@lst.de> MIME-Version: 1.0 In-Reply-To: <20211018044054.1779424-4-hch@lst.de> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=snitzer@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Dan Williams , linux-ext4@vger.kernel.org, Ira Weiny Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Mon, Oct 18 2021 at 12:40P -0400, Christoph Hellwig wrote: > Replace the dax_host_hash with an xarray indexed by the pointer value > of the gendisk, and require explicitl calls from the block drivers that > want to associate their gendisk with a dax_device. > > Signed-off-by: Christoph Hellwig ... > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 79737aee516b1..a0a4703620650 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1683,6 +1683,7 @@ static void cleanup_mapped_device(struct mapped_device *md) > bioset_exit(&md->io_bs); > > if (md->dax_dev) { > + dax_remove_host(md->disk); > kill_dax(md->dax_dev); > put_dax(md->dax_dev); > md->dax_dev = NULL; > @@ -1784,10 +1785,11 @@ static struct mapped_device *alloc_dev(int minor) > sprintf(md->disk->disk_name, "dm-%d", minor); > > if (IS_ENABLED(CONFIG_FS_DAX)) { > - md->dax_dev = alloc_dax(md, md->disk->disk_name, > - &dm_dax_ops, 0); > + md->dax_dev = alloc_dax(md, &dm_dax_ops, 0); > if (IS_ERR(md->dax_dev)) > goto bad; > + if (dax_add_host(md->dax_dev, md->disk)) > + goto bad; > } > > format_dev_t(md->name, MKDEV(_major, minor)); Acked-by: Mike Snitzer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44AA7C433F5 for ; Mon, 1 Nov 2021 16:28:54 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 DF25C61105 for ; Mon, 1 Nov 2021 16:28:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF25C61105 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635784133; 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=0VQkgcQC6y3rcdKjNg5BmkD6tCj3O1iLxQLgsIxRkCI=; b=Ra58x8qzyS8hpv629C1vTk0k8jOxplTmYO41tBYPMBc+L9XdMtR28XtNsxVmmTO9XciJYl agK1SIJI/Sy2CiXWj/QHKV0u79LQrF8xFARouY5veT3ZF5zmm2h5h0EsGAenez678gS8Ir IIx4jseLg5QAjDEdff04dztIMgtgZA4= 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-318-lfbBE6PGMHadix7J0AnepQ-1; Mon, 01 Nov 2021 12:28:49 -0400 X-MC-Unique: lfbBE6PGMHadix7J0AnepQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2665101F000; Mon, 1 Nov 2021 16:28:44 +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 CB63510016F5; Mon, 1 Nov 2021 16:28:44 +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 51C811806D03; Mon, 1 Nov 2021 16:28:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A1GSgji003934 for ; Mon, 1 Nov 2021 12:28:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EDCD40C1252; Mon, 1 Nov 2021 16:28:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B4AF400F3EC for ; Mon, 1 Nov 2021 16:28:42 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4177C8022F4 for ; Mon, 1 Nov 2021 16:28:42 +0000 (UTC) Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-533-kAoPFbYdMFeMBCDZqFuE1Q-1; Mon, 01 Nov 2021 12:28:41 -0400 X-MC-Unique: kAoPFbYdMFeMBCDZqFuE1Q-1 Received: by mail-qt1-f197.google.com with SMTP id 100-20020aed30ed000000b002a6b3dc6465so12414824qtf.13 for ; Mon, 01 Nov 2021 09:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vSSeiEsgy4ZRAwPPYMh123Zf4LHs8XHr2NNVii6Qq7o=; b=qxfKE7uylJJU+yKRH9nFNlg8+pJIsaPsezt8JfiOsPuMBg4vHBzYg7ihUpaWfd8iB2 F0pXBDCVBWNoHfUd9F2kpunwpuDTgxG/ZB+uu/25XMW+2JslZrtIgFjNFo68CRWBMqPr am7OG9YCFo/tGmxYnAfiNx0vBCyIZ9yoARXHseWunS1+sQ36ao/sNk30x2pVgTPjS4x8 H7i0S4ogucpvKpO1TjXAJnLJe1Hfmijs/SB3nm1jLFxwwUnLa/e5OaQe67eZvLy3xGtt qmyw8sRXSSiHIuriQPWQ0Ltv3F3Qu2X2OsnO3l+bDDg2UYttCTuRWoin+l1OB5MXAqHr DEAw== X-Gm-Message-State: AOAM5323X5X6s8NqQqidfyf2I1FuO78avYoS6zeT+oe4E1fWfz8FNyPv 2ZUN4JKCMAPb/a/TkoYRpcKVy2AIcVgIhuzBttb6us0W2gXUASdaACys+B6Qn/pJtY/SoEtzx94 +h2xZuNnJs3LXWw== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863868qvc.58.1635784120293; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnnToYfIdlwewHO/8stJwOwIrIwZDJizj1Vl7BOinzg8bNzbcfCyJ9R9K4APUV9a9jX59VOw== X-Received: by 2002:a05:6214:e4a:: with SMTP id o10mr29863844qvc.58.1635784120140; Mon, 01 Nov 2021 09:28:40 -0700 (PDT) Received: from localhost (pool-68-160-176-52.bstnma.fios.verizon.net. [68.160.176.52]) by smtp.gmail.com with ESMTPSA id u185sm10250817qkd.48.2021.11.01.09.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 09:28:39 -0700 (PDT) Date: Mon, 1 Nov 2021 12:28:38 -0400 From: Mike Snitzer To: Christoph Hellwig Message-ID: References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-4-hch@lst.de> MIME-Version: 1.0 In-Reply-To: <20211018044054.1779424-4-hch@lst.de> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: dm-devel@redhat.com Cc: nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Dan Williams , linux-ext4@vger.kernel.org, Ira Weiny Subject: Re: [dm-devel] [PATCH 03/11] dax: simplify the dax_device <-> gendisk association 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Oct 18 2021 at 12:40P -0400, Christoph Hellwig wrote: > Replace the dax_host_hash with an xarray indexed by the pointer value > of the gendisk, and require explicitl calls from the block drivers that > want to associate their gendisk with a dax_device. > > Signed-off-by: Christoph Hellwig ... > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 79737aee516b1..a0a4703620650 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1683,6 +1683,7 @@ static void cleanup_mapped_device(struct mapped_device *md) > bioset_exit(&md->io_bs); > > if (md->dax_dev) { > + dax_remove_host(md->disk); > kill_dax(md->dax_dev); > put_dax(md->dax_dev); > md->dax_dev = NULL; > @@ -1784,10 +1785,11 @@ static struct mapped_device *alloc_dev(int minor) > sprintf(md->disk->disk_name, "dm-%d", minor); > > if (IS_ENABLED(CONFIG_FS_DAX)) { > - md->dax_dev = alloc_dax(md, md->disk->disk_name, > - &dm_dax_ops, 0); > + md->dax_dev = alloc_dax(md, &dm_dax_ops, 0); > if (IS_ERR(md->dax_dev)) > goto bad; > + if (dax_add_host(md->dax_dev, md->disk)) > + goto bad; > } > > format_dev_t(md->name, MKDEV(_major, minor)); Acked-by: Mike Snitzer -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel