From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D39A2C83 for ; Thu, 28 Oct 2021 01:44:17 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id x1-20020a17090a530100b001a1efa4ebe6so4390266pjh.0 for ; Wed, 27 Oct 2021 18:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=NwrWjK1zEgkC/h0OltkWmV8v6U9kycWNkAzFyZ2UqlXn15yubZLd83LVcZWNlLL1f0 Fv5BW1FJAtxuVzU9kXByXaxfMtmiH5UDaukXhF9R+cJyfOGMfQT6zf04USpHM9TDLMLF 8zm7+00diA9rU2lDu/DTfvUOEu2zCMioGVYImhjXSkJTydRCIKV9cRbUQapJjcrGiqMK QnZf8nIfPhTNHOoqGDCmmZuYu6PaW3nbxj784zhi1I6uIMMPp2z6oTqTZJk+LfG12Qzb jA/Y5wJffgH2J2qLufj0bLW03BgfGI/buoZEjp4mtmSwLrMRhWqThDSfNCSg+TsSc0DH V6Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=sDgdhRRtqV6DafYQPYF5jqd+EI9/wAYxuNLvB9MRM2E+wyVIGX2c1zTWXwcIWml49/ uGx4OvnlR3OEXBmSvcd00IxJkqgh5FZvi9o8bPp3olXOkpofuqlEsN/ecyuNa+CQ/hOT XtiK5QY9GzKs+rPOFM3F0y39uChGSF45toG2nsGuMphKjY7+jpnMUzQELS453W1eWvMp p2qrq/MvUdjQOpOvr30FgoHWhiuYJ2HkHDkuOcCjoRoN1mYGY4qXJqw5VLrGaN1is6U2 JeLB2Wpv0eF5hdmviwPt1y5GVzShdZ0F6JtOyqnZD4aKHX3O9kAYkBStk8c3dMO39vYa 9uOA== X-Gm-Message-State: AOAM531CqXxVPZOCvMTSj+ynRZpU2+2rOvpKSvi3kYhBq+fTKE32ku0K YEuxuk6nlfl3EaTa00ANe1spu8RFlJFqhaGZDwaTWg== X-Google-Smtp-Source: ABdhPJyk8c8xZHfkX0RONmluScnz61A4HGhWerdM4JYgASaD4FzedQ2nCFUwr5W/5xCzT57VlrSOf0tWDKABqHHbWT8= X-Received: by 2002:a17:902:8a97:b0:13e:6e77:af59 with SMTP id p23-20020a1709028a9700b0013e6e77af59mr1240292plo.4.1635385456643; Wed, 27 Oct 2021 18:44:16 -0700 (PDT) Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-12-hch@lst.de> In-Reply-To: <20211018044054.1779424-12-hch@lst.de> From: Dan Williams Date: Wed, 27 Oct 2021 18:44:04 -0700 Message-ID: Subject: Re: [PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c To: Christoph Hellwig Cc: Mike Snitzer , Ira Weiny , device-mapper development , linux-xfs , Linux NVDIMM , linux-s390 , linux-fsdevel , linux-erofs@lists.ozlabs.org, linux-ext4 , virtualization@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" On Sun, Oct 17, 2021 at 9:41 PM Christoph Hellwig wrote: > > No functional changet, but this will allow for a tighter integration s/changet/changes/ > with the iomap code, including possible passing the partition offset s/possible/possibly/ > in the iomap in the future. For now it mostly avoids growing more s/now/now,/ ...all of the above fixed up locally. Other than that, it looks good to me. > callers outside of fs/dax.c. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/super.c | 14 -------------- > fs/dax.c | 13 +++++++++++++ > include/linux/dax.h | 1 - > 3 files changed, 13 insertions(+), 15 deletions(-) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index 803942586d1b6..c0910687fbcb2 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -67,20 +67,6 @@ void dax_remove_host(struct gendisk *disk) > } > EXPORT_SYMBOL_GPL(dax_remove_host); > > -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > - pgoff_t *pgoff) > -{ > - sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > - phys_addr_t phys_off = (start_sect + sector) * 512; > - > - if (pgoff) > - *pgoff = PHYS_PFN(phys_off); > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > - return -EINVAL; > - return 0; > -} > -EXPORT_SYMBOL(bdev_dax_pgoff); > - > /** > * dax_get_by_host() - temporary lookup mechanism for filesystem-dax > * @bdev: block device to find a dax_device for > diff --git a/fs/dax.c b/fs/dax.c > index 4e3e5a283a916..eb715363fd667 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -709,6 +709,19 @@ int dax_invalidate_mapping_entry_sync(struct address_space *mapping, > return __dax_invalidate_entry(mapping, index, false); > } > > +static int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > + pgoff_t *pgoff) > +{ > + sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > + phys_addr_t phys_off = (start_sect + sector) * 512; > + > + if (pgoff) > + *pgoff = PHYS_PFN(phys_off); > + if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > + return -EINVAL; > + return 0; > +} > + > static int copy_cow_page_dax(struct block_device *bdev, struct dax_device *dax_dev, > sector_t sector, struct page *to, unsigned long vaddr) > { > diff --git a/include/linux/dax.h b/include/linux/dax.h > index 439c3c70e347b..324363b798ecd 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -107,7 +107,6 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > #endif > > struct writeback_control; > -int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); > #if IS_ENABLED(CONFIG_FS_DAX) > int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk); > void dax_remove_host(struct gendisk *disk); > -- > 2.30.2 > 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 B4142C433EF for ; Thu, 28 Oct 2021 01:44:21 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 5B2F361107 for ; Thu, 28 Oct 2021 01:44:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B2F361107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1A2C5405AB; Thu, 28 Oct 2021 01:44:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YxCdGb2xz6AC; Thu, 28 Oct 2021 01:44:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id BAD3D405A1; Thu, 28 Oct 2021 01:44:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9BAB2C0012; Thu, 28 Oct 2021 01:44:19 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C8913C000E for ; Thu, 28 Oct 2021 01:44:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A498781BC0 for ; Thu, 28 Oct 2021 01:44:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=intel-com.20210112.gappssmtp.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b5hq8mwwvy4V for ; Thu, 28 Oct 2021 01:44:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8512D81BBD for ; Thu, 28 Oct 2021 01:44:17 +0000 (UTC) Received: by mail-pj1-x102f.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so6667143pjl.2 for ; Wed, 27 Oct 2021 18:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=NwrWjK1zEgkC/h0OltkWmV8v6U9kycWNkAzFyZ2UqlXn15yubZLd83LVcZWNlLL1f0 Fv5BW1FJAtxuVzU9kXByXaxfMtmiH5UDaukXhF9R+cJyfOGMfQT6zf04USpHM9TDLMLF 8zm7+00diA9rU2lDu/DTfvUOEu2zCMioGVYImhjXSkJTydRCIKV9cRbUQapJjcrGiqMK QnZf8nIfPhTNHOoqGDCmmZuYu6PaW3nbxj784zhi1I6uIMMPp2z6oTqTZJk+LfG12Qzb jA/Y5wJffgH2J2qLufj0bLW03BgfGI/buoZEjp4mtmSwLrMRhWqThDSfNCSg+TsSc0DH V6Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=nuULfE+Mi1ExwO/KM4mRHxj1Vmlj9+EIINaDjvAFmTutHcUVFfPI23Wtr+NkETGJV4 40+Bll6fFrrp6U3V3INncq6OaXumfq6dxVlv7xtX0uHm2NiqNfgaSLFzT7Xx9+MeYU0O pTAHTiiDcsBdUFoIICoafZbJuqVv4nJLDzvGtQedsuiOKibRB/yD1iMWd95zJU31iLvd +nA/QbuMftRN6wiEdL8p7xM8amPgv95K/un187Q1FEOYUsEY72PQD2Qgow82zz3StK0l bcYo82QupOQuuXW6Zf/MGsYTIqHUg4JkVmk2hQg6TSw3Tu4HvZ8UKpp4b01XGlP9E5I/ 1wXA== X-Gm-Message-State: AOAM532pQnbd79ti3JvT6FDz65a5JuooL0rs989Q77xMVEfFGJIKjQ3w UNZSt1MQkZW5Hs0R7M8C52g8+nTwU5bnthn5Mi8VdA== X-Google-Smtp-Source: ABdhPJyk8c8xZHfkX0RONmluScnz61A4HGhWerdM4JYgASaD4FzedQ2nCFUwr5W/5xCzT57VlrSOf0tWDKABqHHbWT8= X-Received: by 2002:a17:902:8a97:b0:13e:6e77:af59 with SMTP id p23-20020a1709028a9700b0013e6e77af59mr1240292plo.4.1635385456643; Wed, 27 Oct 2021 18:44:16 -0700 (PDT) MIME-Version: 1.0 References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-12-hch@lst.de> In-Reply-To: <20211018044054.1779424-12-hch@lst.de> From: Dan Williams Date: Wed, 27 Oct 2021 18:44:04 -0700 Message-ID: Subject: Re: [PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c To: Christoph Hellwig Cc: Linux NVDIMM , Mike Snitzer , linux-s390 , linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs , device-mapper development , linux-fsdevel , linux-ext4 , 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 Sun, Oct 17, 2021 at 9:41 PM Christoph Hellwig wrote: > > No functional changet, but this will allow for a tighter integration s/changet/changes/ > with the iomap code, including possible passing the partition offset s/possible/possibly/ > in the iomap in the future. For now it mostly avoids growing more s/now/now,/ ...all of the above fixed up locally. Other than that, it looks good to me. > callers outside of fs/dax.c. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/super.c | 14 -------------- > fs/dax.c | 13 +++++++++++++ > include/linux/dax.h | 1 - > 3 files changed, 13 insertions(+), 15 deletions(-) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index 803942586d1b6..c0910687fbcb2 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -67,20 +67,6 @@ void dax_remove_host(struct gendisk *disk) > } > EXPORT_SYMBOL_GPL(dax_remove_host); > > -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > - pgoff_t *pgoff) > -{ > - sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > - phys_addr_t phys_off = (start_sect + sector) * 512; > - > - if (pgoff) > - *pgoff = PHYS_PFN(phys_off); > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > - return -EINVAL; > - return 0; > -} > -EXPORT_SYMBOL(bdev_dax_pgoff); > - > /** > * dax_get_by_host() - temporary lookup mechanism for filesystem-dax > * @bdev: block device to find a dax_device for > diff --git a/fs/dax.c b/fs/dax.c > index 4e3e5a283a916..eb715363fd667 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -709,6 +709,19 @@ int dax_invalidate_mapping_entry_sync(struct address_space *mapping, > return __dax_invalidate_entry(mapping, index, false); > } > > +static int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > + pgoff_t *pgoff) > +{ > + sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > + phys_addr_t phys_off = (start_sect + sector) * 512; > + > + if (pgoff) > + *pgoff = PHYS_PFN(phys_off); > + if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > + return -EINVAL; > + return 0; > +} > + > static int copy_cow_page_dax(struct block_device *bdev, struct dax_device *dax_dev, > sector_t sector, struct page *to, unsigned long vaddr) > { > diff --git a/include/linux/dax.h b/include/linux/dax.h > index 439c3c70e347b..324363b798ecd 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -107,7 +107,6 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > #endif > > struct writeback_control; > -int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); > #if IS_ENABLED(CONFIG_FS_DAX) > int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk); > void dax_remove_host(struct gendisk *disk); > -- > 2.30.2 > _______________________________________________ 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 BAF9BC433F5 for ; Thu, 28 Oct 2021 01:44:30 +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 5B7EF6112E for ; Thu, 28 Oct 2021 01:44:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B7EF6112E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.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 4HfpJX75dCz2yLg for ; Thu, 28 Oct 2021 12:44:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel-com.20210112.gappssmtp.com header.i=@intel-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=NwrWjK1z; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=intel.com (client-ip=2607:f8b0:4864:20::1035; helo=mail-pj1-x1035.google.com; envelope-from=dan.j.williams@intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel-com.20210112.gappssmtp.com header.i=@intel-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=NwrWjK1z; dkim-atps=neutral Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HfpJT5L3xz2xB0 for ; Thu, 28 Oct 2021 12:44:18 +1100 (AEDT) Received: by mail-pj1-x1035.google.com with SMTP id q2-20020a17090a2e0200b001a0fd4efd49so4367491pjd.1 for ; Wed, 27 Oct 2021 18:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=NwrWjK1zEgkC/h0OltkWmV8v6U9kycWNkAzFyZ2UqlXn15yubZLd83LVcZWNlLL1f0 Fv5BW1FJAtxuVzU9kXByXaxfMtmiH5UDaukXhF9R+cJyfOGMfQT6zf04USpHM9TDLMLF 8zm7+00diA9rU2lDu/DTfvUOEu2zCMioGVYImhjXSkJTydRCIKV9cRbUQapJjcrGiqMK QnZf8nIfPhTNHOoqGDCmmZuYu6PaW3nbxj784zhi1I6uIMMPp2z6oTqTZJk+LfG12Qzb jA/Y5wJffgH2J2qLufj0bLW03BgfGI/buoZEjp4mtmSwLrMRhWqThDSfNCSg+TsSc0DH V6Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=0nr6aJNjP9zaFmzuBUsIWjj233VebrY3HZWv55OQj6rv4nNnoDU0KJxvaUT9UtATJ+ BR+nUGjSguxg87gvPhpqMlnYEsdeVTVJNqxv7/bQiLUL60F/gE3PnpWnSSIefksg9+T/ 5U0NvmbxvK9fgJ2wF6LJaToMVXp+R21+MtrFU0dhAi8nRXuBtB5n046dpXgNOjk++5vP gMpsmkhHTxhe2cW7b9eeIjUdZw9Ivqzr12wAnxnmw7/zStA6u68donDhrdoUJ0tQMDHv yvZFf0mbdFOVwKZenhNyBlNM+rxGz1sIrhPbm2T9Na5btJ4TntzzqCgmpP5xCsS0H82t fuGw== X-Gm-Message-State: AOAM531sojONAtD2MeoXM9UhTp2++A1zglrdnncly+fd/XUEE7Ovrenu dZtAMMA8AbHk1ox40vlUzQqVzk++XBTlyonGsGpt0Q== X-Google-Smtp-Source: ABdhPJyk8c8xZHfkX0RONmluScnz61A4HGhWerdM4JYgASaD4FzedQ2nCFUwr5W/5xCzT57VlrSOf0tWDKABqHHbWT8= X-Received: by 2002:a17:902:8a97:b0:13e:6e77:af59 with SMTP id p23-20020a1709028a9700b0013e6e77af59mr1240292plo.4.1635385456643; Wed, 27 Oct 2021 18:44:16 -0700 (PDT) MIME-Version: 1.0 References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-12-hch@lst.de> In-Reply-To: <20211018044054.1779424-12-hch@lst.de> From: Dan Williams Date: Wed, 27 Oct 2021 18:44:04 -0700 Message-ID: Subject: Re: [PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c To: Christoph Hellwig Content-Type: text/plain; charset="UTF-8" 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: Linux NVDIMM , Mike Snitzer , linux-s390 , linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs , device-mapper development , linux-fsdevel , linux-ext4 , Ira Weiny Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Sun, Oct 17, 2021 at 9:41 PM Christoph Hellwig wrote: > > No functional changet, but this will allow for a tighter integration s/changet/changes/ > with the iomap code, including possible passing the partition offset s/possible/possibly/ > in the iomap in the future. For now it mostly avoids growing more s/now/now,/ ...all of the above fixed up locally. Other than that, it looks good to me. > callers outside of fs/dax.c. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/super.c | 14 -------------- > fs/dax.c | 13 +++++++++++++ > include/linux/dax.h | 1 - > 3 files changed, 13 insertions(+), 15 deletions(-) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index 803942586d1b6..c0910687fbcb2 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -67,20 +67,6 @@ void dax_remove_host(struct gendisk *disk) > } > EXPORT_SYMBOL_GPL(dax_remove_host); > > -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > - pgoff_t *pgoff) > -{ > - sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > - phys_addr_t phys_off = (start_sect + sector) * 512; > - > - if (pgoff) > - *pgoff = PHYS_PFN(phys_off); > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > - return -EINVAL; > - return 0; > -} > -EXPORT_SYMBOL(bdev_dax_pgoff); > - > /** > * dax_get_by_host() - temporary lookup mechanism for filesystem-dax > * @bdev: block device to find a dax_device for > diff --git a/fs/dax.c b/fs/dax.c > index 4e3e5a283a916..eb715363fd667 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -709,6 +709,19 @@ int dax_invalidate_mapping_entry_sync(struct address_space *mapping, > return __dax_invalidate_entry(mapping, index, false); > } > > +static int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > + pgoff_t *pgoff) > +{ > + sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > + phys_addr_t phys_off = (start_sect + sector) * 512; > + > + if (pgoff) > + *pgoff = PHYS_PFN(phys_off); > + if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > + return -EINVAL; > + return 0; > +} > + > static int copy_cow_page_dax(struct block_device *bdev, struct dax_device *dax_dev, > sector_t sector, struct page *to, unsigned long vaddr) > { > diff --git a/include/linux/dax.h b/include/linux/dax.h > index 439c3c70e347b..324363b798ecd 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -107,7 +107,6 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > #endif > > struct writeback_control; > -int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); > #if IS_ENABLED(CONFIG_FS_DAX) > int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk); > void dax_remove_host(struct gendisk *disk); > -- > 2.30.2 > 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 41723C433F5 for ; Thu, 28 Oct 2021 01:47:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D2A2360E75 for ; Thu, 28 Oct 2021 01:47:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2A2360E75 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=redhat.com 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-207-8tudeGwlN7uZ0wsPnZqqKA-1; Wed, 27 Oct 2021 21:47:12 -0400 X-MC-Unique: 8tudeGwlN7uZ0wsPnZqqKA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFBF81006AA4; Thu, 28 Oct 2021 01:47:07 +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 873151ACBB; Thu, 28 Oct 2021 01:47:07 +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 C384E1800FDD; Thu, 28 Oct 2021 01:47:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19S1iJu1029085 for ; Wed, 27 Oct 2021 21:44:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F20240CFD11; Thu, 28 Oct 2021 01:44:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 799DF40CFD0C for ; Thu, 28 Oct 2021 01:44:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 6043180015A for ; Thu, 28 Oct 2021 01:44:19 +0000 (UTC) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-AKuS159xOgalQd58KM0tPg-1; Wed, 27 Oct 2021 21:44:17 -0400 X-MC-Unique: AKuS159xOgalQd58KM0tPg-1 Received: by mail-pj1-f42.google.com with SMTP id x1-20020a17090a530100b001a1efa4ebe6so4390267pjh.0 for ; Wed, 27 Oct 2021 18:44:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X1wiwLbjvMr0fUU/Ik7bpLL2xq562nKRBks78M/tbQ0=; b=wa6YQpdKD+KqGe/VUthnFmDF/LTvOLM3gLark1DkFW78aAHM6DrXQTE8s4B7VCUsLA c/6SyqQqiSX9ZSQeZMWeSt0/vOP7mywRlkwNmaTgekJmzyyvRhJ9uakXgv/rsFEKpp4D dwalqmRCadm/wClvPjaGEV9Ij7J1SzRHFnnDGwiWke3gheHpWWlN0wDwnsgmGnhoEVNq aLPkUqvM7rCXUYR5tFT4bkLPKww8OQdbMtZis7o83/C97sqLx6krxlgZFWDCw15jiRhQ eidBliwsD4NinNk7nCeOwNiJ7lXeLkLPjlUGzqF/4mUuYERazJi/lbYyKSwYTp59AuDj sBgg== X-Gm-Message-State: AOAM533Reerz15Oc/2+TFNbuT7EBOi0RtWbmoUn3IgJn4ZelEXQ9Eo1n 9EMNePZYAvlQsTUl90RrENgBRRwb91qx38QGhAw8Sw== X-Google-Smtp-Source: ABdhPJyk8c8xZHfkX0RONmluScnz61A4HGhWerdM4JYgASaD4FzedQ2nCFUwr5W/5xCzT57VlrSOf0tWDKABqHHbWT8= X-Received: by 2002:a17:902:8a97:b0:13e:6e77:af59 with SMTP id p23-20020a1709028a9700b0013e6e77af59mr1240292plo.4.1635385456643; Wed, 27 Oct 2021 18:44:16 -0700 (PDT) MIME-Version: 1.0 References: <20211018044054.1779424-1-hch@lst.de> <20211018044054.1779424-12-hch@lst.de> In-Reply-To: <20211018044054.1779424-12-hch@lst.de> From: Dan Williams Date: Wed, 27 Oct 2021 18:44:04 -0700 Message-ID: To: Christoph Hellwig X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-loop: dm-devel@redhat.com Cc: Linux NVDIMM , Mike Snitzer , linux-s390 , linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs , device-mapper development , linux-fsdevel , linux-ext4 , Ira Weiny Subject: Re: [dm-devel] [PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c 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.79 on 10.5.11.15 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sun, Oct 17, 2021 at 9:41 PM Christoph Hellwig wrote: > > No functional changet, but this will allow for a tighter integration s/changet/changes/ > with the iomap code, including possible passing the partition offset s/possible/possibly/ > in the iomap in the future. For now it mostly avoids growing more s/now/now,/ ...all of the above fixed up locally. Other than that, it looks good to me. > callers outside of fs/dax.c. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/super.c | 14 -------------- > fs/dax.c | 13 +++++++++++++ > include/linux/dax.h | 1 - > 3 files changed, 13 insertions(+), 15 deletions(-) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index 803942586d1b6..c0910687fbcb2 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -67,20 +67,6 @@ void dax_remove_host(struct gendisk *disk) > } > EXPORT_SYMBOL_GPL(dax_remove_host); > > -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > - pgoff_t *pgoff) > -{ > - sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > - phys_addr_t phys_off = (start_sect + sector) * 512; > - > - if (pgoff) > - *pgoff = PHYS_PFN(phys_off); > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > - return -EINVAL; > - return 0; > -} > -EXPORT_SYMBOL(bdev_dax_pgoff); > - > /** > * dax_get_by_host() - temporary lookup mechanism for filesystem-dax > * @bdev: block device to find a dax_device for > diff --git a/fs/dax.c b/fs/dax.c > index 4e3e5a283a916..eb715363fd667 100644 > --- a/fs/dax.c > +++ b/fs/dax.c > @@ -709,6 +709,19 @@ int dax_invalidate_mapping_entry_sync(struct address_space *mapping, > return __dax_invalidate_entry(mapping, index, false); > } > > +static int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, > + pgoff_t *pgoff) > +{ > + sector_t start_sect = bdev ? get_start_sect(bdev) : 0; > + phys_addr_t phys_off = (start_sect + sector) * 512; > + > + if (pgoff) > + *pgoff = PHYS_PFN(phys_off); > + if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > + return -EINVAL; > + return 0; > +} > + > static int copy_cow_page_dax(struct block_device *bdev, struct dax_device *dax_dev, > sector_t sector, struct page *to, unsigned long vaddr) > { > diff --git a/include/linux/dax.h b/include/linux/dax.h > index 439c3c70e347b..324363b798ecd 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@ -107,7 +107,6 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, > #endif > > struct writeback_control; > -int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); > #if IS_ENABLED(CONFIG_FS_DAX) > int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk); > void dax_remove_host(struct gendisk *disk); > -- > 2.30.2 > -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel