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