From: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
To: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Theodore Ts'o <tytso-3s7WtUTddSA@public.gmane.org>,
linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Andreas Dilger
<adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>,
Jan Kara <jack-IBi9RG/b67k@public.gmane.org>,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jack-AlSwsSmVLrQ@public.gmane.org,
linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hch-jcswGhMUV9g@public.gmane.org
Subject: Re: [PATCH v2 2/2] ext2, ext4: use the super_block dax_device
Date: Mon, 28 Aug 2017 10:27:24 +0200 [thread overview]
Message-ID: <20170828082724.GA12609@quack2.suse.cz> (raw)
In-Reply-To: <150389212595.25151.10721705529768874001.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On Sun 27-08-17 20:48:46, Dan Williams wrote:
> The ->iomap_begin() operation is a hot path, and now that mount_bdev()
> arranges for the dax_device to be populated in the super_block, we can
> just reference that attribute directly rather than perform a new lookup.
>
> Cc: Jan Kara <jack-IBi9RG/b67k@public.gmane.org>
> Cc: "Theodore Ts'o" <tytso-3s7WtUTddSA@public.gmane.org>
> Cc: Andreas Dilger <adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
> Reported-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> Signed-off-by: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Looks good. You can add:
Reviewed-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
Honza
> ---
> fs/ext2/inode.c | 10 ++--------
> fs/ext4/inode.c | 10 ++--------
> 2 files changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index 30163d007b2f..7102b77a83c6 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -800,7 +800,6 @@ int ext2_get_block(struct inode *inode, sector_t iblock,
> static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> unsigned flags, struct iomap *iomap)
> {
> - struct block_device *bdev;
> unsigned int blkbits = inode->i_blkbits;
> unsigned long first_block = offset >> blkbits;
> unsigned long max_blocks = (length + (1 << blkbits) - 1) >> blkbits;
> @@ -814,13 +813,9 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> return ret;
>
> iomap->flags = 0;
> - bdev = inode->i_sb->s_bdev;
> - iomap->bdev = bdev;
> + iomap->bdev = inode->i_sb->s_bdev;
> iomap->offset = (u64)first_block << blkbits;
> - if (blk_queue_dax(bdev->bd_queue))
> - iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
> - else
> - iomap->dax_dev = NULL;
> + iomap->dax_dev = inode->i_sb->s_daxdev;
>
> if (ret == 0) {
> iomap->type = IOMAP_HOLE;
> @@ -842,7 +837,6 @@ static int
> ext2_iomap_end(struct inode *inode, loff_t offset, loff_t length,
> ssize_t written, unsigned flags, struct iomap *iomap)
> {
> - fs_put_dax(iomap->dax_dev);
> if (iomap->type == IOMAP_MAPPED &&
> written < length &&
> (flags & IOMAP_WRITE))
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index c774bdc22759..311690522366 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -3404,7 +3404,6 @@ static int ext4_releasepage(struct page *page, gfp_t wait)
> static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> unsigned flags, struct iomap *iomap)
> {
> - struct block_device *bdev;
> unsigned int blkbits = inode->i_blkbits;
> unsigned long first_block = offset >> blkbits;
> unsigned long last_block = (offset + length - 1) >> blkbits;
> @@ -3473,12 +3472,8 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> }
>
> iomap->flags = 0;
> - bdev = inode->i_sb->s_bdev;
> - iomap->bdev = bdev;
> - if (blk_queue_dax(bdev->bd_queue))
> - iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
> - else
> - iomap->dax_dev = NULL;
> + iomap->bdev = inode->i_sb->s_bdev;
> + iomap->dax_dev = inode->i_sb->s_daxdev;
> iomap->offset = first_block << blkbits;
>
> if (ret == 0) {
> @@ -3511,7 +3506,6 @@ static int ext4_iomap_end(struct inode *inode, loff_t offset, loff_t length,
> int blkbits = inode->i_blkbits;
> bool truncate = false;
>
> - fs_put_dax(iomap->dax_dev);
> if (!(flags & IOMAP_WRITE) || (flags & IOMAP_FAULT))
> return 0;
>
>
--
Jan Kara <jack-IBi9RG/b67k@public.gmane.org>
SUSE Labs, CR
prev parent reply other threads:[~2017-08-28 8:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 3:48 [PATCH v2 0/2] fs, dax: lookup dax_device at mount time Dan Williams
[not found] ` <150389211501.25151.6477753201827914462.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-28 3:48 ` [PATCH v2 1/2] fs, xfs: perform dax_device lookup at mount Dan Williams
2017-08-28 16:28 ` Darrick J. Wong
[not found] ` <150389212075.25151.17146973298430877023.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-28 8:31 ` Jan Kara
2017-08-29 21:26 ` Christoph Hellwig
[not found] ` <20170829212606.GC8608-jcswGhMUV9g@public.gmane.org>
2017-08-29 21:31 ` Dan Williams
[not found] ` <CAPcyv4hA_vkSdZowaJ78FPCOhY2Z_iORX0B63=_RCCGdqack_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-29 21:35 ` Dan Williams
[not found] ` <CAPcyv4i2rS0sAxiJSVxFSHirsycaYofuxp3yPxeyB8xzsryx3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-29 21:36 ` Christoph Hellwig
2017-08-28 3:48 ` [PATCH v2 2/2] ext2, ext4: use the super_block dax_device Dan Williams
[not found] ` <150389212595.25151.10721705529768874001.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-28 8:27 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170828082724.GA12609@quack2.suse.cz \
--to=jack-alswssmvlrq@public.gmane.org \
--cc=adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=hch-jcswGhMUV9g@public.gmane.org \
--cc=jack-IBi9RG/b67k@public.gmane.org \
--cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
--cc=linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tytso-3s7WtUTddSA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).