[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170828082724.GA12609@quack2.suse.cz>
Date: Mon, 28 Aug 2017 10:27:24 +0200
From: Jan Kara <jack@...e.cz>
To: Dan Williams <dan.j.williams@...el.com>
Cc: linux-fsdevel@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
linux-nvdimm@...ts.01.org, linux-xfs@...r.kernel.org,
Andreas Dilger <adilger.kernel@...ger.ca>,
Jan Kara <jack@...e.com>, jack@...e.cz,
linux-ext4@...r.kernel.org, hch@....de
Subject: Re: [PATCH v2 2/2] ext2, ext4: use the super_block dax_device
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@...e.com>
> Cc: "Theodore Ts'o" <tytso@....edu>
> Cc: Andreas Dilger <adilger.kernel@...ger.ca>
> Reported-by: Christoph Hellwig <hch@....de>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@...e.cz>
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@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists