This patch fixes the compiling error when BCACHE_NVM_PAGES is disabled. The change could be added into previous nvm-pages patches, so that this patch can be dropped in next nvm-pages series. Signed-off-by: Coly Li <colyli@xxxxxxx> Cc: Jianpeng Ma <jianpeng.ma@xxxxxxxxx> Cc: Qiaowei Ren <qiaowei.ren@xxxxxxxxx> --- drivers/md/bcache/nvm-pages.c | 4 ++-- drivers/md/bcache/nvm-pages.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/nvm-pages.c b/drivers/md/bcache/nvm-pages.c index 19597ae7ef3e..b32f162bf728 100644 --- a/drivers/md/bcache/nvm-pages.c +++ b/drivers/md/bcache/nvm-pages.c @@ -7,6 +7,8 @@ * Copyright (c) 2021, Jianpeng Ma <jianpeng.ma@xxxxxxxxx>. */ +#ifdef CONFIG_BCACHE_NVM_PAGES + #include "bcache.h" #include "nvm-pages.h" @@ -23,8 +25,6 @@ #include <linux/blkdev.h> #include <linux/bcache-nvm.h> -#ifdef CONFIG_BCACHE_NVM_PAGES - struct bch_nvm_set *only_set; static void release_nvm_namespaces(struct bch_nvm_set *nvm_set) diff --git a/drivers/md/bcache/nvm-pages.h b/drivers/md/bcache/nvm-pages.h index 1c4cbad0209f..f9e0cd7ca3dd 100644 --- a/drivers/md/bcache/nvm-pages.h +++ b/drivers/md/bcache/nvm-pages.h @@ -3,8 +3,10 @@ #ifndef _BCACHE_NVM_PAGES_H #define _BCACHE_NVM_PAGES_H +#ifdef CONFIG_BCACHE_NVM_PAGES #include <linux/bcache-nvm.h> #include <linux/libnvdimm.h> +#endif /* CONFIG_BCACHE_NVM_PAGES */ /* * Bcache NVDIMM in memory data structures -- 2.26.2