From: Ben Hutchings Date: Thu, 12 Jul 2018 00:02:13 +0000 (+0100) Subject: dax: Avoid ABI change in 4.17.6 X-Git-Tag: archive/raspbian/4.18.10-2+rpi1^2^2^2^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=20797a14bc2adaeb40eba48263a62a90260f5b15;p=linux.git dax: Avoid ABI change in 4.17.6 The return type and first parameter type for bdev_dax_supported() and __bdev_dax_supported() were changed by commits ba23cba9b3bd "fs: allow per-device dax status checking for filesystems" and 80660f20252d "dax: change bdev_dax_supported() to support boolean returns". Avoid an ABI break by renaming the new version of __bdev_dax_supported() and reintroducing the old version as a wrapper for it. Add a #define so that the old version is hidden from the API, i.e. newly built modules must use the new API. Gbp-Pq: Topic debian Gbp-Pq: Name dax-avoid-abi-change-in-4.17.6.patch --- diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 1d2de641cab..f446c2a54e3 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -72,6 +72,8 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev); #endif +#undef __bdev_dax_supported + /** * __bdev_dax_supported() - Check if the device supports dax for filesystem * @bdev: block device to check @@ -82,7 +84,7 @@ EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev); * * Return: true if supported, false if unsupported */ -bool __bdev_dax_supported(struct block_device *bdev, int blocksize) +bool __bdev_dax_supported_new(struct block_device *bdev, int blocksize) { struct dax_device *dax_dev; struct request_queue *q; @@ -152,6 +154,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) return true; } +EXPORT_SYMBOL_GPL(__bdev_dax_supported_new); + +int __bdev_dax_supported(struct super_block *sb, int blocksize) +{ + return __bdev_dax_supported_new(sb->s_bdev, blocksize) + ? 0 : -EOPNOTSUPP; +} EXPORT_SYMBOL_GPL(__bdev_dax_supported); #endif diff --git a/include/linux/dax.h b/include/linux/dax.h index c99692ddd4b..3d9a90cb435 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -64,7 +64,9 @@ static inline bool dax_write_cache_enabled(struct dax_device *dax_dev) struct writeback_control; int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); #if IS_ENABLED(CONFIG_FS_DAX) -bool __bdev_dax_supported(struct block_device *bdev, int blocksize); +int __bdev_dax_supported(struct super_block *sb, int blocksize); +bool __bdev_dax_supported_new(struct block_device *bdev, int blocksize); +#define __bdev_dax_supported __bdev_dax_supported_new static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize) { return __bdev_dax_supported(bdev, blocksize);