Skip to content

Commit 3c3622d

Browse files
rddunlaptorvalds
authored andcommitted
Fix compile issues in fs/compat_ioctl.c when CONFIG_BLOCK is disabled
Fix fs/compat_ioctl.c to handle CONFIG_BLOCK=n, CONFIG_SCSI=n to avoid build errors: In file included from include/scsi/scsi.h:12, from fs/compat_ioctl.c:71: include/scsi/scsi_cmnd.h:27:25: warning: "BLK_MAX_CDB" is not defined include/scsi/scsi_cmnd.h:28:3: error: #error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB In file included from include/scsi/scsi.h:12, from fs/compat_ioctl.c:71: include/scsi/scsi_cmnd.h: In function 'scsi_bidi_cmnd': include/scsi/scsi_cmnd.h:182: error: implicit declaration of function 'blk_bidi_rq' include/scsi/scsi_cmnd.h:183: error: dereferencing pointer to incomplete type include/scsi/scsi_cmnd.h: In function 'scsi_in': include/scsi/scsi_cmnd.h:189: error: dereferencing pointer to incomplete type Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e3621ee commit 3c3622d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/compat_ioctl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@
6969
#include <linux/capi.h>
7070
#include <linux/gigaset_dev.h>
7171

72+
#ifdef CONFIG_BLOCK
7273
#include <scsi/scsi.h>
7374
#include <scsi/scsi_ioctl.h>
7475
#include <scsi/sg.h>
76+
#endif
7577

7678
#include <asm/uaccess.h>
7779
#include <linux/ethtool.h>
@@ -2024,6 +2026,7 @@ COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
20242026
COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
20252027
COMPATIBLE_IOCTL(PIO_FONTRESET)
20262028
COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
2029+
#ifdef CONFIG_BLOCK
20272030
/* Big S */
20282031
COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
20292032
COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
@@ -2033,6 +2036,7 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
20332036
COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
20342037
COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
20352038
COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
2039+
#endif
20362040
/* Big T */
20372041
COMPATIBLE_IOCTL(TUNSETNOCSUM)
20382042
COMPATIBLE_IOCTL(TUNSETDEBUG)
@@ -2103,6 +2107,7 @@ COMPATIBLE_IOCTL(SIOCGIFVLAN)
21032107
COMPATIBLE_IOCTL(SIOCSIFVLAN)
21042108
COMPATIBLE_IOCTL(SIOCBRADDBR)
21052109
COMPATIBLE_IOCTL(SIOCBRDELBR)
2110+
#ifdef CONFIG_BLOCK
21062111
/* SG stuff */
21072112
COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
21082113
COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
@@ -2127,6 +2132,7 @@ COMPATIBLE_IOCTL(SG_SCSI_RESET)
21272132
COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
21282133
COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
21292134
COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
2135+
#endif
21302136
/* PPP stuff */
21312137
COMPATIBLE_IOCTL(PPPIOCGFLAGS)
21322138
COMPATIBLE_IOCTL(PPPIOCSFLAGS)

0 commit comments

Comments
 (0)