[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190719113139.4005262-1-arnd@arndb.de>
Date: Fri, 19 Jul 2019 13:31:18 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-kernel@...r.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
Jani Nikula <jani.nikula@...el.com>,
Randy Dunlap <rdunlap@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
Hannes Reinecke <hare@...e.com>,
Omar Sandoval <osandov@...com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: [PATCH] [v2] blkdev: always export SECTOR_SHIFT
When CONFIG_BLOCK is disabled, SECTOR_SHIFT is unknown, and this leads
to a failure in the testing infrastructure added from commit c93a0368aaa2
("kbuild: do not create wrappers for header-test-y"):
In file included from <built-in>:3:
include/linux/iomap.h:76:48: error: use of undeclared identifier 'SECTOR_SHIFT'
return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT;
If we want to keep build testing all headers, the macro needs to
either be defined, or not used. Move it out of the #ifdef
section to ensure it is visible.
Fixes: db074436f421 ("iomap: move the direct IO code into a separate file")
Link: https://lore.kernel.org/lkml/20190718125509.775525-1-arnd@arndb.de/T/
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
The discussion about the build testing is still going on, but I promised
to send this version anyway for reference. I see no other header-test
failures in randconfig builds with this patch.
---
include/linux/blkdev.h | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0ec4f975437e..9c22d8bc6bf9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -5,6 +5,19 @@
#include <linux/sched.h>
#include <linux/sched/clock.h>
+/*
+ * The basic unit of block I/O is a sector. It is used in a number of contexts
+ * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9
+ * bytes. Variables of type sector_t represent an offset or size that is a
+ * multiple of 512 bytes. Hence these two constants.
+ */
+#ifndef SECTOR_SHIFT
+#define SECTOR_SHIFT 9
+#endif
+#ifndef SECTOR_SIZE
+#define SECTOR_SIZE (1 << SECTOR_SHIFT)
+#endif
+
#ifdef CONFIG_BLOCK
#include <linux/major.h>
@@ -889,19 +902,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
return bdev->bd_disk->queue; /* this is never NULL */
}
-/*
- * The basic unit of block I/O is a sector. It is used in a number of contexts
- * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9
- * bytes. Variables of type sector_t represent an offset or size that is a
- * multiple of 512 bytes. Hence these two constants.
- */
-#ifndef SECTOR_SHIFT
-#define SECTOR_SHIFT 9
-#endif
-#ifndef SECTOR_SIZE
-#define SECTOR_SIZE (1 << SECTOR_SHIFT)
-#endif
-
/*
* blk_rq_pos() : the current sector
* blk_rq_bytes() : bytes left in the entire request
--
2.20.0
Powered by blists - more mailing lists