Skip to content

Commit 2ede892

Browse files
Christoph Hellwigdjbw
authored andcommitted
dax: fix up some of the block device related ifdefs
The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent de20511 commit 2ede892

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

include/linux/dax.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,15 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
108108
#endif
109109

110110
struct writeback_control;
111-
#if IS_ENABLED(CONFIG_FS_DAX)
111+
#if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX)
112112
int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);
113113
void dax_remove_host(struct gendisk *disk);
114-
114+
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev,
115+
u64 *start_off);
115116
static inline void fs_put_dax(struct dax_device *dax_dev)
116117
{
117118
put_dax(dax_dev);
118119
}
119-
120-
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev,
121-
u64 *start_off);
122-
int dax_writeback_mapping_range(struct address_space *mapping,
123-
struct dax_device *dax_dev, struct writeback_control *wbc);
124-
125-
struct page *dax_layout_busy_page(struct address_space *mapping);
126-
struct page *dax_layout_busy_page_range(struct address_space *mapping, loff_t start, loff_t end);
127-
dax_entry_t dax_lock_page(struct page *page);
128-
void dax_unlock_page(struct page *page, dax_entry_t cookie);
129120
#else
130121
static inline int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk)
131122
{
@@ -134,17 +125,25 @@ static inline int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk)
134125
static inline void dax_remove_host(struct gendisk *disk)
135126
{
136127
}
137-
138-
static inline void fs_put_dax(struct dax_device *dax_dev)
139-
{
140-
}
141-
142128
static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev,
143129
u64 *start_off)
144130
{
145131
return NULL;
146132
}
133+
static inline void fs_put_dax(struct dax_device *dax_dev)
134+
{
135+
}
136+
#endif /* CONFIG_BLOCK && CONFIG_FS_DAX */
147137

138+
#if IS_ENABLED(CONFIG_FS_DAX)
139+
int dax_writeback_mapping_range(struct address_space *mapping,
140+
struct dax_device *dax_dev, struct writeback_control *wbc);
141+
142+
struct page *dax_layout_busy_page(struct address_space *mapping);
143+
struct page *dax_layout_busy_page_range(struct address_space *mapping, loff_t start, loff_t end);
144+
dax_entry_t dax_lock_page(struct page *page);
145+
void dax_unlock_page(struct page *page, dax_entry_t cookie);
146+
#else
148147
static inline struct page *dax_layout_busy_page(struct address_space *mapping)
149148
{
150149
return NULL;

0 commit comments

Comments
 (0)