dax: Pass dax_dev instead of bdev to dax_writeback_mapping_range()
authorVivek Goyal <vgoyal@redhat.com>
Fri, 3 Jan 2020 18:33:07 +0000 (13:33 -0500)
committerDan Williams <dan.j.williams@intel.com>
Fri, 3 Jan 2020 19:13:12 +0000 (11:13 -0800)
commit3f666c56c6b8cc40a5e9002aac484b8f5b83c402
tree9dc9d9b47b3ede5451938a3125ad1b89e6be47c9
parentd1eef1c619749b2a57e514a3fa67d9a516ffa919
dax: Pass dax_dev instead of bdev to dax_writeback_mapping_range()

As of now dax_writeback_mapping_range() takes "struct block_device" as a
parameter and dax_dev is searched from bdev name. This also involves taking
a fresh reference on dax_dev and putting that reference at the end of
function.

We are developing a new filesystem virtio-fs and using dax to access host
page cache directly. But there is no block device. IOW, we want to make
use of dax but want to get rid of this assumption that there is always
a block device associated with dax_dev.

So pass in "struct dax_device" as parameter instead of bdev.

ext2/ext4/xfs are current users and they already have a reference on
dax_device. So there is no need to take reference and drop reference to
dax_device on each call of this function.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Link: https://lore.kernel.org/r/20200103183307.GB13350@redhat.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
fs/dax.c
fs/ext2/inode.c
fs/ext4/inode.c
fs/xfs/xfs_aops.c
include/linux/dax.h