diff --git a/Makefile b/Makefile index 1199b14c3..14dca74b9 100644 --- a/Makefile +++ b/Makefile @@ -54,15 +54,6 @@ EMULEX_DIR=emulex ISCSI_DIR=iscsi-scst -# Set variable $(2) to value $(3) in file $(1) if $(2)=$(3) does not yet occur -# in file $(1). -set_var = $(shell if grep -q '^$(2)=' '$(1)'; then \ - grep -q '^$(2)=$(3)$$' '$(1)' || \ - sed -i 's/^$(2)=.*/$(2)=$(3)/' '$(1)'; \ - else \ - echo '$(2)=$(3)' >> '$(1)'; \ - fi) - REVISION ?= $(shell if [ -e .svn ]; then \ svn info | sed -n 's/^Revision:[[:blank:]]*/./p'; \ elif [ -e .git ]; then \ @@ -552,41 +543,14 @@ release-archive: done $(MAKE) 2debug -2perf: extraclean - $(call set_var,build_mode,BUILD_MODE,PERF) +2perf: cd $(SCST_DIR) && $(MAKE) $@ - @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(QLA_OLD_DIR) ]; then cd $(QLA_OLD_DIR) && $(MAKE) $@; fi -# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi - @if [ -d $(SRP_DIR) ]; then cd $(SRP_DIR) && $(MAKE) $@; fi - @if [ -d $(ISCSI_DIR) ]; then cd $(ISCSI_DIR) && $(MAKE) $@; fi - @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi - @if [ -d $(SCST_LOCAL_DIR) ]; then cd $(SCST_LOCAL_DIR) && $(MAKE) $@; fi - @if [ -d $(FCST_DIR) ]; then cd $(FCST_DIR) && $(MAKE) $@; fi -2release: extraclean - $(call set_var,build_mode,BUILD_MODE,RELEASE) +2release: cd $(SCST_DIR) && $(MAKE) $@ - @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(QLA_OLD_DIR) ]; then cd $(QLA_OLD_DIR) && $(MAKE) $@; fi -# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi - @if [ -d $(SRP_DIR) ]; then cd $(SRP_DIR) && $(MAKE) $@; fi - @if [ -d $(ISCSI_DIR) ]; then cd $(ISCSI_DIR) && $(MAKE) $@; fi - @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi - @if [ -d $(SCST_LOCAL_DIR) ]; then cd $(SCST_LOCAL_DIR) && $(MAKE) $@; fi - @if [ -d $(FCST_DIR) ]; then cd $(FCST_DIR) && $(MAKE) $@; fi -2debug: extraclean - $(call set_var,build_mode,BUILD_MODE,) +2debug: cd $(SCST_DIR) && $(MAKE) $@ - @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(QLA_OLD_DIR) ]; then cd $(QLA_OLD_DIR) && $(MAKE) $@; fi -# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi - @if [ -d $(SRP_DIR) ]; then cd $(SRP_DIR) && $(MAKE) $@; fi - @if [ -d $(ISCSI_DIR) ]; then cd $(ISCSI_DIR) && $(MAKE) $@; fi - @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi - @if [ -d $(SCST_LOCAL_DIR) ]; then cd $(SCST_LOCAL_DIR) && $(MAKE) $@; fi - @if [ -d $(FCST_DIR) ]; then cd $(FCST_DIR) && $(MAKE) $@; fi .PHONY: all install uninstall clean extraclean tags help \ qla qla_install qla_uninstall qla_clean qla_extraclean \ diff --git a/fcst/Makefile b/fcst/Makefile index a91353009..4920c4f46 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -100,17 +100,7 @@ clean: extraclean: clean rm -f *.orig *.rej -2debug: - -$(MAKE) clean - -2release: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - release-archive: ../scripts/generate-release-archive fcst "$$(sed -n 's/^#define[[:blank:]]FT_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fcst.h)" -.PHONY: all tgt install uninstall clean extraclean 2debug 2release 2perf \ - release-archive +.PHONY: all tgt install uninstall clean extraclean release-archive diff --git a/fcst/Makefile_in-tree b/fcst/Makefile_in-tree index a5703d0cf..a4a24738d 100644 --- a/fcst/Makefile_in-tree +++ b/fcst/Makefile_in-tree @@ -1,15 +1,5 @@ ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../build_mode - -echo := $(shell echo "fcst build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DDEBUG_WORK_IN_THREAD -DCONFIG_SCST_TRACING \ - -DCONFIG_SCST_DEBUG -DCONFIG_SCST_EXTRACHECKS \ - -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = ccflags-y += -I$(KBUILD_EXTMOD)/../scst/include -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) endif obj-$(CONFIG_FCST) += fcst.o diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 597af30f6..302219053 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -299,16 +299,7 @@ conftest/use_pre_440_wr_structure/result-$(KVER).txt: \ echo "$(call run_conftest,use_pre_440_wr_structure, \ -DUSE_PRE_440_WR_STRUCTURE)" >"$@" -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - release-archive: ../scripts/generate-release-archive iscsi-scst "$$(sed -n 's/^#define[[:blank:]]ISCSI_VERSION_STRING[[:blank:]]*\"\([^\"]*\)\".*/\1/p' include/iscsi_scst_ver.h)" -.PHONY: all mods progs install clean extraclean 2release 2debug 2perf +.PHONY: all mods progs install clean extraclean diff --git a/iscsi-scst/kernel/Makefile b/iscsi-scst/kernel/Makefile index 85ad48733..bac58cd8b 100644 --- a/iscsi-scst/kernel/Makefile +++ b/iscsi-scst/kernel/Makefile @@ -27,18 +27,6 @@ ccflags-y += $(call cc-option,-Wextra) \ ccflags-y += $(PRE_CFLAGS) #ccflags-y += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "iscsi-scst build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - obj-m += iscsi-scst.o iscsi-scst-objs := iscsi.o nthread.o config.o digest.o \ conn.o session.o target.o event.o param.o \ diff --git a/iscsi-scst/kernel/iscsi_trace_flag.h b/iscsi-scst/kernel/iscsi_trace_flag.h index c5ddd5755..6f2006713 100644 --- a/iscsi-scst/kernel/iscsi_trace_flag.h +++ b/iscsi-scst/kernel/iscsi_trace_flag.h @@ -15,6 +15,10 @@ #ifndef ISCSI_TRACE_FLAG_H #define ISCSI_TRACE_FLAG_H +#ifndef INSIDE_KERNEL_TREE +#include "build_mode.h" +#endif + /* * Only include this header file from iscsi-scst source files and not from * isert-scst source files. diff --git a/iscsi-scst/kernel/isert-scst/Makefile b/iscsi-scst/kernel/isert-scst/Makefile index a2b709c7b..3808f19d3 100644 --- a/iscsi-scst/kernel/isert-scst/Makefile +++ b/iscsi-scst/kernel/isert-scst/Makefile @@ -26,18 +26,6 @@ ccflags-y += $(call cc-option,-Wextra) \ $(call cc-option,-Wno-old-style-declaration) \ -Wno-unused-parameter -Wno-missing-field-initializers -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../../build_mode - -echo := $(shell echo "isert-scst build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - obj-m += isert-scst.o isert-scst-objs := isert.o isert_login.o \ iser_datamover.o iser_rdma.o iser_buf.o iser_pdu.o iser_global.o diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index 9f170d8f7..328477d76 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -3,9 +3,9 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ -5.0.12 \ +5.0.13 \ 4.20.17-nc \ -4.19.39-nc \ +4.19.40-nc \ 4.18.18-nc \ 4.17.18-nc \ 4.16.18-nc \ diff --git a/qla2x00t-32gbit/Makefile_in-tree b/qla2x00t-32gbit/Makefile_in-tree index 1437a63a5..d58abd0b6 100644 --- a/qla2x00t-32gbit/Makefile_in-tree +++ b/qla2x00t-32gbit/Makefile_in-tree @@ -1,17 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../build_mode - -echo := $(shell echo "qla2x00t-32gbit build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \ qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index f3aacd5a6..0a4228bae 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -65,18 +65,6 @@ ccflags-y += -W -Wno-unused-parameter -Wno-missing-field-initializers #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "qla2x00t-32gbit/target build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - ifneq ($(BUILD_2X_MODULE),) ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y endif @@ -147,13 +135,4 @@ clean: extraclean: clean rm -f *.orig *.rej -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - -.PHONY: all tgt install uninstall clean extraclean 2perf 2release 2debug qla2xxx_scst +.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst diff --git a/qla2x00t-32gbit/qla_fw.h b/qla2x00t-32gbit/qla_fw.h index b2834c9c0..fad7bd0ad 100644 --- a/qla2x00t-32gbit/qla_fw.h +++ b/qla2x00t-32gbit/qla_fw.h @@ -18,6 +18,7 @@ #ifdef INSIDE_KERNEL_TREE #include #else +#include "build_mode.h" #include "backport.h" #endif diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index 81dee3b76..44bde2c60 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -8,6 +8,7 @@ #ifdef INSIDE_KERNEL_TREE #include /* timer_setup() */ #else +#include "build_mode.h" #include "backport.h" #endif diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index c71721545..8e675464b 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -64,18 +64,6 @@ ccflags-y += -W -Wno-unused-parameter -Wno-missing-field-initializers #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD #ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "qla2x00t build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - ifneq ($(BUILD_2X_MODULE),) ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y endif @@ -146,13 +134,4 @@ clean: extraclean: clean rm -f *.orig *.rej -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - -.PHONY: all tgt install uninstall clean extraclean 2perf 2release 2debug qla2xxx_scst +.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst diff --git a/qla2x00t/qla_inline.h b/qla2x00t/qla_inline.h index a1d597889..03137993e 100644 --- a/qla2x00t/qla_inline.h +++ b/qla2x00t/qla_inline.h @@ -8,6 +8,7 @@ #ifdef INSIDE_KERNEL_TREE #include /* timer_setup() */ #else +#include "build_mode.h" #include "backport.h" #endif diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 188e556cf..19fb9d933 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -632,6 +632,7 @@ BEGIN { if (!process_file) { + sub("^+#ifdef INSIDE_KERNEL_TREE$", "+#if 1") print next } diff --git a/scst/Makefile b/scst/Makefile index 8551c656b..ce200994b 100644 --- a/scst/Makefile +++ b/scst/Makefile @@ -23,10 +23,19 @@ SHELL=/bin/bash SCST_DIR=src -all: +# Set variable $(2) to value $(3) in file $(1) if $(2)=$(3) does not yet occur +# in file $(1). +set_var = $(shell if grep -q '^$(2)=' '$(1)' 2>/dev/null; then \ + grep -q '^$(2)=$(3)$$' '$(1)' || \ + sed -i 's/^$(2)=.*/$(2)=$(3)/' '$(1)'; \ + else \ + echo '$(2)=$(3)' >> '$(1)'; \ + fi) + +all: include/build_mode.h cd $(SCST_DIR) && $(MAKE) $@ -install: +install: include/build_mode.h cd $(SCST_DIR) && $(MAKE) $@ uninstall: @@ -38,19 +47,44 @@ clean: extraclean: cd $(SCST_DIR) && $(MAKE) $@ -2release: - cd $(SCST_DIR) && $(MAKE) $@ - 2debug: - cd $(SCST_DIR) && $(MAKE) $@ + $(call set_var,build_mode,BUILD_MODE,) + +2release: + $(call set_var,build_mode,BUILD_MODE,RELEASE) 2perf: - cd $(SCST_DIR) && $(MAKE) $@ + $(call set_var,build_mode,BUILD_MODE,PERF) release-archive: ../scripts/generate-release-archive scst \ "$$(sed -n 's/^#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^\"]*\)\".*/\1/p' include/scst_const.h)" \ +build_mode: + $(call set_var,build_mode,BUILD_MODE,) + +include/build_mode.h: build_mode + @rm -f $@.tmp; \ + touch $@.tmp; \ + source build_mode; \ + case "$${BUILD_MODE}" in \ + "") defines="CONFIG_SCST_TRACING CONFIG_SCST_DEBUG \ + CONFIG_SCST_EXTRACHECKS";; \ + RELEASE) defines=CONFIG_SCST_TRACING;; \ + PERF) defines="";; \ + *) echo "Error: unsupported build mode $$(>$@.tmp; \ + done; \ + if [ ! -e $@ ] || ! diff -q $@.tmp $@ >&/dev/null; then \ + mv $@.tmp $@; \ + else \ + rm -f $@.tmp; \ + fi + help: @echo " all (the default) : make all" @echo " clean : clean files" diff --git a/scst/include/scst.h b/scst/include/scst.h index 0db3a4a73..e274f5953 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -61,6 +61,7 @@ #include #include #else +#include #include #include #endif diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index dabfe57a8..b789252cd 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -38,6 +38,7 @@ #ifdef INSIDE_KERNEL_TREE #include #else +#include #include #endif diff --git a/scst/src/Makefile b/scst/src/Makefile index 8f550fda7..3b2c699af 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -55,18 +55,6 @@ ccflags-y += -I$(KBUILD_EXTMOD)/../include $(call cc-option,-Wextra) \ # enable it if you have strict security requirements. #ccflags-y += -DSCST_STRICT_SECURITY -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "scst build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - obj-m := scst.o scst-y += scst_main.o @@ -192,13 +180,4 @@ extraclean: clean cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ rm -f *.orig *.rej -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - -.PHONY: all install uninstall clean extraclean 2release 2debug 2perf +.PHONY: all install uninstall clean extraclean diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 0327eb39d..789eab1e9 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -35,18 +35,6 @@ ccflags-y += -I$(KBUILD_EXTMOD)/../include \ -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare #ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "dev_handlers build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ scst_vdisk.o scst_raid.o scst_processor.o scst_user.o @@ -95,13 +83,4 @@ clean: extraclean: clean rm -f *.orig *.rej -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - -.PHONY: all install uninstall clean extraclean 2release 2debug 2perf +.PHONY: all install uninstall clean extraclean diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index dbfe1e1e4..8125244f8 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1794,7 +1794,11 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd, res = fd->f_op->fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, len); - if (unlikely(res != 0)) { + if (unlikely(res == -EOPNOTSUPP)) { + PRINT_WARNING_ONCE("%s: fallocate() is not supported by the filesystem. Consider setting 'thin_provisioned' to 0 in scst.conf for %s.\n", + virt_dev->name, virt_dev->name); + res = 0; + } else if (unlikely(res != 0)) { PRINT_WARNING_ONCE("fallocate() for %lld, len %lld " "failed: %d", (unsigned long long)off, (unsigned long long)len, res); diff --git a/scst_local/Makefile b/scst_local/Makefile index 62f0521fa..1684088ed 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -13,18 +13,6 @@ ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\ #ccflags-y += -DCONFIG_SCST_LOCAL_DIRECT_PROCESSING -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../build_mode - -echo := $(shell echo "scst_local build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - obj-m := scst_local.o else ######### BEGIN OUT-OF-TREE RULES ######### @@ -84,17 +72,8 @@ clean: extraclean: clean rm -f *.orig *.rej -2release: - -$(MAKE) clean - -2debug: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - release-archive: ../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)" -.PHONY: all tgt install uninstall clean extraclean 2release 2debug 2perf +.PHONY: all tgt install uninstall clean extraclean diff --git a/srpt/Makefile b/srpt/Makefile index dca7e2593..159a15577 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -277,19 +277,10 @@ conftest/use_pre_440_wr_structure/result-$(KVER).txt: \ echo "$(call run_conftest,use_pre_440_wr_structure, \ -DUSE_PRE_440_WR_STRUCTURE)" >"$@" -2debug: - -$(MAKE) clean - -2release: - -$(MAKE) clean - -2perf: - -$(MAKE) clean - release-archive: ../scripts/generate-release-archive srpt "$$(sed -n 's/^#define[[:blank:]]DRV_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' src/ib_srpt.c)" kerneldoc.html: $(SRC_FILES) $(KDIR)/scripts/kernel-doc -html $(SRC_FILES) >$@ -.PHONY: all install clean extraclean 2debug 2release 2perf +.PHONY: all install clean extraclean diff --git a/srpt/src/Makefile b/srpt/src/Makefile index b35aa0832..519f47cb7 100644 --- a/srpt/src/Makefile +++ b/srpt/src/Makefile @@ -2,18 +2,6 @@ LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) CPPFLAGS := $(PRE_CFLAGS) $(CPPFLAGS) ccflags-y += -I$(KBUILD_EXTMOD)/../../scst/include -ifneq ($(and $(KBUILD_EXTMOD),$(if $(findstring $(abspath $(srctree)),$(abspath $(KBUILD_EXTMOD))),,true)),) --include $(KBUILD_EXTMOD)/../../build_mode - -echo := $(shell echo "srpt build mode: $(BUILD_MODE)" >& 2) - -BUILD_MODE_CFLAGS_ = -DCONFIG_SCST_TRACING -DCONFIG_SCST_DEBUG \ - -DCONFIG_SCST_EXTRACHECKS -fno-inline -fno-inline-functions -BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING -BUILD_MODE_CFLAGS_PERF = -ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) -endif - #ccflags-y += -Wextra -Wno-unused-parameter obj-m += ib_srpt.o diff --git a/usr/events/Makefile b/usr/events/Makefile index f98b09283..c5da707da 100644 --- a/usr/events/Makefile +++ b/usr/events/Makefile @@ -26,7 +26,7 @@ CFLAGS += -W -Wno-unused-parameter CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_NOMEM --include ../../build_mode +-include ../../scst/build_mode echo := $(shell echo "usr/events build mode: $(BUILD_MODE)" >& 2) diff --git a/usr/fileio/Makefile b/usr/fileio/Makefile index cc6b0796a..b46372f91 100644 --- a/usr/fileio/Makefile +++ b/usr/fileio/Makefile @@ -47,7 +47,7 @@ CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_TM_IGNORE_ALL CFLAGS += -DDEBUG_EXT_COPY_REMAP --include ../../build_mode +-include ../../scst/build_mode echo := $(shell echo "usr/fileio build mode: $(BUILD_MODE)" >& 2) diff --git a/usr/stpgd/Makefile b/usr/stpgd/Makefile index 25c541073..9a67f312f 100644 --- a/usr/stpgd/Makefile +++ b/usr/stpgd/Makefile @@ -28,7 +28,7 @@ CFLAGS += -W -Wno-unused-parameter CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_NOMEM --include ../../build_mode +-include ../../scst/build_mode echo := $(shell echo "usr/stpgd build mode: $(BUILD_MODE)" >& 2)