Commit 26f2f4de authored by Dan Williams's avatar Dan Williams

dax: fix FS_DAX=n BLOCK=y compilation

The 0day kbuild robot reports:

>> drivers//dax/super.c:64:20: error: redefinition of 'fs_dax_get_by_bdev'
    struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
                       ^~~~~~~~~~~~~~~~~~
   In file included from drivers//dax/super.c:22:0:
   include/linux/dax.h:76:34: note: previous definition of 'fs_dax_get_by_bdev' was here
    static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
                                     ^~~~~~~~~~~~~~~~~~

Protect the definition of fs_dax_get_by_bdev() in drivers/dax/super.c
with an ifdef.

Fixes: 78f35473 ("dax: introduce a fs_dax_get_by_bdev() helper")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 8f98ae0c
...@@ -61,6 +61,7 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, ...@@ -61,6 +61,7 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,
} }
EXPORT_SYMBOL(bdev_dax_pgoff); EXPORT_SYMBOL(bdev_dax_pgoff);
#if IS_ENABLED(CONFIG_FS_DAX)
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
{ {
if (!blk_queue_dax(bdev->bd_queue)) if (!blk_queue_dax(bdev->bd_queue))
...@@ -68,6 +69,7 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) ...@@ -68,6 +69,7 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
return fs_dax_get_by_host(bdev->bd_disk->disk_name); return fs_dax_get_by_host(bdev->bd_disk->disk_name);
} }
EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev); EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev);
#endif
/** /**
* __bdev_dax_supported() - Check if the device supports dax for filesystem * __bdev_dax_supported() - Check if the device supports dax for filesystem
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment