diff mbox series

[v7,16/16] bcache: more fix for compiling error when BCACHE_NVM_PAGES disabled

Message ID 20210409164343.56828-17-colyli@suse.de (mailing list archive)
State New
Headers show
Series bcache: support NVDIMM for journaling | expand

Commit Message

Coly Li April 9, 2021, 4:43 p.m. UTC
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@suse.de>
Cc: Jianpeng Ma <jianpeng.ma@intel.com>
Cc: Qiaowei Ren <qiaowei.ren@intel.com>
---
 drivers/md/bcache/nvm-pages.c | 4 ++--
 drivers/md/bcache/nvm-pages.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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@intel.com>.
  */
 
+#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