Skip to content

Commit cd93a2a

Browse files
Christoph Hellwigdjbw
authored andcommitted
dax: remove __generic_fsdax_supported
Just implement generic_fsdax_supported directly out of line instead of adding a wrapper. Given that generic_fsdax_supported is only supplied for CONFIG_FS_DAX builds this also allows to not provide it at all for !CONFIG_FS_DAX builds. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dan Williams <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 673a065 commit cd93a2a

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

drivers/dax/super.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
119119
return dax_get_by_host(bdev->bd_disk->disk_name);
120120
}
121121
EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev);
122-
#endif
123122

124-
bool __generic_fsdax_supported(struct dax_device *dax_dev,
123+
bool generic_fsdax_supported(struct dax_device *dax_dev,
125124
struct block_device *bdev, int blocksize, sector_t start,
126125
sector_t sectors)
127126
{
@@ -201,7 +200,8 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev,
201200
}
202201
return true;
203202
}
204-
EXPORT_SYMBOL_GPL(__generic_fsdax_supported);
203+
EXPORT_SYMBOL_GPL(generic_fsdax_supported);
204+
#endif /* CONFIG_FS_DAX */
205205

206206
/**
207207
* __bdev_dax_supported() - Check if the device supports dax for filesystem
@@ -360,7 +360,7 @@ bool dax_supported(struct dax_device *dax_dev, struct block_device *bdev,
360360
return false;
361361

362362
id = dax_read_lock();
363-
if (dax_alive(dax_dev))
363+
if (dax_alive(dax_dev) && dax_dev->ops->dax_supported)
364364
ret = dax_dev->ops->dax_supported(dax_dev, bdev, blocksize,
365365
start, len);
366366
dax_read_unlock(id);

include/linux/dax.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,9 @@ static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize)
123123
return __bdev_dax_supported(bdev, blocksize);
124124
}
125125

126-
bool __generic_fsdax_supported(struct dax_device *dax_dev,
126+
bool generic_fsdax_supported(struct dax_device *dax_dev,
127127
struct block_device *bdev, int blocksize, sector_t start,
128128
sector_t sectors);
129-
static inline bool generic_fsdax_supported(struct dax_device *dax_dev,
130-
struct block_device *bdev, int blocksize, sector_t start,
131-
sector_t sectors)
132-
{
133-
return __generic_fsdax_supported(dax_dev, bdev, blocksize, start,
134-
sectors);
135-
}
136129

137130
static inline void fs_put_dax(struct dax_device *dax_dev)
138131
{
@@ -154,12 +147,7 @@ static inline bool bdev_dax_supported(struct block_device *bdev,
154147
return false;
155148
}
156149

157-
static inline bool generic_fsdax_supported(struct dax_device *dax_dev,
158-
struct block_device *bdev, int blocksize, sector_t start,
159-
sector_t sectors)
160-
{
161-
return false;
162-
}
150+
#define generic_fsdax_supported NULL
163151

164152
static inline void fs_put_dax(struct dax_device *dax_dev)
165153
{

0 commit comments

Comments
 (0)