summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2018-05-30 13:03:46 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-11 16:31:33 +0200
commitf266082e1b0fdfe4d2a19eac1f439a4a9e704f3a (patch)
tree452cbbee84158dfb0448979bc54b15cb91bbf142 /include
parent2384edbfa7ff6d4122bb6554a5cf94d67ee88b9e (diff)
downloadlinux-stable-f266082e1b0fdfe4d2a19eac1f439a4a9e704f3a.tar.gz
linux-stable-f266082e1b0fdfe4d2a19eac1f439a4a9e704f3a.tar.bz2
linux-stable-f266082e1b0fdfe4d2a19eac1f439a4a9e704f3a.zip
dax: change bdev_dax_supported() to support boolean returns
commit 80660f20252d6f76c9f203874ad7c7a4a8508cf8 upstream. The function return values are confusing with the way the function is named. We expect a true or false return value but it actually returns 0/-errno. This makes the code very confusing. Changing the return values to return a bool where if DAX is supported then return true and no DAX support returns false. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dax.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 2a4f7295c12b..c99692ddd4b5 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -64,8 +64,8 @@ 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)
-int __bdev_dax_supported(struct block_device *bdev, int blocksize);
-static inline int bdev_dax_supported(struct block_device *bdev, int blocksize)
+bool __bdev_dax_supported(struct block_device *bdev, int blocksize);
+static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize)
{
return __bdev_dax_supported(bdev, blocksize);
}
@@ -84,10 +84,10 @@ 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);
#else
-static inline int bdev_dax_supported(struct block_device *bdev,
+static inline bool bdev_dax_supported(struct block_device *bdev,
int blocksize)
{
- return -EOPNOTSUPP;
+ return false;
}
static inline struct dax_device *fs_dax_get_by_host(const char *host)