diff --git a/scst/README b/scst/README index a8ccbd533..b13cc1823 100644 --- a/scst/README +++ b/scst/README @@ -13,7 +13,7 @@ SCST's Internet page http://scst.sourceforge.net. SCST looks to be quite stable (for beta) and useful. It supports disks (SCSI type 0), tapes (type 1), processor (type 3), CDROM's (type 5), MO disks (type 7), medium changers (type 8) and RAID controller (type 0xC) -as well as FILEIO and "performance" device handlers. In addition, it +as well as VDISK and "performance" device handlers. In addition, it supports advanced per-initiator access and devices visibility management, so different initiators could see different set of devices with different access permissions. See below for details. @@ -34,7 +34,7 @@ new functions scsi_do_req_fifo()/scsi_execute_async_fifo() to be added in the kernel. Patch 26_scst-2.6.X.patch from "kernel" directory does that. If it doesn't apply to your kernel, apply it manually, it only adds one of those functions and nothing more. You may not patch the -kernel if STRICT_SERIALIZING or FILEIO_ONLY are defined during the +kernel if STRICT_SERIALIZING or VDISK_ONLY are defined during the compilation (see their description below). To compile SCST type 'make'. It will build SCST itself and its device @@ -55,7 +55,7 @@ Then you can load any module by typing 'modprobe drive_name'. The names are: - scst_modisk - device handler for MO disks (type 7) - scst_changer - device handler for medium changers (type 8) - scst_raid - device handler for storage array controller (e.g. raid) (type C) - - scst_fileio - device handler for FILE IO (disk or ISO CD image). + - scst_vdisk - device handler for virtual disks (disk or ISO CD image). Then, to see your devices remotely, you need to add them to at least "Default" security group (see below how). By default, no local devices @@ -97,10 +97,10 @@ for a SCSI device type isn't loaded, SCST doesn't know how to handle devices of this type, so they will be invisible for remote initiators (more precisely, "LUN not supported" sense code will be returned). -In addition to device handlers for real devices, there are FILEIO and +In addition to device handlers for real devices, there are VDISK and "performance" ones. -FILEIO device handler works over files on file systems and makes from +VDISK device handler works over files on file systems and makes from them virtual remotely available SCSI disks or CDROM's. In addition, it allows to work directly over a block device, e.g. local IDE or SCSI disk or ever disk partition, where there is no file systems overhead. Using @@ -111,7 +111,7 @@ caching and read ahead performed by Linux's VM subsystem. The only disadvantage here that there is superfluous data copying between the cache and SCST's buffers. This issue is going to be addressed in the next release. Virtual CDROM's are useful for remote installation. See -below for details how to setup and use FILEIO device handler. +below for details how to setup and use VDISK device handler. "Performance" device handlers for disks, MO disks and tapes in their exec() method skip (pretend to execute) all READ and WRITE operations @@ -129,7 +129,7 @@ Compilation options There are the following compilation options, that could be commented in/out in Makefile: - - FILEIO_ONLY - if defined, the pass-through device handlers + - VDISK_ONLY - if defined, the pass-through device handlers (scst_disk, scst_tape) will not work, but SCST will not require the kernel patching. Defined by default to ease new people try SCST on their kernels. @@ -288,27 +288,27 @@ Examples: group with LUN 0. - "echo "add disk1 1" >/proc/scsi_tgt/groups/Default/devices" will - add virtual FILEIO device with name "disk1" to "Default" group + add virtual VDISK device with name "disk1" to "Default" group with LUN 1. -FILEIO device handler ---------------------- +VDISK device handler +-------------------- -After loading FILEIO device handler creates in "/proc/scsi_tgt/" -subdirectories "disk_fileio" and "cdrom_fileio". They have similar layout: +After loading VDISK device handler creates in "/proc/scsi_tgt/" +subdirectories "vdisk" and "vcdrom". They have similar layout: - "trace_level" and "type" files as described for other dev handlers - - "help" file, which provides online help for FILEIO commands + - "help" file, which provides online help for VDISK commands - - "disk_fileio"/"cdrom_fileio" files, which on read provides - information of currently open device files. On write it supports the - following command: + - "vdisk"/"vcdrom" files, which on read provides information of + currently open device files. On write it supports the following + command: * "open NAME [PATH] [BLOCK_SIZE] [FLAGS]" - opens file "PATH" as device "NAME" with block size "BLOCK_SIZE" bytes with flags - "FLAGS". "PATH" could be empty only for FILEIO CDROM. "BLOCK_SIZE" - and "FLAGS" are valid only for disk FILEIO. The block size must be + "FLAGS". "PATH" could be empty only for VDISK CDROM. "BLOCK_SIZE" + and "FLAGS" are valid only for disk VDISK. The block size must be power of 2 and >= 512 bytes Default is 512. Possible flags: - WRITE_THROUGH - write back caching disabled @@ -340,12 +340,12 @@ subdirectories "disk_fileio" and "cdrom_fileio". They have similar layout: * "close NAME" - closes device "NAME". - * "change NAME [PATH]" - changes a virtual CD in the FILEIO CDROM. + * "change NAME [PATH]" - changes a virtual CD in the VDISK CDROM. -For example, "echo "open disk1 /vdisks/disk1" >/proc/scsi_tgt/disk_fileio/disk_fileio" -will open file /vdisks/disk1 as virtual FILEIO disk with name "disk1". +For example, "echo "open disk1 /vdisks/disk1" >/proc/scsi_tgt/vdisk/vdisk" +will open file /vdisks/disk1 as virtual VDISK disk with name "disk1". -IMPORTANT: By default for performance reasons FILEIO devices use write back +IMPORTANT: By default for performance reasons VDISK devices use write back ========= caching policy. This is generally safe from the consistence of journaled file systems, laying over them, point of view, but your unsaved cached data will be lost in case of @@ -390,13 +390,13 @@ Before doing any performance measurements note that: I. Currently maximum performance is possible only with real SCSI devices with several simultaneously executed commands (SCSI tagged queuing) or -performance handlers. If you have enough CPU power, FILEIO handler also +performance handlers. If you have enough CPU power, VDISK handler also could provide the same results, when aggregate throughput is close to the aggregate throughput locally on the target from the same disks. Also note, that currently IO subsystem in Linux implemented on such way, so a -FILEIO device over a single file occupied entire formatted with some +VDISK device over a single file occupied entire formatted with some file system device (eg /dev/hdc) could perform considerably better, than -a FILEIO device over /dev/hdc itself without the file system involved. +a VDISK device over /dev/hdc itself without the file system involved. II. In order to get the maximum performance you should: @@ -409,7 +409,7 @@ II. In order to get the maximum performance you should: - Disable in Makefile EXTRACHECKS, TRACING, DEBUG_TGT, DEBUG_WORK_IN_THREAD -3. For device handlers, including FILEIO: +3. For device handlers, including VDISK: - Disable in Makefile TRACING, DEBUG @@ -445,13 +445,13 @@ IMPORTANT: Some of those options enabled by default, i.e. SCST is optimized expected. IMPORTANT: If you use on initiator some versions of Windows (at least W2K) -========= you can't get good write performance for FILEIO devices with +========= you can't get good write performance for VDISK devices with default 512 bytes block sizes. You could get about 10% of the expected one. This is because of "unusual" write access pattern, with which Windows'es write data and which is (simplifying) incompatible with how Linux page cache works, so for each write the corresponding block must be read first. - With 4096 bytes block sizes for FILEIO devices the write + With 4096 bytes block sizes for VDISK devices the write performance will be as expected. Actually, any system on initiator, not only Windows, will benefit from block size max(PAGE_SIZE, BLOCK_SIZE_ON_UNDERLYING_FS), where PAGE_SIZE diff --git a/scst/ToDo b/scst/ToDo index 2977ebcb6..755407dd1 100644 --- a/scst/ToDo +++ b/scst/ToDo @@ -3,7 +3,7 @@ To be done - Kernel build integration (patch). - - Reimplement FILEIO handler with usage of async. read/write operations + - Reimplement VDISK handler with usage of async. read/write operations (in order to avoid unnecessary context switches) and direct access to the page cache (in order to avoid data copy between it and internal buffers). Requires modifications of the kernel. @@ -27,7 +27,7 @@ To be done - Redone some semaphores with completion interface. - HIGHMEM cleanup. Looks like HIGHMEM usage doesn't worth the effort and - performance hit, at least until FILEIO handler doesn't use the page + performance hit, at least until VDISK handler doesn't use the page cache directly, so disable it for now, although the code looks ready. To enable it, set SCST_HIGHMEM in 1 in scst_priv.h. HIGHMEM is not supported on 2.4 and is not going to be. diff --git a/scst/include/scsi_tgt.h b/scst/include/scsi_tgt.h index 31b310667..89f5e0de6 100644 --- a/scst/include/scsi_tgt.h +++ b/scst/include/scsi_tgt.h @@ -1611,7 +1611,7 @@ int scst_register_dev_driver(struct scst_dev_type *dev_type); void scst_unregister_dev_driver(struct scst_dev_type *dev_type); /* - * Registers dev handler driver for virtual devices (eg FILEIO) + * Registers dev handler driver for virtual devices (eg VDISK) * Returns 0 on success or appropriate error code otherwise */ int scst_register_virtual_dev_driver(struct scst_dev_type *dev_type); diff --git a/scst/kernel/in-tree/Kconfig.scsi_tgt b/scst/kernel/in-tree/Kconfig.scsi_tgt index 2c8795b6f..72c28d47c 100644 --- a/scst/kernel/in-tree/Kconfig.scsi_tgt +++ b/scst/kernel/in-tree/Kconfig.scsi_tgt @@ -56,7 +56,7 @@ config SCSI_TARGET_RAID ---help--- SCSI TARGET handler for raid storage array controller (raid) device. -config SCSI_TARGET_FILEIO +config SCSI_TARGET_VDISK tristate "SCSI target virtual disk and/or cdrom support" default SCSI_TARGET depends on SCSI && PROC_FS && SCSI_TARGET diff --git a/scst/kernel/in-tree/Makefile.scsi_tgt b/scst/kernel/in-tree/Makefile.scsi_tgt index 965bea6a6..39e3ccbe7 100644 --- a/scst/kernel/in-tree/Makefile.scsi_tgt +++ b/scst/kernel/in-tree/Makefile.scsi_tgt @@ -15,4 +15,4 @@ obj-$(CONFIG_SCSI_TARGET_MODISK) += scst_modisk.o obj-$(CONFIG_SCSI_TARGET_CHANGER) += scst_changer.o obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o -obj-$(CONFIG_SCSI_TARGET_FILEIO) += scst_fileio.o +obj-$(CONFIG_SCSI_TARGET_VDISK ) += scst_vdisk.o diff --git a/scst/src/Makefile b/scst/src/Makefile index c5434ce11..82029e9b2 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -95,7 +95,7 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) #EXTRA_CFLAGS += -DSTRICT_SERIALIZING EXTRA_CFLAGS += -DEXTRACHECKS -#EXTRA_CFLAGS += -DFILEIO_ONLY +#EXTRA_CFLAGS += -DVDISK_ONLY #EXTRA_CFLAGS += -fno-inline diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index b528e2462..62a23bc72 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -30,7 +30,7 @@ ifneq ($(KERNELRELEASE),) SCST_INC_DIR := $(SUBDIRS)/../include obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ - scst_fileio.o scst_raid.o scst_processor.o + scst_vdisk.o scst_raid.o scst_processor.o obj-$(CONFIG_SCSI_TARGET_DISK) += scst_disk.o obj-$(CONFIG_SCSI_TARGET_TAPE) += scst_tape.o @@ -39,7 +39,7 @@ obj-$(CONFIG_SCSI_TARGET_MODISK) += scst_modisk.o obj-$(CONFIG_SCSI_TARGET_CHANGER) += scst_changer.o obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o -obj-$(CONFIG_SCSI_TARGET_FILEIO) += scst_fileio.o +obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o else ifeq ($(KDIR),) diff --git a/scst/src/dev_handlers/scst_fileio.c b/scst/src/dev_handlers/scst_vdisk.c similarity index 100% rename from scst/src/dev_handlers/scst_fileio.c rename to scst/src/dev_handlers/scst_vdisk.c diff --git a/scst/src/scst.c b/scst/src/scst.c index e996a7219..bf2894b3b 100644 --- a/scst/src/scst.c +++ b/scst/src/scst.c @@ -704,10 +704,10 @@ int scst_register_dev_driver(struct scst_dev_type *dev_type) if (res != 0) goto out_err; -#ifdef FILEIO_ONLY +#ifdef VDISK_ONLY if (dev_type->exec == NULL) { PRINT_ERROR_PR("Pass-through dev handlers (handler %s) not " - "supported. Recompile SCST with undefined FILEIO_ONLY", + "supported. Recompile SCST with undefined VDISK_ONLY", dev_type->name); res = -EINVAL; goto out_err; @@ -1410,7 +1410,7 @@ static void __exit exit_scst(void) } /* - * Device Handler Side (i.e. scst_fileio) + * Device Handler Side (i.e. scst_vdisk) */ EXPORT_SYMBOL(scst_register_dev_driver); EXPORT_SYMBOL(scst_unregister_dev_driver); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index a6b5b9a75..d0da96988 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -301,7 +301,7 @@ static inline void scst_do_req(struct scsi_request *sreq, { #ifdef STRICT_SERIALIZING scsi_do_req(sreq, cmnd, buffer, bufflen, done, timeout, retries); - #elif defined(FILEIO_ONLY) + #elif defined(VDISK_ONLY) sBUG(); #else scsi_do_req_fifo(sreq, cmnd, buffer, bufflen, done, timeout, retries); @@ -316,7 +316,7 @@ static inline int scst_exec_req(struct scsi_device *sdev, #ifdef STRICT_SERIALIZING return scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer, bufflen, use_sg, timeout, retries, privdata, done, gfp); - #elif defined(FILEIO_ONLY) + #elif defined(VDISK_ONLY) sBUG(); return -1; #else