Thread (17 messages) 17 messages, 1 author, 2021-04-09
DORMANTno replies

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

From: Coly Li <hidden>
Date: 2021-04-09 16:45:53
Also in: linux-bcache, nvdimm
Subsystem: bcache (block layer cache), the rest · Maintainers: Coly Li, Kent Overstreet, Linus Torvalds

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 <redacted>
Cc: Jianpeng Ma <redacted>
Cc: Qiaowei Ren <redacted>
---
 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@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
-- 
2.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help