From 72ca9f805593d69c054e18ef925a0a828df30f02 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 10 Nov 2015 03:29:11 +0000 Subject: [PATCH 01/32] Fixing race leading to lost external unblock requests git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6650 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 35 +++++++++++++++++++++++------------ scst/src/scst_priv.h | 6 ++++-- scst/src/scst_sysfs.c | 6 +++--- scst/src/scst_tg.c | 14 ++++---------- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 849bdadcf..e87c90b39 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7055,7 +7055,7 @@ void scst_stpg_del_unblock_next(struct scst_cmd *cmd) EXTRACHECKS_BUG_ON(!cmd->cmd_on_global_stpg_list); - TRACE_DBG("STPG cmd %p: unblocking next", cmd); + TRACE_DBG("STPG cmd %p done: unblocking next", cmd); list_del(&cmd->global_stpg_list_entry); cmd->cmd_on_global_stpg_list = 0; @@ -14171,15 +14171,15 @@ static void scst_sync_ext_blocking_done(struct scst_device *dev, return; } -int scst_ext_block_dev(struct scst_device *dev, bool sync, - ext_blocker_done_fn_t done_fn, const uint8_t *priv, int priv_len) +int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, + const uint8_t *priv, int priv_len, int flags) { int res; struct scst_ext_blocker *b; TRACE_ENTRY(); - if (sync) + if (flags & SCST_EXT_BLOCK_SYNC) priv_len = sizeof(void *); b = kzalloc(sizeof(*b) + priv_len, GFP_KERNEL); @@ -14190,8 +14190,8 @@ int scst_ext_block_dev(struct scst_device *dev, bool sync, goto out; } - TRACE_MGMT_DBG("New (%d) %s ext blocker %p for dev %s", dev->ext_blocks_cnt+1, - sync ? "sync" : "async", b, dev->virt_name); + TRACE_MGMT_DBG("New %d ext blocker %p for dev %s (flags %x)", + dev->ext_blocks_cnt+1, b, dev->virt_name, flags); spin_lock_bh(&dev->dev_lock); @@ -14207,10 +14207,15 @@ int scst_ext_block_dev(struct scst_device *dev, bool sync, } else scst_block_dev(dev); + if (flags & SCST_EXT_BLOCK_STPG) { + WARN_ON(dev->stpg_ext_blocked); + dev->stpg_ext_blocked = 1; + } + dev->ext_blocks_cnt++; TRACE_DBG("ext_blocks_cnt %d", dev->ext_blocks_cnt); - if (sync && (dev->on_dev_cmd_count == 0)) { + if ((flags & SCST_EXT_BLOCK_SYNC) && (dev->on_dev_cmd_count == 0)) { TRACE_DBG("No commands to wait for sync blocking (dev %s)", dev->virt_name); spin_unlock_bh(&dev->dev_lock); @@ -14220,7 +14225,7 @@ int scst_ext_block_dev(struct scst_device *dev, bool sync, list_add_tail(&b->ext_blockers_list_entry, &dev->ext_blockers_list); dev->ext_blocking_pending = 1; - if (sync) { + if (flags & SCST_EXT_BLOCK_SYNC) { DECLARE_WAIT_QUEUE_HEAD_ONSTACK(w); b->ext_blocker_done_fn = scst_sync_ext_blocking_done; @@ -14254,7 +14259,7 @@ out: return res; out_free_success: - sBUG_ON(!sync); + sBUG_ON(!(flags & SCST_EXT_BLOCK_SYNC)); kfree(b); goto out_success; } @@ -14271,8 +14276,14 @@ void scst_ext_unblock_dev(struct scst_device *dev, bool stpg) } if ((dev->ext_blocks_cnt == 1) && dev->stpg_ext_blocked && !stpg) { - TRACE_DBG("Can not unblock internal STPG ext block (dev %s)", - dev->virt_name); + /* + * User space is sending too many unblock calls during + * STPG processing + */ + TRACE_MGMT_DBG("Can not unblock internal STPG ext block " + "(dev %s, ext_blocks_cnt %d, stpg_ext_blocked %d, stpg %d)", + dev->virt_name, dev->ext_blocks_cnt, + dev->stpg_ext_blocked, stpg); goto out_unlock; } @@ -14287,7 +14298,7 @@ void scst_ext_unblock_dev(struct scst_device *dev, bool stpg) spin_unlock_bh(&dev->dev_lock); TRACE_DBG("Ext unblock (dev %s): still pending...", dev->virt_name); - rc = scst_ext_block_dev(dev, true, NULL, NULL, 0); + rc = scst_ext_block_dev(dev, NULL, NULL, 0, SCST_EXT_BLOCK_SYNC); if (rc != 0) { /* Oops, have to poll */ PRINT_WARNING("scst_ext_block_dev(dev %s) failed, " diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 0fe533b40..5d9234364 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -718,8 +718,10 @@ bool __scst_check_blocked_dev(struct scst_cmd *cmd); void __scst_check_unblock_dev(struct scst_cmd *cmd); void scst_check_unblock_dev(struct scst_cmd *cmd); -int scst_ext_block_dev(struct scst_device *dev, bool sync, - ext_blocker_done_fn_t done_fn, const uint8_t *priv, int priv_len); +#define SCST_EXT_BLOCK_SYNC 1 +#define SCST_EXT_BLOCK_STPG 2 +int scst_ext_block_dev(struct scst_device *dev, ext_blocker_done_fn_t done_fn, + const uint8_t *priv, int priv_len, int flags); void scst_ext_unblock_dev(struct scst_device *dev, bool stpg); void __scst_ext_blocking_done(struct scst_device *dev); void scst_ext_blocking_done(struct scst_device *dev); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 7e12e175f..9b7336dd8 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -3560,10 +3560,10 @@ static ssize_t scst_dev_block_store(struct kobject *kobj, "data_len %d)", dev->virt_name, sync, data_start, data_len); if (sync) - res = scst_ext_block_dev(dev, true, NULL, NULL, 0); + res = scst_ext_block_dev(dev, NULL, NULL, 0, SCST_EXT_BLOCK_SYNC); else - res = scst_ext_block_dev(dev, false, scst_sysfs_ext_blocking_done, - data_start, data_len); + res = scst_ext_block_dev(dev, scst_sysfs_ext_blocking_done, + data_start, data_len, 0); if (res != 0) goto out; diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index e9f818095..00f6b0d2e 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -1852,17 +1852,11 @@ int scst_tg_set_group_info(struct scst_cmd *cmd) atomic_inc(&wait->stpg_wait_left); - spin_lock_bh(&dev->dev_lock); - WARN_ON(dgd->dev->stpg_ext_blocked); - dgd->dev->stpg_ext_blocked = 1; - spin_unlock_bh(&dev->dev_lock); - - rc = scst_ext_block_dev(dgd->dev, false, - scst_stpg_ext_blocking_done, (uint8_t *)&wait, - sizeof(wait)); + rc = scst_ext_block_dev(dgd->dev, scst_stpg_ext_blocking_done, + (uint8_t *)&wait, sizeof(wait), SCST_EXT_BLOCK_STPG); if (rc != 0) { - TRACE_DBG("scst_ext_block_dev() returned %d, " - "stepping back (cmd %p)", rc, cmd); + TRACE_DBG("scst_ext_block_dev() failed " + "with %d, reverting (cmd %p)", rc, cmd); wait->status = rc; wait->dg = dg; atomic_dec(&wait->stpg_wait_left); From 3325903ee7e0ef9e424cdefdb33a6310c9a14a40 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 10 Nov 2015 03:58:45 +0000 Subject: [PATCH 02/32] HOWTO update from Willem Boterenbrood git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6651 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/doc/SCST_Gentoo_HOWTO.txt | 55 ++++++++++++++++------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/iscsi-scst/doc/SCST_Gentoo_HOWTO.txt b/iscsi-scst/doc/SCST_Gentoo_HOWTO.txt index a2549013a..cca3aa443 100644 --- a/iscsi-scst/doc/SCST_Gentoo_HOWTO.txt +++ b/iscsi-scst/doc/SCST_Gentoo_HOWTO.txt @@ -1,5 +1,5 @@ ============================================== -SCST 2.x Installation on Gentoo Linux +SCST 3.x Installation on Gentoo Linux ============================================== This howto will get you a working SCST installation on Gentoo Linux, it @@ -15,12 +15,11 @@ Prerequisites: - User with root privileges - Read the official iSCSI-SCST howto for more options and information -Assumptions for this howto: +Assumptions for the examples used in this howto: - User logged on as root -- Gentoo Sources version 2.6.39-r3 installed - Manual build kernel without initramfs - Gentoo AMD64 version -- Grub bootloader +- Grub 1 bootloader (use of GRUB2 should be an easy change) - /boot on a separate partition - One iSCSI target with 2 LUNS, both LUNS virtual disk files - One iSCSI target with one LUN, LUN is a real device @@ -29,17 +28,32 @@ When the above options differ from your environment/setup you will need to change some of the commands provided in this howto for things to work. +1. Download SCST. -1. Download the latest SCST version. +Choose to download a specific branch or the latest development version +a) Latest development version cd /root - svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst + svn checkout svn://svn.code.sf.net/p/scst/svn/trunk scst +b) Specific branch (3.0 used in example) + cd /root + svn checkout svn://svn.code.sf.net/p/scst/svn/branches/3.0.x scst + 2. Patch the kernel (Optional but required for the best speed) - cd /usr/src/linux-2.6.39-gentoo-r3 - patch -p1 < /root/scst/iscsi-scst/kernel/patches/put_page_callback-2.6.39.patch +If the SCST version downloaded above does not have the patches for the correct kernel +you can try the newest patches available, note the errors (if any) during the patch +and fix those manually by looking at the sourcefile.rej files generated by the patch +that list the failed changes. Use vi or nano to find and change the correct places for +the patch changes. (I had to change 2 lines in one source file and add 2 in another +when patching a 4.1.12 kernel with 3.18 patch files, so the majority of changes did +work perfectly) + + cd /usr/src/linux + patch -p1 < /root/scst/iscsi-scst/kernel/patches/put_page_callback-3.18.patch + patch -p1 < /root/scst/scst/kernel/scst_exec_req_fifo-3.18.patch make clean @@ -49,6 +63,9 @@ work. Select Networking support -> Networking options -> TCP/IP networking Select Networking support -> Networking options -> TCP/IP zero-copy transfer completion notification Select Device Drivers -> SCSI device support -> SCSI disk support + Select Device Drivers -> InfiniBand support + Select Device Drivers -> InfiniBand support -> InfiniBand SCSI RDMA Protocol + Select Device Drivers -> InfiniBand support -> iSCSI Extension for RDMA (iSER) Select Enable the block layer -> IO Schedulers -> CFQ I/O Scheduler Set Enable the Block layer -> IO Schedulers -> Default I/O Scheduler to 'CFQ' Set Processor type and features -> Preemption Model to 'No Forced Preemption (Server)' @@ -60,8 +77,8 @@ work. 4. Install the new kernel and reboot the system mount /boot - cp arch/x86_64/boot/bzImage /boot/kernel-2.6.39-gentoo-r3-SCST - nano -w /boot/grub/grub.conf (add a new boot entry with the newly compiled kernel) + cp arch/x86_64/boot/bzImage /boot/kernel-4.1.12-gentoo-SCST + nano -w /boot/grub/grub.conf (GRUB1: add a new boot entry with the newly compiled kernel) umount /boot shutdown -r now @@ -113,23 +130,13 @@ to all ip's 8. Run SCST automatically at startup -For SCST 2.1 SVN version r3805 and newer do: rc-update add scst default -For SCST 2.0 and for a SVN version before r3805 and Gentoo with the old baselayout without OpenRC do: - rc-update add scst default -For SCST 2.0 and for a SVN version before r3805 and you have the new Gentoo baselayout do: - echo "/etc/init.d/scst start" >> /etc/local.d/scst.start - echo "/etc/init.d/scst stop" >> /etc/local.d/scst.stop - chmod 775 /etc/local.d/scst.* -(the SCST init script doesn't work with openRC and changing it would be a lot of work so local.d is used as an easy workaround) - - -9. Using SCST access control (optional) +9. Using SCST accesscontrol (optional) SCST listens on all the targets IP addresses and allows access to any -initiators per default. There are a couple of ways to restict access and +initiators per default. There are a couple of ways to restrict access and here I will give some examples. For the full documentation see the README file in the scst/iscsi-scst/ directory @@ -137,7 +144,7 @@ To make a target accessible on only one IP address do: scstadmin -set_tgt_attr iqn.2011-08.nl.feka:storage.vdisk1 -driver iscsi -attributes allowed_portal=192.168.100.15 (Remember the IP address is the address of the target machine, not of the allowed initiator, you can add multiple entries on the same target - by repeating the above command, you can also use the wildcards * and ? + by repeating the above command, you can also use the wild cards * and ? where the ? stands for any single digit) To make targets only accessible by specific inititators add a group to @@ -162,7 +169,7 @@ Notes ============================================== SCST's vdisk_fileio handler will use a default blocksize of 512b, this -is the only safe option for vmware ESXi or older windows versions, for +is the only safe option for VMware ESXi or older windows versions, for best performance with newer windows versions a blocksize of 4096 will be much faster. From 1a23466c69177204e38f0d710bca41965dee67b3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 06:06:08 +0000 Subject: [PATCH 03/32] qla2x00t: Follow-up for r6635 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6652 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_nx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qla2x00t/qla_nx.c b/qla2x00t/qla_nx.c index 6978785de..db309bd6a 100644 --- a/qla2x00t/qla_nx.c +++ b/qla2x00t/qla_nx.c @@ -1222,7 +1222,11 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x0072, "%d CRB init values found in ROM.\n", n); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) buf = kmalloc_array(n, sizeof(struct crb_addr_pair), GFP_KERNEL); +#else + buf = kmalloc(n * sizeof(struct crb_addr_pair), GFP_KERNEL); +#endif if (buf == NULL) { ql_log(ql_log_fatal, vha, 0x010c, "Unable to allocate memory.\n"); From 9c130c6e14be8da248670e629e9a020e5cb25110 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 15:32:52 +0000 Subject: [PATCH 04/32] backport.h: Fix build on 3.2.x kernels for versions >= 3.2.52 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6653 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index f349bb80a..790bb3e1d 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -427,7 +427,9 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, (__flags), NULL, NULL) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) && \ + !(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 52) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)) static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) { if (size != 0 && n > ULONG_MAX / size) From d434ae4ff66f75356b13f64ba9cc2c364823fc6d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 15:49:56 +0000 Subject: [PATCH 05/32] backport.h: Fix build against 2.6.38 and RHEL 6 kernels git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6654 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 790bb3e1d..8b767c7a3 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -255,7 +255,9 @@ static inline void hex2bin(u8 *dst, const char *src, size_t count) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) && \ + LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 38) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) static inline int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res) { From be7c3b3ee8ec8f16d1b9bfb972de0b241d097e13 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 16:03:16 +0000 Subject: [PATCH 06/32] backport.h: A second build fix for RHEL 6 kernels git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6655 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 8b767c7a3..b3aa8f8ae 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -429,9 +429,10 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, (__flags), NULL, NULL) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) && \ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) && \ !(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 52) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)) + LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6) static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) { if (size != 0 && n > ULONG_MAX / size) From cd6b27dba4e614fedb723e0d5797a753ef69df6f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 19:17:20 +0000 Subject: [PATCH 07/32] scst_dlm: Introduce a new local variable This patch does not change any functionality. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6656 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_dlm.c | 56 +++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 3ba9f60c4..e8295100b 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -1320,47 +1320,49 @@ create_st_wq(const char *fmt, ...) */ static int scst_pr_dlm_init(struct scst_device *dev, const char *cl_dev_id) { + struct scst_pr_dlm_data *pr_dlm; int res = -ENOMEM; compile_time_size_checks(); - dev->pr_dlm = kzalloc(sizeof(*dev->pr_dlm), GFP_KERNEL); - if (!dev->pr_dlm) + pr_dlm = kzalloc(sizeof(*dev->pr_dlm), GFP_KERNEL); + if (!pr_dlm) goto out; - dev->pr_dlm->dev = dev; - mutex_init(&dev->pr_dlm->ls_cr_mutex); - mutex_init(&dev->pr_dlm->ls_mutex); - dev->pr_dlm->data_lksb.lksb.sb_lvbptr = dev->pr_dlm->lvb; - INIT_WORK(&dev->pr_dlm->pre_join_work, scst_pre_join_work); - INIT_WORK(&dev->pr_dlm->pre_upd_work, scst_pre_upd_work); - INIT_WORK(&dev->pr_dlm->copy_from_dlm_work, scst_copy_from_dlm_work); - INIT_WORK(&dev->pr_dlm->copy_to_dlm_work, scst_copy_to_dlm_work); - INIT_WORK(&dev->pr_dlm->lvb_upd_work, scst_lvb_upd_work); - INIT_WORK(&dev->pr_dlm->reread_lvb_work, scst_reread_lvb_work); - dev->pr_dlm->latest_lscr_attempt = jiffies - 100 * HZ; + dev->pr_dlm = pr_dlm; + pr_dlm->dev = dev; + mutex_init(&pr_dlm->ls_cr_mutex); + mutex_init(&pr_dlm->ls_mutex); + pr_dlm->data_lksb.lksb.sb_lvbptr = pr_dlm->lvb; + INIT_WORK(&pr_dlm->pre_join_work, scst_pre_join_work); + INIT_WORK(&pr_dlm->pre_upd_work, scst_pre_upd_work); + INIT_WORK(&pr_dlm->copy_from_dlm_work, scst_copy_from_dlm_work); + INIT_WORK(&pr_dlm->copy_to_dlm_work, scst_copy_to_dlm_work); + INIT_WORK(&pr_dlm->lvb_upd_work, scst_lvb_upd_work); + INIT_WORK(&pr_dlm->reread_lvb_work, scst_reread_lvb_work); + pr_dlm->latest_lscr_attempt = jiffies - 100 * HZ; res = -ENOMEM; - dev->pr_dlm->cl_dev_id = kstrdup(cl_dev_id, GFP_KERNEL); - if (!dev->pr_dlm->cl_dev_id) + pr_dlm->cl_dev_id = kstrdup(cl_dev_id, GFP_KERNEL); + if (!pr_dlm->cl_dev_id) goto err_free; - dev->pr_dlm->from_wq = create_st_wq("%s_from_dlm", dev->virt_name); - if (IS_ERR(dev->pr_dlm->from_wq)) { - res = PTR_ERR(dev->pr_dlm->from_wq); - dev->pr_dlm->from_wq = NULL; + pr_dlm->from_wq = create_st_wq("%s_from_dlm", dev->virt_name); + if (IS_ERR(pr_dlm->from_wq)) { + res = PTR_ERR(pr_dlm->from_wq); + pr_dlm->from_wq = NULL; goto err_free; } - dev->pr_dlm->to_wq = create_st_wq("%s_to_dlm", dev->virt_name); - if (IS_ERR(dev->pr_dlm->to_wq)) { - res = PTR_ERR(dev->pr_dlm->to_wq); - dev->pr_dlm->to_wq = NULL; + pr_dlm->to_wq = create_st_wq("%s_to_dlm", dev->virt_name); + if (IS_ERR(pr_dlm->to_wq)) { + res = PTR_ERR(pr_dlm->to_wq); + pr_dlm->to_wq = NULL; goto err_free; } - dev->pr_dlm->upd_wq = create_st_wq("%s_upd_dlm", dev->virt_name); - if (IS_ERR(dev->pr_dlm->upd_wq)) { - res = PTR_ERR(dev->pr_dlm->upd_wq); - dev->pr_dlm->upd_wq = NULL; + pr_dlm->upd_wq = create_st_wq("%s_upd_dlm", dev->virt_name); + if (IS_ERR(pr_dlm->upd_wq)) { + res = PTR_ERR(pr_dlm->upd_wq); + pr_dlm->upd_wq = NULL; goto err_free; } From 0234aa8f991b5ed8a9aa9b9c3bf39ff3ca5615c4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 19:17:51 +0000 Subject: [PATCH 08/32] qla2x00t: Remove a delayed_work function pointer cast git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6657 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x_tgt.h | 2 +- qla2x00t/qla_os.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qla2x00t/qla2x_tgt.h b/qla2x00t/qla2x_tgt.h index 99956b747..3ceb76b6c 100644 --- a/qla2x00t/qla2x_tgt.h +++ b/qla2x00t/qla2x_tgt.h @@ -140,7 +140,7 @@ extern size_t qla2xxx_del_vtarget(u64 port_name); #endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \ defined(FC_VPORT_CREATE_DEFINED))*/ -extern void qla_unknown_atio_work_fn(struct delayed_work *work); +extern void qla_unknown_atio_work_fn(struct work_struct *work); #else /* CONFIG_SCSI_QLA2XXX_TARGET */ diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index e5434f236..bbaad3885 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -2386,10 +2386,10 @@ EXPORT_SYMBOL(qla2xxx_del_vtarget); #endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \ defined(FC_VPORT_CREATE_DEFINED))*/ -void qla_unknown_atio_work_fn(struct delayed_work *work) +void qla_unknown_atio_work_fn(struct work_struct *work) { struct qla_hw_data *ha = container_of(work, struct qla_hw_data, - unknown_atio_work); + unknown_atio_work.work); qla_target.tgt_try_to_dequeue_unknown_atios(ha); return; } @@ -2661,8 +2661,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) mutex_init(&base_vha->tgt_mutex); mutex_init(&base_vha->tgt_host_action_mutex); INIT_LIST_HEAD(&ha->unknown_atio_list); - INIT_DELAYED_WORK(&ha->unknown_atio_work, - (void (*)(struct work_struct *))qla_unknown_atio_work_fn); + INIT_DELAYED_WORK(&ha->unknown_atio_work, qla_unknown_atio_work_fn); qla_clear_tgt_mode(base_vha); #endif /* CONFIG_SCSI_QLA2XXX_TARGET */ From b600a0655097dda5d74d55fb467c3b0794db835f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 19:18:15 +0000 Subject: [PATCH 09/32] scst: Remove delayed_work function pointer casts git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6658 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 11 +++++------ scst/src/scst_event.c | 6 +++--- scst/src/scst_lib.c | 2 +- scst/src/scst_priv.h | 2 +- scst/src/scst_tg.c | 9 +++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 8b0ffb2f3..f0fb9b5cc 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -183,10 +183,10 @@ struct scst_cm_retry { scst_cm_retry_fn_t cm_retry_fn; }; -static void scst_cm_retry_work_fn(struct delayed_work *work) +static void scst_cm_retry_work_fn(struct work_struct *work) { struct scst_cm_retry *retry = container_of(work, struct scst_cm_retry, - cm_retry_work); + cm_retry_work.work); TRACE_ENTRY(); @@ -295,8 +295,7 @@ try_retry: } retry->cm_retry_cmd = cmd; __scst_cmd_get(cmd); - INIT_DELAYED_WORK(&retry->cm_retry_work, - (void (*)(struct work_struct *))scst_cm_retry_work_fn); + INIT_DELAYED_WORK(&retry->cm_retry_work, scst_cm_retry_work_fn); retry->cm_retry_fn = retry_fn; if (imm_retry) { @@ -1981,10 +1980,10 @@ out_unlock_free: goto out; } -void sess_cm_list_id_cleanup_work_fn(struct delayed_work *work) +void sess_cm_list_id_cleanup_work_fn(struct work_struct *work) { struct scst_session *sess = container_of(work, - struct scst_session, sess_cm_list_id_cleanup_work); + struct scst_session, sess_cm_list_id_cleanup_work.work); struct scst_cm_list_id *l, *t; unsigned long cur_time = jiffies; unsigned long flags; diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 368f726c5..94a57d77e 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -88,10 +88,10 @@ out: return res; } -static void scst_event_timeout_fn(struct delayed_work *work) +static void scst_event_timeout_fn(struct work_struct *work) { struct scst_event_entry *event_entry = container_of(work, - struct scst_event_entry, event_timeout_work); + struct scst_event_entry, event_timeout_work.work); TRACE_ENTRY(); @@ -199,7 +199,7 @@ static void __scst_event_queue(struct scst_event_entry *event_entry) } INIT_DELAYED_WORK(&new_event_entry->event_timeout_work, - (void (*)(struct work_struct *))scst_event_timeout_fn); + scst_event_timeout_fn); if (new_event_entry->event_notify_fn != NULL) { new_event_entry->event.event_id = atomic_inc_return(&base_event_id); if (new_event_entry->event_timeout == 0) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e87c90b39..6666f8907 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6715,7 +6715,7 @@ struct scst_session *scst_alloc_session(struct scst_tgt *tgt, gfp_t gfp_mask, INIT_LIST_HEAD(&sess->init_deferred_mcmd_list); INIT_LIST_HEAD(&sess->sess_cm_list_id_list); INIT_DELAYED_WORK(&sess->sess_cm_list_id_cleanup_work, - (void (*)(struct work_struct *))sess_cm_list_id_cleanup_work_fn); + sess_cm_list_id_cleanup_work_fn); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) INIT_DELAYED_WORK(&sess->hw_pending_work, scst_hw_pending_work_fn); #else diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 5d9234364..880a5a8cc 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -858,7 +858,7 @@ void scst_cm_free_descriptors(struct scst_cmd *cmd); int scst_cm_ext_copy_exec(struct scst_cmd *cmd); int scst_cm_rcv_copy_res_exec(struct scst_cmd *cmd); -void sess_cm_list_id_cleanup_work_fn(struct delayed_work *work); +void sess_cm_list_id_cleanup_work_fn(struct work_struct *work); void scst_cm_free_pending_list_ids(struct scst_session *sess); bool scst_cm_check_block_all_devs(struct scst_cmd *cmd); diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index 00f6b0d2e..fa92ed48c 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -400,10 +400,11 @@ struct scst_alua_retry { struct delayed_work alua_retry_work; }; -static void scst_alua_transitioning_work_fn(struct delayed_work *work) +static void scst_alua_transitioning_work_fn(struct work_struct *work) { - struct scst_alua_retry *retry = container_of(work, struct scst_alua_retry, - alua_retry_work); + struct scst_alua_retry *retry = + container_of(work, struct scst_alua_retry, + alua_retry_work.work); struct scst_cmd *cmd = retry->alua_retry_cmd; TRACE_ENTRY(); @@ -469,7 +470,7 @@ static int scst_tg_accept_transitioning(struct scst_cmd *cmd) /* No get is needed, because cmd is sync here */ retry->alua_retry_cmd = cmd; INIT_DELAYED_WORK(&retry->alua_retry_work, - (void (*)(struct work_struct *))scst_alua_transitioning_work_fn); + scst_alua_transitioning_work_fn); cmd->already_transitioning = 1; schedule_delayed_work(&retry->alua_retry_work, HZ/2); res = SCST_ALUA_CHECK_DELAYED; From 9b65d8b8098cc54848c35edff2771656dbacea35 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 19:18:39 +0000 Subject: [PATCH 10/32] scst: RHEL 5 build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6659 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 19 +++++++++++++++++ scst/include/scst.h | 4 ++++ scst/include/scst_event.h | 4 ++++ scst/src/scst_copy_mgr.c | 10 +++++++++ scst/src/scst_dlm.c | 45 +++++++++++++++++++++++++++++++++++++++ scst/src/scst_event.c | 36 +++++++++++++++++++++++++++++++ scst/src/scst_lib.c | 34 +++++++++++++++++++++++++++-- scst/src/scst_priv.h | 9 +++++++- scst/src/scst_tg.c | 15 +++++++++++++ 9 files changed, 173 insertions(+), 3 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index b3aa8f8ae..8bb4f4bfb 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -187,6 +187,15 @@ static inline bool cpumask_equal(const cpumask_t *src1p, } #endif +/* */ + +/* See also commit 0f8e0d9a317406612700426fad3efab0b7bbc467 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) +enum { + DLM_LSFL_NEWEXCL = 0 +}; +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) && \ @@ -283,6 +292,16 @@ static inline int __must_check kstrtol(const char *s, unsigned int base, } #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) +enum umh_wait { + UMH_NO_WAIT = -1, /* don't wait at all */ + UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */ + UMH_WAIT_PROC = 1, /* wait for the process to complete */ +}; +#endif + /* */ #ifndef __list_for_each diff --git a/scst/include/scst.h b/scst/include/scst.h index b4168b601..de2d36ce3 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -1971,7 +1971,11 @@ struct scst_session { */ struct list_head sess_cm_list_id_list; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + struct work_struct sess_cm_list_id_cleanup_work; +#else struct delayed_work sess_cm_list_id_cleanup_work; +#endif /* sysfs release completion */ struct completion *sess_kobj_release_cmpl; diff --git a/scst/include/scst_event.h b/scst/include/scst_event.h index 9d7750e8b..a8c24269b 100644 --- a/scst/include/scst_event.h +++ b/scst/include/scst_event.h @@ -63,7 +63,11 @@ struct scst_event_entry { int *pqueued_events_cnt; union { struct work_struct scst_event_queue_work; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + struct work_struct event_timeout_work; +#else struct delayed_work event_timeout_work; +#endif }; struct scst_event event; diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index f0fb9b5cc..94ef5af4b 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -179,7 +179,11 @@ typedef void (*scst_cm_retry_fn_t)(struct scst_cmd *cmd); struct scst_cm_retry { struct scst_cmd *cm_retry_cmd; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + struct work_struct cm_retry_work; +#else struct delayed_work cm_retry_work; +#endif scst_cm_retry_fn_t cm_retry_fn; }; @@ -1980,10 +1984,16 @@ out_unlock_free: goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +void sess_cm_list_id_cleanup_work_fn(void *p) +{ + struct scst_session *sess = p; +#else void sess_cm_list_id_cleanup_work_fn(struct work_struct *work) { struct scst_session *sess = container_of(work, struct scst_session, sess_cm_list_id_cleanup_work.work); +#endif struct scst_cm_list_id *l, *t; unsigned long cur_time = jiffies; unsigned long flags; diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index e8295100b..39792b897 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -1077,10 +1077,16 @@ static void scst_dlm_pre_bast(void *bastarg, int mode) queue_work(pr_dlm->from_wq, &pr_dlm->pre_upd_work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_pre_join_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_pre_join_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, pre_join_work); +#endif dlm_lockspace_t *ls; mutex_lock(&pr_dlm->ls_mutex); @@ -1094,10 +1100,16 @@ static void scst_pre_join_work(struct work_struct *work) mutex_unlock(&pr_dlm->ls_mutex); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_pre_upd_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_pre_upd_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, pre_upd_work); +#endif dlm_lockspace_t *ls; mutex_lock(&pr_dlm->ls_mutex); @@ -1128,10 +1140,16 @@ static void scst_dlm_post_bast(void *bastarg, int mode) * Note: the node that has invoked scst_trigger_lvb_update() holds PR_LOCK * in EX mode and waits until this function has finished. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_copy_to_dlm_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_copy_to_dlm_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, copy_to_dlm_work); +#endif struct scst_device *dev = pr_dlm->dev; dlm_lockspace_t *ls; int res; @@ -1195,10 +1213,16 @@ unlock_ls: * scst_pr_init_tgt_dev() and scst_pr_clear_tgt_dev() in scst_pres.c protect * these manipulations by locking the PR data structures for writing. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_copy_from_dlm_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_copy_from_dlm_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, copy_from_dlm_work); +#endif struct scst_device *dev = pr_dlm->dev; dlm_lockspace_t *ls; int res = -ENOENT; @@ -1250,10 +1274,16 @@ static void scst_dlm_post_ast(void *astarg) } /* Tell other nodes to refresh their local state from the lock value blocks. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_reread_lvb_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_reread_lvb_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, reread_lvb_work); +#endif dlm_lockspace_t *ls; struct scst_lksb pr_lksb; int res; @@ -1275,10 +1305,16 @@ unlock_ls: } /* Tell other nodes to update the DLM lock value blocks. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_lvb_upd_work(void *p) +{ + struct scst_pr_dlm_data *pr_dlm = p; +#else static void scst_lvb_upd_work(struct work_struct *work) { struct scst_pr_dlm_data *pr_dlm = container_of(work, struct scst_pr_dlm_data, lvb_upd_work); +#endif dlm_lockspace_t *ls; struct scst_lksb lksb; int res; @@ -1332,12 +1368,21 @@ static int scst_pr_dlm_init(struct scst_device *dev, const char *cl_dev_id) mutex_init(&pr_dlm->ls_cr_mutex); mutex_init(&pr_dlm->ls_mutex); pr_dlm->data_lksb.lksb.sb_lvbptr = pr_dlm->lvb; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&pr_dlm->pre_join_work, scst_pre_join_work, pr_dlm); + INIT_WORK(&pr_dlm->pre_upd_work, scst_pre_upd_work, pr_dlm); + INIT_WORK(&pr_dlm->copy_from_dlm_work, scst_copy_from_dlm_work, pr_dlm); + INIT_WORK(&pr_dlm->copy_to_dlm_work, scst_copy_to_dlm_work, pr_dlm); + INIT_WORK(&pr_dlm->lvb_upd_work, scst_lvb_upd_work, pr_dlm); + INIT_WORK(&pr_dlm->reread_lvb_work, scst_reread_lvb_work, pr_dlm); +#else INIT_WORK(&pr_dlm->pre_join_work, scst_pre_join_work); INIT_WORK(&pr_dlm->pre_upd_work, scst_pre_upd_work); INIT_WORK(&pr_dlm->copy_from_dlm_work, scst_copy_from_dlm_work); INIT_WORK(&pr_dlm->copy_to_dlm_work, scst_copy_to_dlm_work); INIT_WORK(&pr_dlm->lvb_upd_work, scst_lvb_upd_work); INIT_WORK(&pr_dlm->reread_lvb_work, scst_reread_lvb_work); +#endif pr_dlm->latest_lscr_attempt = jiffies - 100 * HZ; res = -ENOMEM; diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 94a57d77e..3b36b8e50 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -88,10 +88,16 @@ out: return res; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_event_timeout_fn(void *p) +{ + struct scst_event_entry *event_entry = p; +#else static void scst_event_timeout_fn(struct work_struct *work) { struct scst_event_entry *event_entry = container_of(work, struct scst_event_entry, event_timeout_work.work); +#endif TRACE_ENTRY(); @@ -198,8 +204,14 @@ static void __scst_event_queue(struct scst_event_entry *event_entry) break; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&new_event_entry->event_timeout_work, + scst_event_timeout_fn, + new_event_entry); +#else INIT_DELAYED_WORK(&new_event_entry->event_timeout_work, scst_event_timeout_fn); +#endif if (new_event_entry->event_notify_fn != NULL) { new_event_entry->event.event_id = atomic_inc_return(&base_event_id); if (new_event_entry->event_timeout == 0) @@ -245,10 +257,16 @@ done: return; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_event_queue_work_fn(void *p) +{ + struct scst_event_entry *e = p; +#else static void scst_event_queue_work_fn(struct work_struct *work) { struct scst_event_entry *e = container_of(work, struct scst_event_entry, scst_event_queue_work); +#endif TRACE_ENTRY(); @@ -264,7 +282,11 @@ void scst_event_queue(uint32_t event_code, const char *issuer_name, { TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&e->scst_event_queue_work, scst_event_queue_work_fn, e); +#else INIT_WORK(&e->scst_event_queue_work, scst_event_queue_work_fn); +#endif TRACE_DBG("Scheduling event entry %p", e); @@ -1042,7 +1064,11 @@ static const struct file_operations scst_event_fops = { int scst_event_init(void) { int res = 0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) + struct class_device *class_member; +#else struct device *dev; +#endif TRACE_ENTRY(); @@ -1060,6 +1086,15 @@ int scst_event_init(void) goto out_class; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) + class_member = class_device_create(scst_event_sysfs_class, NULL, + MKDEV(scst_event_major, 0), NULL, + SCST_EVENT_NAME); + if (IS_ERR(class_member)) { + res = PTR_ERR(class_member); + goto out_chrdev; + } +#else dev = device_create(scst_event_sysfs_class, NULL, MKDEV(scst_event_major, 0), NULL, @@ -1068,6 +1103,7 @@ int scst_event_init(void) res = PTR_ERR(dev); goto out_chrdev; } +#endif #ifdef CONFIG_EVENTS_WAIT_TEST sysfs_create_file(kernel_kobj, &event_wait_test_attr.attr); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 6666f8907..943b5c1b8 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -74,7 +74,11 @@ static DEFINE_SPINLOCK(scst_global_stpg_list_lock); static LIST_HEAD(scst_global_stpg_list); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_put_acg_work(void *p); +#else static void scst_put_acg_work(struct work_struct *work); +#endif static void scst_del_acn(struct scst_acn *acn); static void scst_free_acn(struct scst_acn *acn, bool reassign); @@ -4119,7 +4123,11 @@ static void scst_init_order_data(struct scst_order_data *order_data) return; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_ext_blocking_done_fn(void *p); +#else static void scst_ext_blocking_done_fn(struct work_struct *work); +#endif static int scst_dif_none(struct scst_cmd *cmd); #ifdef CONFIG_SCST_DIF_INJECT_CORRUPTED_TAGS @@ -4154,7 +4162,11 @@ int scst_alloc_device(gfp_t gfp_mask, struct scst_device **out_dev) INIT_LIST_HEAD(&dev->dev_tgt_dev_list); INIT_LIST_HEAD(&dev->dev_acg_dev_list); INIT_LIST_HEAD(&dev->ext_blockers_list); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&dev->ext_blockers_work, scst_ext_blocking_done_fn, dev); +#else INIT_WORK(&dev->ext_blockers_work, scst_ext_blocking_done_fn); +#endif dev->dev_double_ua_possible = 1; dev->queue_alg = SCST_QUEUE_ALG_1_UNRESTRICTED_REORDER; @@ -4633,13 +4645,19 @@ struct scst_acg_put_work { struct scst_acg *acg; }; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_put_acg_work(void *p) +{ + struct scst_acg_put_work *put_work = p; +#else static void scst_put_acg_work(struct work_struct *work) { struct scst_acg_put_work *put_work = container_of(work, typeof(*put_work), work); +#endif struct scst_acg *acg = put_work->acg; - kfree(work); + kfree(put_work); kref_put(&acg->acg_kref, scst_release_acg); } @@ -4653,7 +4671,11 @@ void scst_put_acg(struct scst_acg *acg) return; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&put_work->work, scst_put_acg_work, put_work); +#else INIT_WORK(&put_work->work, scst_put_acg_work); +#endif put_work->acg = acg; /* @@ -6714,11 +6736,13 @@ struct scst_session *scst_alloc_session(struct scst_tgt *tgt, gfp_t gfp_mask, INIT_LIST_HEAD(&sess->init_deferred_cmd_list); INIT_LIST_HEAD(&sess->init_deferred_mcmd_list); INIT_LIST_HEAD(&sess->sess_cm_list_id_list); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) INIT_DELAYED_WORK(&sess->sess_cm_list_id_cleanup_work, sess_cm_list_id_cleanup_work_fn); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) INIT_DELAYED_WORK(&sess->hw_pending_work, scst_hw_pending_work_fn); #else + INIT_WORK(&sess->sess_cm_list_id_cleanup_work, + sess_cm_list_id_cleanup_work_fn, sess); INIT_WORK(&sess->hw_pending_work, scst_hw_pending_work_fn, sess); #endif @@ -14113,10 +14137,16 @@ void __scst_ext_blocking_done(struct scst_device *dev) return; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_ext_blocking_done_fn(void *p) +{ + struct scst_device *dev = p; +#else static void scst_ext_blocking_done_fn(struct work_struct *work) { struct scst_device *dev = container_of(work, struct scst_device, ext_blockers_work); +#endif TRACE_ENTRY(); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 880a5a8cc..327504f35 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -406,7 +406,10 @@ static inline int scst_dlm_new_lockspace(const char *name, int namelen, uint32_t flags, int lvblen) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) + return dlm_new_lockspace((char *)name, namelen, lockspace, flags, + lvblen); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) return dlm_new_lockspace(name, namelen, lockspace, flags, lvblen); #else return dlm_new_lockspace(name, NULL, flags, lvblen, NULL, NULL, NULL, @@ -858,7 +861,11 @@ void scst_cm_free_descriptors(struct scst_cmd *cmd); int scst_cm_ext_copy_exec(struct scst_cmd *cmd); int scst_cm_rcv_copy_res_exec(struct scst_cmd *cmd); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +void sess_cm_list_id_cleanup_work_fn(void *p); +#else void sess_cm_list_id_cleanup_work_fn(struct work_struct *work); +#endif void scst_cm_free_pending_list_ids(struct scst_session *sess); bool scst_cm_check_block_all_devs(struct scst_cmd *cmd); diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index fa92ed48c..4029fcefb 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -397,14 +397,24 @@ out: struct scst_alua_retry { struct scst_cmd *alua_retry_cmd; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + struct work_struct alua_retry_work; +#else struct delayed_work alua_retry_work; +#endif }; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void scst_alua_transitioning_work_fn(void *p) +{ + struct scst_alua_retry *retry = p; +#else static void scst_alua_transitioning_work_fn(struct work_struct *work) { struct scst_alua_retry *retry = container_of(work, struct scst_alua_retry, alua_retry_work.work); +#endif struct scst_cmd *cmd = retry->alua_retry_cmd; TRACE_ENTRY(); @@ -469,8 +479,13 @@ static int scst_tg_accept_transitioning(struct scst_cmd *cmd) /* No get is needed, because cmd is sync here */ retry->alua_retry_cmd = cmd; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + INIT_WORK(&retry->alua_retry_work, + scst_alua_transitioning_work_fn, retry); +#else INIT_DELAYED_WORK(&retry->alua_retry_work, scst_alua_transitioning_work_fn); +#endif cmd->already_transitioning = 1; schedule_delayed_work(&retry->alua_retry_work, HZ/2); res = SCST_ALUA_CHECK_DELAYED; From 36a48008e9b84fbca926380e4f25735da7088ea8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Nov 2015 23:32:23 +0000 Subject: [PATCH 11/32] scst_user, fileio: Fix 2perf build See also trunk r6579. Reported-by: Alexey Mochkin git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6660 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- usr/fileio/fileio.c | 3 ++- usr/include/debug.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/fileio/fileio.c b/usr/fileio/fileio.c index ec19a1980..fbbedbb7c 100644 --- a/usr/fileio/fileio.c +++ b/usr/fileio/fileio.c @@ -65,10 +65,11 @@ char *app_name; # endif #endif /* DEBUG */ -bool log_daemon = false; unsigned long trace_flag = DEFAULT_LOG_FLAGS; #endif /* defined(DEBUG) || defined(TRACING) */ +bool log_daemon = false; + #define DEF_BLOCK_SHIFT 9 #define THREADS 7 diff --git a/usr/include/debug.h b/usr/include/debug.h index bba07f5ef..9bdaddc0d 100644 --- a/usr/include/debug.h +++ b/usr/include/debug.h @@ -82,9 +82,10 @@ extern char *app_name; #define __LOG_PREFIX NULL #endif +extern bool log_daemon; + #if defined(DEBUG) || defined(TRACING) -extern bool log_daemon; extern unsigned long trace_flag; extern int debug_init(void); From 16045ac1bd2eed34d6b1594ec8e1827e9e35e545 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 00:48:11 +0000 Subject: [PATCH 12/32] nightly build: Update kernel versions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6661 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- nightly/conf/nightly.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index bdee4697d..6b79841c8 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -4,19 +4,19 @@ ABT_DETAILS="x86_64" ABT_JOBS=5 ABT_KERNELS=" \ 4.3 \ -4.2.5-nc \ -4.1.12-nc \ +4.2.6-nc \ +4.1.13-nc \ 4.0.9-nc \ 3.19.7-nc \ 3.18.19-nc \ 3.17.8-nc \ 3.16.7-nc \ 3.15.10-nc \ -3.14.56-nc \ +3.14.57-nc \ 3.13.11-nc \ 3.12.44-nc \ 3.11.10-nc \ -3.10.92-nc \ +3.10.93-nc \ 3.9.11-nc \ 3.8.13-nc \ 3.7.10-nc \ From 1b18a81264291ab8ac64653f5cda5e63f702fa04 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 04:58:43 +0000 Subject: [PATCH 13/32] scst: Fix in-tree build for kernel 4.3 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6662 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/generate-kernel-patch | 4 +++- scst/kernel/in-tree/Makefile.scst-4.3 | 18 +++++++++++------- scst/src/scst_copy_mgr.c | 4 ++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index ddb35ebf1..8f8692fff 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -304,7 +304,9 @@ done scst_03_public_headers="scst/include/scst.h scst/include/scst_const.h \ scst/include/scst_event.h scst/include/backport.h" -scst_04_main="scst/src/scst_main.c scst/src/scst_module.c scst/src/scst_priv.h" +scst_04_main="scst/src/scst_main.c scst/src/scst_module.c scst/src/scst_priv.h \ +scst/src/scst_copy_mgr.c scst/src/scst_dlm.c scst/src/scst_dlm.h \ +scst/src/scst_event.c scst/src/scst_no_dlm.c" scst_05_targ="scst/src/scst_targ.c" scst_06_lib="scst/src/scst_lib.c" scst_07_pres="scst/src/scst_pres.h scst/src/scst_pres.c" diff --git a/scst/kernel/in-tree/Makefile.scst-4.3 b/scst/kernel/in-tree/Makefile.scst-4.3 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-4.3 +++ b/scst/kernel/in-tree/Makefile.scst-4.3 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 94ef5af4b..2e6f3e112 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -11,7 +11,11 @@ #include #include +#ifdef INSIDE_KERNEL_TREE +#include +#else #include "scst.h" +#endif #include "scst_priv.h" #include "scst_pres.h" From a8e9edf349ab011a6c889d8b706b5ad33c9b2a0b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 05:12:38 +0000 Subject: [PATCH 14/32] scst: Fix in-tree build for kernels before 4.3 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6663 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/kernel/in-tree/Makefile.scst-2.6.23 | 23 +++++++++++++---------- scst/kernel/in-tree/Makefile.scst-2.6.24 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.25 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.26 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.27 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.28 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.29 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.30 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.31 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.32 | 21 ++++++++++++--------- scst/kernel/in-tree/Makefile.scst-2.6.33 | 20 ++++++++++++-------- scst/kernel/in-tree/Makefile.scst-2.6.34 | 20 ++++++++++++-------- scst/kernel/in-tree/Makefile.scst-2.6.35 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-2.6.36 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-2.6.37 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-2.6.38 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-2.6.39 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.0 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.1 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.10 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.11 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.12 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.13 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.14 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.15 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.16 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.17 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.18 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.19 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.2 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.3 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.4 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.5 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.6 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.7 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.8 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-3.9 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-4.0 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-4.1 | 18 +++++++++++------- scst/kernel/in-tree/Makefile.scst-4.2 | 18 +++++++++++------- 40 files changed, 453 insertions(+), 303 deletions(-) diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.23 b/scst/kernel/in-tree/Makefile.scst-2.6.23 index f801073af..09dc56ac9 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.23 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.23 @@ -1,14 +1,17 @@ -EXTRA_CFLAGS += -Iinclude/scst -Wno-unused-parameter +EXTRA_CFLAGS += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_proc.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ - scst_local/ - + scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.24 b/scst/kernel/in-tree/Makefile.scst-2.6.24 index e040252e4..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.24 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.24 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_proc.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.25 b/scst/kernel/in-tree/Makefile.scst-2.6.25 index e040252e4..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.25 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.25 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_proc.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.26 b/scst/kernel/in-tree/Makefile.scst-2.6.26 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.26 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.26 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.27 b/scst/kernel/in-tree/Makefile.scst-2.6.27 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.27 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.27 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.28 b/scst/kernel/in-tree/Makefile.scst-2.6.28 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.28 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.28 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.29 b/scst/kernel/in-tree/Makefile.scst-2.6.29 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.29 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.29 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.30 b/scst/kernel/in-tree/Makefile.scst-2.6.30 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.30 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.30 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.31 b/scst/kernel/in-tree/Makefile.scst-2.6.31 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.31 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.31 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.32 b/scst/kernel/in-tree/Makefile.scst-2.6.32 index 1379402be..7aacdd48e 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.32 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.32 @@ -1,14 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ srpt/ \ scst_local/ - diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.33 b/scst/kernel/in-tree/Makefile.scst-2.6.33 index d2dd04dc2..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.33 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.33 @@ -1,13 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.34 b/scst/kernel/in-tree/Makefile.scst-2.6.34 index d2dd04dc2..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.34 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.34 @@ -1,13 +1,17 @@ -ccflags-y += -Iinclude/scst -Wno-unused-parameter +ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.35 b/scst/kernel/in-tree/Makefile.scst-2.6.35 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.35 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.35 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.36 b/scst/kernel/in-tree/Makefile.scst-2.6.36 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.36 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.36 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.37 b/scst/kernel/in-tree/Makefile.scst-2.6.37 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.37 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.37 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.38 b/scst/kernel/in-tree/Makefile.scst-2.6.38 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.38 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.38 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-2.6.39 b/scst/kernel/in-tree/Makefile.scst-2.6.39 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-2.6.39 +++ b/scst/kernel/in-tree/Makefile.scst-2.6.39 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.0 b/scst/kernel/in-tree/Makefile.scst-3.0 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.0 +++ b/scst/kernel/in-tree/Makefile.scst-3.0 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.1 b/scst/kernel/in-tree/Makefile.scst-3.1 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.1 +++ b/scst/kernel/in-tree/Makefile.scst-3.1 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.10 b/scst/kernel/in-tree/Makefile.scst-3.10 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.10 +++ b/scst/kernel/in-tree/Makefile.scst-3.10 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.11 b/scst/kernel/in-tree/Makefile.scst-3.11 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.11 +++ b/scst/kernel/in-tree/Makefile.scst-3.11 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.12 b/scst/kernel/in-tree/Makefile.scst-3.12 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.12 +++ b/scst/kernel/in-tree/Makefile.scst-3.12 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.13 b/scst/kernel/in-tree/Makefile.scst-3.13 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.13 +++ b/scst/kernel/in-tree/Makefile.scst-3.13 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.14 b/scst/kernel/in-tree/Makefile.scst-3.14 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.14 +++ b/scst/kernel/in-tree/Makefile.scst-3.14 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.15 b/scst/kernel/in-tree/Makefile.scst-3.15 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.15 +++ b/scst/kernel/in-tree/Makefile.scst-3.15 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.16 b/scst/kernel/in-tree/Makefile.scst-3.16 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.16 +++ b/scst/kernel/in-tree/Makefile.scst-3.16 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.17 b/scst/kernel/in-tree/Makefile.scst-3.17 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.17 +++ b/scst/kernel/in-tree/Makefile.scst-3.17 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.18 b/scst/kernel/in-tree/Makefile.scst-3.18 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.18 +++ b/scst/kernel/in-tree/Makefile.scst-3.18 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.19 b/scst/kernel/in-tree/Makefile.scst-3.19 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.19 +++ b/scst/kernel/in-tree/Makefile.scst-3.19 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.2 b/scst/kernel/in-tree/Makefile.scst-3.2 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.2 +++ b/scst/kernel/in-tree/Makefile.scst-3.2 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.3 b/scst/kernel/in-tree/Makefile.scst-3.3 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.3 +++ b/scst/kernel/in-tree/Makefile.scst-3.3 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.4 b/scst/kernel/in-tree/Makefile.scst-3.4 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.4 +++ b/scst/kernel/in-tree/Makefile.scst-3.4 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.5 b/scst/kernel/in-tree/Makefile.scst-3.5 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.5 +++ b/scst/kernel/in-tree/Makefile.scst-3.5 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.6 b/scst/kernel/in-tree/Makefile.scst-3.6 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.6 +++ b/scst/kernel/in-tree/Makefile.scst-3.6 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.7 b/scst/kernel/in-tree/Makefile.scst-3.7 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.7 +++ b/scst/kernel/in-tree/Makefile.scst-3.7 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.8 b/scst/kernel/in-tree/Makefile.scst-3.8 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.8 +++ b/scst/kernel/in-tree/Makefile.scst-3.8 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-3.9 b/scst/kernel/in-tree/Makefile.scst-3.9 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-3.9 +++ b/scst/kernel/in-tree/Makefile.scst-3.9 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-4.0 b/scst/kernel/in-tree/Makefile.scst-4.0 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-4.0 +++ b/scst/kernel/in-tree/Makefile.scst-4.0 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-4.1 b/scst/kernel/in-tree/Makefile.scst-4.1 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-4.1 +++ b/scst/kernel/in-tree/Makefile.scst-4.1 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ diff --git a/scst/kernel/in-tree/Makefile.scst-4.2 b/scst/kernel/in-tree/Makefile.scst-4.2 index 53af5f388..f4e0cc985 100644 --- a/scst/kernel/in-tree/Makefile.scst-4.2 +++ b/scst/kernel/in-tree/Makefile.scst-4.2 @@ -1,13 +1,17 @@ ccflags-y += -Wno-unused-parameter -scst-y += scst_main.o -scst-y += scst_pres.o -scst-y += scst_targ.o -scst-y += scst_lib.o -scst-y += scst_sysfs.o -scst-y += scst_mem.o -scst-y += scst_tg.o +scst-y += scst_copy_mgr.o scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \ srpt/ scst_local/ From 876ebe3b6efbb1053e7ed1835d6f23fbde8671c0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 14:17:04 +0000 Subject: [PATCH 15/32] scst_copy_mgr: Fix a checkpatch complaint about whitespace git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6664 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 2e6f3e112..792090baf 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -3058,7 +3058,7 @@ static int scst_cm_parse_b2b_seg_descr(struct scst_cmd *ec_cmd, scst_cm_set_seg_err_sense(ec_cmd, 0xD, 2, seg_num, 6); goto out_err; } - if (tgt_des->read_only){ + if (tgt_des->read_only) { PRINT_WARNING("Target descriptor refers to read-only device"); scst_cm_set_seg_err_sense(ec_cmd, 0, 0, seg_num, 6); goto out_err; From d4266b0751cca53a24e691a0c580deece4627acd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 14:18:04 +0000 Subject: [PATCH 16/32] scst_copy_mgr: Spelling fix - desriptors -> descriptors git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6665 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 792090baf..47e932113 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -363,7 +363,7 @@ static int scst_cm_setup_this_data_descr(struct scst_cmd *ec_cmd) EXTRACHECKS_BUG_ON(priv->cm_cur_data_descr > priv->cm_data_descrs_cnt); if (priv->cm_cur_data_descr == priv->cm_data_descrs_cnt) { - TRACE_DBG("No more data desriptors for ec_cmd %p", ec_cmd); + TRACE_DBG("No more data descriptors for ec_cmd %p", ec_cmd); res = -ENOENT; goto out; } From fe7321fd7a602222e4a143ffeee8cab905a74dd5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 14:18:55 +0000 Subject: [PATCH 17/32] scst_copy_mgr: Join two strings git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6666 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 47e932113..236c6dbfd 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -284,7 +284,7 @@ try_retry: next_retry_time = cur_time + SCST_CM_RETRIES_WAIT; TRACE_DBG("Retrying cmd %p (imm_retry %d, next_retry_time %ld, " - "cur_time %ld, " "start_time %ld, max_retry_time %ld): going " + "cur_time %ld, start_time %ld, max_retry_time %ld): going " "to sleep", cmd, imm_retry, next_retry_time, cur_time, start_time, max_retry_time); From 147aededc7722909091d6c94b8ec307673ce60a3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 14:24:14 +0000 Subject: [PATCH 18/32] scst: Insert a blank line after each declaration git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6667 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 2 ++ scst/src/scst_copy_mgr.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 74364ad51..caf33d27c 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -888,9 +888,11 @@ static void dev_user_flush_dcache(struct scst_user_cmd *ucmd) for (i = 0; (bufflen > 0) && (i < buf_ucmd->num_data_pages); i++) { struct page *page __attribute__((unused)); + page = buf_ucmd->data_pages[i]; #ifdef ARCH_HAS_FLUSH_ANON_PAGE struct vm_area_struct *vma = find_vma(current->mm, start); + if (vma != NULL) flush_anon_page(vma, page, start); #endif diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 236c6dbfd..2b873f088 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -734,6 +734,7 @@ static void scst_cm_store_list_id_details(struct scst_cmd *ec_cmd) l->cm_status = ec_cmd->status; if (scst_sense_valid(ec_cmd->sense)) { int len = ec_cmd->sense_valid_len; + if (len > sizeof(l->cm_sense)) { PRINT_WARNING("EC command's sense is " "too big (%d) with max allowed " @@ -1334,6 +1335,7 @@ static void scst_cm_gen_reads(struct scst_cmd *ec_cmd) while (1) { int rc; + while ((priv->cm_left_to_read > 0) && (priv->cm_cur_in_flight < SCST_MAX_IN_FLIGHT_INTERNAL_COMMANDS)) { int blocks; @@ -1802,6 +1804,7 @@ bool scst_cm_check_block_all_devs(struct scst_cmd *cmd) if (unlikely(res)) { struct scst_cmd *blocked_cmd = e->cm_fcmd; + list_for_each_entry(e, &d->cm_sorted_devs_list, cm_sorted_devs_list_entry) { if (e->cm_fcmd == blocked_cmd) @@ -1846,6 +1849,7 @@ void scst_cm_abort_ec_cmd(struct scst_cmd *ec_cmd) list_for_each_entry(ip, &p->cm_internal_cmd_list, cm_internal_cmd_list_entry) { struct scst_cmd *c = ip->cm_cmd; + TRACE_MGMT_DBG("Aborting (f)cmd %p", c); set_bit(SCST_CMD_ABORTED, &c->cmd_flags); } @@ -2526,6 +2530,7 @@ static int scst_cm_dev_register(struct scst_device *dev) for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) { struct scst_tgt_dev *tgt_dev; struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[i]; + list_for_each_entry(tgt_dev, head, sess_tgt_dev_list_entry) { if (tgt_dev->dev == dev) { PRINT_ERROR("Copy Manager already registered " @@ -2591,6 +2596,7 @@ static void scst_cm_dev_unregister(struct scst_device *dev) for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) { struct scst_tgt_dev *tgt_dev; struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[i]; + list_for_each_entry(tgt_dev, head, sess_tgt_dev_list_entry) { if (tgt_dev->dev == dev) { scst_acg_del_lun(scst_cm_tgt->default_acg, @@ -2645,6 +2651,7 @@ static bool scst_cm_check_access_acg(const char *initiator_name, list_for_each_entry(acg_dev, &acg->acg_dev_list, acg_dev_list_entry) { if (acg_dev->dev == dev) { struct scst_acn *acn; + if (default_acg) goto found; list_for_each_entry(acn, &acg->acn_list, acn_list_entry) { @@ -2970,6 +2977,7 @@ skip_fcmd_create: #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_EXTRACHECKS) { struct scst_cm_dev_entry *tp = NULL; + list_for_each_entry(t, &priv->cm_sorted_devs_list, cm_sorted_devs_list_entry) { TRACE_DBG("t %p, cm dev %p", t, t->cm_fcmd->dev); if (tp != NULL) { @@ -3138,6 +3146,7 @@ static void scst_cm_free_ec_priv(struct scst_cmd *ec_cmd, bool unblock_dev) list_for_each_entry_safe(ip, it, &p->cm_internal_cmd_list, cm_internal_cmd_list_entry) { struct scst_cmd *c = ip->cm_cmd; + scst_cm_del_free_from_internal_cmd_list(c, unblock_dev); __scst_cmd_put(c); } From 295910c6c7bce4d93b3f9f00dd9b5183baccc099 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 14:39:01 +0000 Subject: [PATCH 19/32] scst_dlm: Use kstrtoul() instead of simple_strtoul() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6668 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_dlm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 39792b897..0aa1372ea 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -572,7 +572,8 @@ static int scst_dlm_update_nodeids(struct scst_pr_dlm_data *pr_dlm) static const char comms_dir[] = "/sys/kernel/config/dlm/cluster/comms"; struct file *comms; char *p, *entries = kzalloc(1, GFP_KERNEL); - uint32_t nodeid, *new; + unsigned long nodeid; + uint32_t *new; int i, ret, num_nodes; char path[256], buf[64]; @@ -612,7 +613,9 @@ static int scst_dlm_update_nodeids(struct scst_pr_dlm_data *pr_dlm) pr_dlm->nodeid = new; pr_dlm->participants = num_nodes; for (i = 0, p = entries; *p; i++, p += strlen(p) + 1) { - nodeid = simple_strtoul(p, NULL, 0); + ret = kstrtoul(p, 0, &nodeid); + if (WARN_ON_ONCE(ret < 0)) + continue; snprintf(path, sizeof(path), "%s/%s/local", comms_dir, p); if (scst_read_file(path, buf, sizeof(buf)) >= 0 && strcmp(buf, "1\n") == 0) From 4bda296d64cd07362102b032ff150e53aece891e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 22:04:42 +0000 Subject: [PATCH 20/32] isert-scst: Fix an IPv6 format specification git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6669 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/isert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/isert.c b/iscsi-scst/kernel/isert-scst/isert.c index f16792555..2a3693754 100644 --- a/iscsi-scst/kernel/isert-scst/isert.c +++ b/iscsi-scst/kernel/isert-scst/isert.c @@ -444,7 +444,7 @@ static ssize_t isert_get_initiator_ip(struct iscsi_conn *conn, "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", NIP6(((struct sockaddr_in6 *)&ss)->sin6_addr)); #else - pos = scnprintf(buf, size, "[%p6]", + pos = scnprintf(buf, size, "[%pI6]", &((struct sockaddr_in6 *)&ss)->sin6_addr); #endif break; From 0597ac78c88e15a41352c3f88825dd1c9f89c245 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 22:05:05 +0000 Subject: [PATCH 21/32] iscsi-scst: Fix IPv6 format specifications git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6670 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/conn.c | 4 ++-- iscsi-scst/kernel/iscsi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 641d1bf79..de76de85d 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -116,10 +116,10 @@ void conn_info_show(struct seq_file *seq, struct iscsi_session *session) "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", NIP6(inet6_sk(sk)->daddr)); #elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) - snprintf(buf, sizeof(buf), "[%p6]", + snprintf(buf, sizeof(buf), "[%pI6]", &inet6_sk(sk)->daddr); #else - snprintf(buf, sizeof(buf), "[%p6]", + snprintf(buf, sizeof(buf), "[%pI6]", &sk->sk_v6_daddr); #endif break; diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index ff3c616f3..2bedfae17 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3310,9 +3310,9 @@ static ssize_t iscsi_tcp_get_initiator_ip(struct iscsi_conn *conn, #else #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) - pos = scnprintf(buf, size, "[%p6]", &inet6_sk(sk)->daddr); + pos = scnprintf(buf, size, "[%pI6]", &inet6_sk(sk)->daddr); #else - pos = scnprintf(buf, size, "[%p6]", &sk->sk_v6_daddr); + pos = scnprintf(buf, size, "[%pI6]", &sk->sk_v6_daddr); #endif #endif break; From fea566969fee7c21666f135191d05f40d7986170 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 23:56:56 +0000 Subject: [PATCH 22/32] scstadmin: Do not save copy_manager LUN definitions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6671 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scstadmin | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin index 60d609717..7c7a7939e 100755 --- a/scstadmin/scstadmin.sysfs/scstadmin +++ b/scstadmin/scstadmin.sysfs/scstadmin @@ -1423,6 +1423,8 @@ sub writeConfiguration { } foreach my $driver (sort keys %{$CURRENT{'assign'}}) { + next if $driver eq 'copy_manager'; + my $driver_buff; my ($drv_attrs, $errorString) = $SCST->driverAttributes($driver); From c800406f8c44c0349a72d2e77e8ba913df5ada0c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 11 Nov 2015 23:57:31 +0000 Subject: [PATCH 23/32] scstadmin, test 03: Skip the copy manager git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6672 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t | 1 + 1 file changed, 1 insertion(+) diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t index f1b6bcac7..d07b11a34 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t @@ -24,6 +24,7 @@ sub addTargets { my $all_hw_tgt = 1; for my $driver (@{$drivers}) { + next if $driver eq 'copy_manager'; my ($targets, $errorString) = $SCST->targets($driver); for my $target (@{$targets}) { if ($SCST->targetType($driver, $target) != From cf4aa89416576aff542f208c39aed2b10d626ed1 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 12 Nov 2015 01:06:51 +0000 Subject: [PATCH 24/32] Cleanups git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6673 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/README | 2 +- scst/README_in-tree | 5 +++++ scst/include/scst.h | 2 +- scst/src/scst_main.c | 1 - usr/Makefile | 2 -- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scst/README b/scst/README index 1177aba07..978d8f6fb 100644 --- a/scst/README +++ b/scst/README @@ -30,7 +30,7 @@ SCST supports the following I/O modes: * User space mode using scst_user device handler, which allows to implement in the user space high performance virtual SCSI devices. Comparing with fully in-kernel dev handlers this mode has - very low overhead (few %%) + very low overhead (few %%). * "Performance" device handlers, which provide in pseudo pass-through mode a way for direct performance measurements without overhead of diff --git a/scst/README_in-tree b/scst/README_in-tree index 8f8205f61..91d0b6ca6 100644 --- a/scst/README_in-tree +++ b/scst/README_in-tree @@ -24,6 +24,11 @@ SCST supports the following I/O modes: caching between application and disk or need the large block throughput. + * User space mode using scst_user device handler, which allows to + implement in the user space high performance virtual SCSI + devices. Comparing with fully in-kernel dev handlers this mode has + very low overhead (few %%). + * "Performance" device handlers, which provide in pseudo pass-through mode a way for direct performance measurements without overhead of actual data transferring from/to underlying SCSI device. diff --git a/scst/include/scst.h b/scst/include/scst.h index de2d36ce3..a88f6cce1 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2761,7 +2761,7 @@ struct scst_device { unsigned int dev_unregistering:1; /* - * Set if ext blocking is pending. It if just shortcut for + * Set if ext blocking is pending. It is just shortcut for * !list_empty(&dev->ext_blockers_list) to save a cache miss. */ unsigned int ext_blocking_pending:1; diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 63d2e8e37..85ab18fe1 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -2685,7 +2685,6 @@ static int __init init_scst(void) goto out_thread_free; #endif - PRINT_INFO("SCST version %s loaded successfully (max mem for " "commands %dMB, per device %dMB)", SCST_VERSION_STRING, scst_max_cmd_mem, scst_max_dev_cmd_mem); diff --git a/usr/Makefile b/usr/Makefile index 85bed6073..cff5548c2 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -18,8 +18,6 @@ # SHELL=/bin/bash -# Decide to use which kernel src. If not specified, is current running kernel. -#export KDIR=/usr/src/linux-2.6 FILEIO_DIR=fileio STPGD_DIR=stpgd From 254f91f29196e1ac73cdde895d5176e4379b9ba4 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 12 Nov 2015 01:08:06 +0000 Subject: [PATCH 25/32] scst: Fix race leading to extra device unblocking in mix of strictly serialized and TM commands git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6674 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 2 -- scst/src/scst_targ.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 943b5c1b8..c026d02e0 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -12997,8 +12997,6 @@ void scst_unblock_dev(struct scst_device *dev) break; } local_irq_restore_nort(flags); - - dev->strictly_serialized_cmd_waiting = 0; } sBUG_ON(dev->block_count < 0); diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index b6198f78b..3f3ee4d24 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -547,6 +547,7 @@ void __scst_check_unblock_dev(struct scst_cmd *cmd) TRACE_BLOCK("Strictly serialized cmd waiting: " "unblocking dev %s", dev->virt_name); scst_unblock_dev(dev); + dev->strictly_serialized_cmd_waiting = 0; } } From 2c6eac2c2493dd42945e9daf4bcf1591b4e9fcf6 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 12 Nov 2015 03:45:07 +0000 Subject: [PATCH 26/32] SVN_TAGS updated git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6679 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- SVN_TAGS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SVN_TAGS b/SVN_TAGS index 789a05d4c..b8fb6f4f4 100644 --- a/SVN_TAGS +++ b/SVN_TAGS @@ -17,5 +17,6 @@ SRPT 1.0.0 450 2.2.x branch start 3981, which is a copy of r3979 on the 2.1.0.x branch 2.2.0 4102 2.2.1 4737 on the 2.2.x branch -3.0.x branch start 5534, which is a copy of trunk r5533. +3.0.x branch start 5534, which is a copy of trunk r5533 3.0.0 5815 on the 3.0.x branch +3.1.x branch start 6591, which is a copy of trunk r6590 From e1d9ed0128cdeaec4713035d4200d88696a1f827 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Nov 2015 17:43:26 +0000 Subject: [PATCH 27/32] scst_copy_mgr: Fix indentation git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6682 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_copy_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index 2b873f088..c59233ba8 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -3548,8 +3548,8 @@ static int scst_cm_mgmt(struct scst_sysfs_work_item *work) d->scsi_dev->channel == channel && d->scsi_dev->id == id && d->scsi_dev->lun == lun) { - dev = d; - break; + dev = d; + break; } } if (dev == NULL) { From 22a203d843c83d1729e038512667c1e1188ece7a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Nov 2015 18:26:26 +0000 Subject: [PATCH 28/32] qla2x00t: Suppress a Coverity complaint about a potential buffer overflow Coverity reported the following: Copy into fixed size buffer (STRING_OVERFLOW) fixed_size_dest: You might overrun the 17 byte fixed-size string ha->model_number by copying def without checking the length. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6683 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qla2x00t/qla_init.c b/qla2x00t/qla_init.c index 995aecf14..76c946f7b 100644 --- a/qla2x00t/qla_init.c +++ b/qla2x00t/qla_init.c @@ -2190,7 +2190,8 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, qla2x00_model_name[index * 2 + 1], sizeof(ha->model_desc) - 1); } else { - strcpy(ha->model_number, def); + strlcpy(ha->model_number, def, + sizeof(ha->model_number)); } } if (IS_FWI2_CAPABLE(ha)) From 2bdb7bfc8d12b43f8a56727f07abc7a55e08f385 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Nov 2015 18:30:15 +0000 Subject: [PATCH 29/32] qla2x00t: Do not compare an array pointer with NULL git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6684 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_attr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qla2x00t/qla_attr.c b/qla2x00t/qla_attr.c index a4f7cd6d0..60afa6024 100644 --- a/qla2x00t/qla_attr.c +++ b/qla2x00t/qla_attr.c @@ -1505,8 +1505,7 @@ qla2x00_model_desc_show(struct device *dev, struct device_attribute *attr, char *buf) { scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); - return scnprintf(buf, PAGE_SIZE, "%s\n", - vha->hw->model_desc ? vha->hw->model_desc : ""); + return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_desc); } static ssize_t From 8b7820129aa3c47fbc76335996ab5f6109f464e5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Nov 2015 18:30:42 +0000 Subject: [PATCH 30/32] qla2x00t: Use strlcpy() instead of strcpy() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6685 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_gs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qla2x00t/qla_gs.c b/qla2x00t/qla_gs.c index ee93bc8a4..b169d5581 100644 --- a/qla2x00t/qla_gs.c +++ b/qla2x00t/qla_gs.c @@ -1378,7 +1378,8 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha) /* Hardware version. */ eiter = (struct ct_fdmi_hba_attr *) (entries + size); eiter->type = cpu_to_be16(FDMI_HBA_HARDWARE_VERSION); - strcpy(eiter->a.hw_version, ha->adapter_id); + strlcpy(eiter->a.hw_version, ha->adapter_id, + sizeof(eiter->a.hw_version)); alen = strlen(eiter->a.hw_version); alen += (alen & 3) ? (4 - (alen & 3)) : 4; eiter->len = cpu_to_be16(4 + alen); From 3f818ef30e4a8ae756f43890c9f3738a514fa89e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 12 Nov 2015 22:17:59 +0000 Subject: [PATCH 31/32] scst_lib: Avoid using 64-bit divisions Reported-by: Sebastian Herbszt git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6686 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index c026d02e0..8cd269cc7 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6131,11 +6131,12 @@ static int scst_ws_sg_init(struct scatterlist **ws_sg, int ws_sg_cnt, static int scst_ws_sg_tails_get(struct scst_data_descriptor *where, struct scst_write_same_priv *wsp) { int i; + uint64_t n; TRACE_ENTRY(); for (i = 0; where[i].sdd_blocks != 0; i++) { - if (where[i].sdd_blocks / wsp->ws_max_each != 0) { + if (where[i].sdd_blocks >= wsp->ws_max_each) { wsp->ws_sg_full_cnt = wsp->ws_max_each; break; } @@ -6150,8 +6151,10 @@ static int scst_ws_sg_tails_get(struct scst_data_descriptor *where, struct scst_ sizeof(*wsp->ws_sg_tails)*i); return -ENOMEM; } - for (i = 0; where[i].sdd_blocks != 0; i++) - wsp->ws_sg_tails[i].sg_cnt = where[i].sdd_blocks % wsp->ws_max_each; + for (i = 0; where[i].sdd_blocks != 0; i++) { + n = where[i].sdd_blocks; + wsp->ws_sg_tails[i].sg_cnt = do_div(n, wsp->ws_max_each); + } TRACE_EXIT(); return 0; From c3f3e0aa6467f4b5583dafe24d62d1f99b539c4e Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 12 Nov 2015 23:33:45 +0000 Subject: [PATCH 32/32] Update the root README regarding QLogic target driver git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6687 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- README | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/README b/README index aa14955cd..31b01bd6d 100644 --- a/README +++ b/README @@ -31,12 +31,15 @@ For more information about each subproject see their README files. QLogic target driver ==================== -QLogic target driver in qla2x00t/ is the old one, forked from qla2xxx -from kernel 2.6.26. It is not maintained anymore and not built by -default by the common Makefile targets, like "all". +QLogic target driver qla2x00t is the old driver, forked from qla2xxx +several years ago. It is very stable, well tested and actively used in +many production setups. The ultimate goal is to have the mainstream +(git) QLogic target driver to be the main and the only QLogic target +driver, but, unfortunately, this driver not yet reached level of quality +and maturity of qla2x00t. We with QLogic are working toward it. -You can find the latest version of this driver in git://git.qlogic.com/scst-qla2xxx.git. -It is now maintained by QLogic, hence located in the QLogic's git. +You can find the latest version of the git driver in git://git.qlogic.com/scst-qla2xxx.git. +It is maintained by QLogic, hence located in the QLogic's git. To integrate it into the SCST build tree you need: @@ -45,19 +48,20 @@ To integrate it into the SCST build tree you need: 2. Create in the SCST root, i.e. this directory, a subdirectory with name qla2x00t_git -3. Symlink drivers/scsi/qla2xxx subdirectory in the cloned git tree to the -qla2x00t_git subdirectory +3. Optional for the in-tree build: symlink drivers/scsi/qla2xxx +subdirectory in the cloned git tree to the qla2x00t_git subdirectory -Thats all. Now run either "make all" to build the SCST core and all -target drivers with in-tree QLogic drivers, or the following command +Thats all. Now common and QLA specific root Makefile targets "magically" +start working with the new driver. + +For detail instructions how to setup QLA target build environment see +its README or HOWTO. Run either "make all" to build the SCST core and +all target drivers with in-tree QLogic drivers, or the following command with standalone QLogic drivers: BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make all -and other common and QLA specific root Makefile targets "magically" start -working. For detail instructions how to setup QLA target build environment see -its README or HOWTO. - -You can still build the old driver using qla_old* root Makefile targets. +In presence of qla2x00t_git subdirectory you can still build the +qla2x00t using qla_old* root Makefile targets. Vladislav Bolkhovitin , http://scst.sourceforge.net