Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399260

Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
Date 2016-05-11 17:30 +0200
Message-ID <rxEfg-2vs-25@gated-at.bofh.it> (permalink)
References <rxiRt-6cC-25@gated-at.bofh.it> <rxiRv-6cC-65@gated-at.bofh.it> <rxxnr-467-1@gated-at.bofh.it> <rxDsT-1yk-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 11-05-16 08:25:10, Toshi Kani wrote:
> On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> > On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > > 
> > > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > > to remain as a separate interface for checking dax capability of
> > > a raw block device.
> > > 
> > > Rename and relocate blkdev_dax_capable() to keep them maintained
> > > consistently, and call bdev_direct_access() for the dax capability
> > > check.
> > ...
> > > 
> > > +bool bdev_dax_capable(struct block_device *bdev)
> > > +{
> > > +	struct gendisk *disk = bdev->bd_disk;
> > > +	struct blk_dax_ctl dax = {
> > > +		.size = PAGE_SIZE,
> > > +	};
> > > +
> > > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > > +		return false;
> >
> > Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> > when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> > we don't grow the kernel for people who don't care about DAX.
> 
> When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
> I think the code size is the same.
> 
> (gdb) disas bdev_dax_capable
> Dump of assembler code for function bdev_dax_capable:
>    0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
>    0xffffffff81260d25 <+5>:     push   %rbp
>    0xffffffff81260d26 <+6>:     xor    %eax,%eax
>    0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
>    0xffffffff81260d2b <+11>:    pop    %rbp
>    0xffffffff81260d2c <+12>:    retq   
> End of assembler dump.

Ah, good. So feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency Toshi Kani <toshi.kani@hpe.com> - 2016-05-10 18:40 +0200
  Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency Dan Williams <dan.j.williams@intel.com> - 2016-05-10 21:50 +0200
    Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for  consistency Toshi Kani <toshi.kani@hpe.com> - 2016-05-10 23:50 +0200
  Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency Jan Kara <jack@suse.cz> - 2016-05-11 10:10 +0200
    Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for  consistency Toshi Kani <toshi.kani@hpe.com> - 2016-05-11 16:40 +0200
      Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency Jan Kara <jack@suse.cz> - 2016-05-11 17:30 +0200

csiph-web