aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/dax.h
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2020-01-03 13:33:07 -0500
committerDan Williams <dan.j.williams@intel.com>2020-01-03 11:13:12 -0800
commit3f666c56c6b8cc40a5e9002aac484b8f5b83c402 (patch)
tree9dc9d9b47b3ede5451938a3125ad1b89e6be47c9 /include/linux/dax.h
parentLinux 5.5-rc2 (diff)
downloadwireguard-linux-3f666c56c6b8cc40a5e9002aac484b8f5b83c402.tar.xz
wireguard-linux-3f666c56c6b8cc40a5e9002aac484b8f5b83c402.zip
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>
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r--include/linux/dax.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 9bd8528bd305..d5932e47c597 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -141,7 +141,7 @@ static inline void fs_put_dax(struct dax_device *dax_dev)
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev);
int dax_writeback_mapping_range(struct address_space *mapping,
- struct block_device *bdev, struct writeback_control *wbc);
+ struct dax_device *dax_dev, struct writeback_control *wbc);
struct page *dax_layout_busy_page(struct address_space *mapping);
dax_entry_t dax_lock_page(struct page *page);
@@ -180,7 +180,7 @@ static inline struct page *dax_layout_busy_page(struct address_space *mapping)
}
static inline int dax_writeback_mapping_range(struct address_space *mapping,
- struct block_device *bdev, struct writeback_control *wbc)
+ struct dax_device *dax_dev, struct writeback_control *wbc)
{
return -EOPNOTSUPP;
}