From 6b684f6a9d227e44c0c613702b8241e3e790a6da Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 2 Nov 2010 09:11:55 -0400 Subject: [PATCH] --- yaml --- r: 222174 b: refs/heads/master c: 8e35f8e7c61c88f9a979a4e6f7f4ffd4c158a88a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/power/opp.txt | 3 - trunk/Makefile | 2 +- trunk/arch/ia64/hp/sim/simscsi.c | 4 +- trunk/arch/s390/Kconfig.debug | 12 ---- trunk/arch/s390/include/asm/page.h | 5 -- trunk/arch/s390/kernel/kprobes.c | 70 +++++---------------- trunk/arch/s390/mm/gup.c | 7 ++- trunk/drivers/ata/libata-scsi.c | 4 +- trunk/drivers/base/power/main.c | 34 ++-------- trunk/drivers/block/cciss_scsi.c | 8 +-- trunk/drivers/firewire/sbp2.c | 4 +- trunk/drivers/infiniband/ulp/srp/ib_srp.c | 4 +- trunk/drivers/message/fusion/mptfc.c | 7 +-- trunk/drivers/message/fusion/mptsas.c | 4 +- trunk/drivers/message/fusion/mptspi.c | 4 +- trunk/drivers/message/i2o/i2o_scsi.c | 6 +- trunk/drivers/pci/pci-sysfs.c | 2 +- trunk/drivers/s390/char/tape_core.c | 68 +++----------------- trunk/drivers/s390/char/vmlogrdr.c | 36 ++++------- trunk/drivers/s390/cio/device.c | 11 +--- trunk/drivers/s390/scsi/zfcp_scsi.c | 4 +- trunk/drivers/scsi/3w-9xxx.c | 4 +- trunk/drivers/scsi/3w-sas.c | 4 +- trunk/drivers/scsi/3w-xxxx.c | 4 +- trunk/drivers/scsi/53c700.c | 8 +-- trunk/drivers/scsi/BusLogic.c | 3 +- trunk/drivers/scsi/BusLogic.h | 2 +- trunk/drivers/scsi/NCR5380.c | 3 +- trunk/drivers/scsi/NCR5380.h | 2 +- trunk/drivers/scsi/NCR53c406a.c | 4 +- trunk/drivers/scsi/a100u2w.c | 4 +- trunk/drivers/scsi/aacraid/linit.c | 4 +- trunk/drivers/scsi/advansys.c | 4 +- trunk/drivers/scsi/aha152x.c | 4 +- trunk/drivers/scsi/aha1542.c | 4 +- trunk/drivers/scsi/aha1542.h | 2 +- trunk/drivers/scsi/aha1740.c | 4 +- trunk/drivers/scsi/aic7xxx/aic79xx_osm.c | 4 +- trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c | 4 +- trunk/drivers/scsi/aic7xxx_old.c | 4 +- trunk/drivers/scsi/arcmsr/arcmsr_hba.c | 7 +-- trunk/drivers/scsi/arm/acornscsi.c | 4 +- trunk/drivers/scsi/arm/fas216.c | 10 +-- trunk/drivers/scsi/arm/fas216.h | 18 +++--- trunk/drivers/scsi/atari_NCR5380.c | 4 +- trunk/drivers/scsi/atari_scsi.c | 17 +++++ trunk/drivers/scsi/atp870u.c | 4 +- trunk/drivers/scsi/bfa/bfad_im.c | 7 +-- trunk/drivers/scsi/dc395x.c | 3 +- trunk/drivers/scsi/dpt_i2o.c | 4 +- trunk/drivers/scsi/dpti.h | 2 +- trunk/drivers/scsi/dtc.h | 2 +- trunk/drivers/scsi/eata.c | 7 +-- trunk/drivers/scsi/eata_pio.c | 4 +- trunk/drivers/scsi/esp_scsi.c | 4 +- trunk/drivers/scsi/fd_mcs.c | 4 +- trunk/drivers/scsi/fdomain.c | 4 +- trunk/drivers/scsi/fnic/fnic.h | 2 +- trunk/drivers/scsi/fnic/fnic_scsi.c | 4 +- trunk/drivers/scsi/g_NCR5380.h | 2 +- trunk/drivers/scsi/gdth.c | 6 +- trunk/drivers/scsi/hpsa.c | 7 +-- trunk/drivers/scsi/hptiop.c | 4 +- trunk/drivers/scsi/ibmmca.c | 6 +- trunk/drivers/scsi/ibmvscsi/ibmvfc.c | 4 +- trunk/drivers/scsi/ibmvscsi/ibmvscsi.c | 4 +- trunk/drivers/scsi/imm.c | 4 +- trunk/drivers/scsi/in2000.c | 4 +- trunk/drivers/scsi/in2000.h | 2 +- trunk/drivers/scsi/initio.c | 4 +- trunk/drivers/scsi/ipr.c | 4 +- trunk/drivers/scsi/ips.c | 6 +- trunk/drivers/scsi/libfc/fc_fcp.c | 4 +- trunk/drivers/scsi/libiscsi.c | 4 +- trunk/drivers/scsi/libsas/sas_scsi_host.c | 4 +- trunk/drivers/scsi/lpfc/lpfc_scsi.c | 4 +- trunk/drivers/scsi/mac53c94.c | 4 +- trunk/drivers/scsi/megaraid.c | 6 +- trunk/drivers/scsi/megaraid.h | 2 +- trunk/drivers/scsi/megaraid/megaraid_mbox.c | 7 +-- trunk/drivers/scsi/megaraid/megaraid_sas.c | 4 +- trunk/drivers/scsi/mesh.c | 4 +- trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c | 4 +- trunk/drivers/scsi/ncr53c8xx.c | 4 +- trunk/drivers/scsi/nsp32.c | 7 +-- trunk/drivers/scsi/pas16.h | 2 +- trunk/drivers/scsi/pcmcia/nsp_cs.c | 4 +- trunk/drivers/scsi/pcmcia/nsp_cs.h | 3 +- trunk/drivers/scsi/pcmcia/sym53c500_cs.c | 4 +- trunk/drivers/scsi/pmcraid.c | 4 +- trunk/drivers/scsi/ppa.c | 4 +- trunk/drivers/scsi/ps3rom.c | 4 +- trunk/drivers/scsi/qla1280.c | 4 +- trunk/drivers/scsi/qla2xxx/qla_os.c | 7 +-- trunk/drivers/scsi/qla4xxx/ql4_os.c | 7 +-- trunk/drivers/scsi/qlogicfas408.c | 4 +- trunk/drivers/scsi/qlogicfas408.h | 3 +- trunk/drivers/scsi/qlogicpti.c | 4 +- trunk/drivers/scsi/scsi.c | 18 ++++-- trunk/drivers/scsi/scsi_debug.c | 4 +- trunk/drivers/scsi/scsi_error.c | 6 +- trunk/drivers/scsi/stex.c | 4 +- trunk/drivers/scsi/sun3_NCR5380.c | 4 +- trunk/drivers/scsi/sun3_scsi.h | 3 +- trunk/drivers/scsi/sym53c416.c | 4 +- trunk/drivers/scsi/sym53c416.h | 2 +- trunk/drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +- trunk/drivers/scsi/t128.h | 3 +- trunk/drivers/scsi/tmscsim.c | 4 +- trunk/drivers/scsi/u14-34f.c | 6 +- trunk/drivers/scsi/ultrastor.c | 4 +- trunk/drivers/scsi/ultrastor.h | 3 +- trunk/drivers/scsi/vmw_pvscsi.c | 4 +- trunk/drivers/scsi/wd33c93.c | 6 +- trunk/drivers/scsi/wd33c93.h | 3 +- trunk/drivers/scsi/wd7000.c | 4 +- trunk/drivers/staging/hv/storvsc_drv.c | 7 +-- trunk/drivers/staging/keucr/scsiglue.c | 4 +- trunk/drivers/usb/image/microtek.c | 6 +- trunk/drivers/usb/storage/scsiglue.c | 4 +- trunk/drivers/usb/storage/uas.c | 4 +- trunk/fs/lockd/host.c | 11 ++-- trunk/include/linux/libata.h | 2 +- trunk/include/linux/lockd/lockd.h | 1 + trunk/include/linux/sched.h | 1 - trunk/include/linux/security.h | 9 +-- trunk/include/scsi/libfc.h | 3 +- trunk/include/scsi/libiscsi.h | 3 +- trunk/include/scsi/libsas.h | 3 +- trunk/include/scsi/scsi_host.h | 23 +------ trunk/kernel/futex.c | 3 +- trunk/kernel/futex_compat.c | 3 +- trunk/kernel/pm_qos_params.c | 4 +- trunk/kernel/power/Kconfig | 4 -- trunk/kernel/printk.c | 15 +---- trunk/kernel/sched.c | 39 ++++-------- trunk/kernel/sched_fair.c | 40 +++--------- trunk/kernel/sched_stoptask.c | 4 +- trunk/kernel/sysctl.c | 2 +- trunk/kernel/trace/Kconfig | 2 +- trunk/security/capability.c | 5 -- trunk/security/commoncap.c | 21 +++++++ trunk/security/security.c | 4 +- trunk/security/selinux/hooks.c | 6 +- trunk/security/smack/smack_lsm.c | 8 ++- 146 files changed, 322 insertions(+), 658 deletions(-) diff --git a/[refs] b/[refs] index 2e9ccad5b4bb..f21026f056ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d33fdee4d090076462cfe25473f7139c3204b16e +refs/heads/master: 8e35f8e7c61c88f9a979a4e6f7f4ffd4c158a88a diff --git a/trunk/Documentation/power/opp.txt b/trunk/Documentation/power/opp.txt index cd445582d1f8..44d87ad3cea9 100644 --- a/trunk/Documentation/power/opp.txt +++ b/trunk/Documentation/power/opp.txt @@ -37,9 +37,6 @@ Typical usage of the OPP library is as follows: SoC framework -> modifies on required cases certain OPPs -> OPP layer -> queries to search/retrieve information -> -Architectures that provide a SoC framework for OPP should select ARCH_HAS_OPP -to make the OPP layer available. - OPP layer expects each domain to be represented by a unique device pointer. SoC framework registers a set of initial OPPs per device with the OPP layer. This list is expected to be an optimally small number typically around 5 per device. diff --git a/trunk/Makefile b/trunk/Makefile index ab5359db3d17..6619720f50dd 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 37 -EXTRAVERSION = -rc2 +EXTRAVERSION = -rc1 NAME = Flesh-Eating Bats with Fangs # *DOCUMENTATION* diff --git a/trunk/arch/ia64/hp/sim/simscsi.c b/trunk/arch/ia64/hp/sim/simscsi.c index 331de723c676..3a078ad3aa44 100644 --- a/trunk/arch/ia64/hp/sim/simscsi.c +++ b/trunk/arch/ia64/hp/sim/simscsi.c @@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) } static int -simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) { unsigned int target_id = sc->device->id; char fname[MAX_ROOT_LEN+16]; @@ -326,8 +326,6 @@ simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *) return 0; } -static DEF_SCSI_QCMD(simscsi_queuecommand) - static int simscsi_host_reset (struct scsi_cmnd *sc) { diff --git a/trunk/arch/s390/Kconfig.debug b/trunk/arch/s390/Kconfig.debug index 05221b13ffb1..45e0c6199f36 100644 --- a/trunk/arch/s390/Kconfig.debug +++ b/trunk/arch/s390/Kconfig.debug @@ -6,18 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT source "lib/Kconfig.debug" -config STRICT_DEVMEM - def_bool y - prompt "Filter access to /dev/mem" - ---help--- - This option restricts access to /dev/mem. If this option is - disabled, you allow userspace access to all memory, including - kernel and userspace memory. Accidental memory access is likely - to be disastrous. - Memory access is required for experts who want to debug the kernel. - - If you are unsure, say Y. - config DEBUG_STRICT_USER_COPY_CHECKS bool "Strict user copy size checks" ---help--- diff --git a/trunk/arch/s390/include/asm/page.h b/trunk/arch/s390/include/asm/page.h index 3c987e9ec8d6..a8729ea7e9ac 100644 --- a/trunk/arch/s390/include/asm/page.h +++ b/trunk/arch/s390/include/asm/page.h @@ -130,11 +130,6 @@ struct page; void arch_free_page(struct page *page, int order); void arch_alloc_page(struct page *page, int order); -static inline int devmem_is_allowed(unsigned long pfn) -{ - return 0; -} - #define HAVE_ARCH_FREE_PAGE #define HAVE_ARCH_ALLOC_PAGE diff --git a/trunk/arch/s390/kernel/kprobes.c b/trunk/arch/s390/kernel/kprobes.c index 2564793ec2b6..d60fc4398516 100644 --- a/trunk/arch/s390/kernel/kprobes.c +++ b/trunk/arch/s390/kernel/kprobes.c @@ -30,7 +30,6 @@ #include #include #include -#include DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); @@ -213,7 +212,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) /* Set the PER control regs, turns on single step for this address */ __ctl_load(kprobe_per_regs, 9, 11); regs->psw.mask |= PSW_MASK_PER; - regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); + regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); } static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) @@ -240,7 +239,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, __get_cpu_var(current_kprobe) = p; /* Save the interrupt and per flags */ kcb->kprobe_saved_imask = regs->psw.mask & - (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT); + (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); /* Save the control regs that govern PER */ __ctl_store(kcb->kprobe_saved_ctl, 9, 11); } @@ -317,6 +316,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) return 1; ss_probe: + if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) + local_irq_disable(); prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_HIT_SS; return 1; @@ -349,7 +350,6 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, struct hlist_node *node, *tmp; unsigned long flags, orig_ret_address = 0; unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; - kprobe_opcode_t *correct_ret_addr = NULL; INIT_HLIST_HEAD(&empty_rp); kretprobe_hash_lock(current, &head, &flags); @@ -372,32 +372,10 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, /* another task is sharing our hash bucket */ continue; - orig_ret_address = (unsigned long)ri->ret_addr; - - if (orig_ret_address != trampoline_address) - /* - * This is the real return address. Any other - * instances associated with this task are for - * other calls deeper on the call stack - */ - break; - } - - kretprobe_assert(ri, orig_ret_address, trampoline_address); - - correct_ret_addr = ri->ret_addr; - hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { - if (ri->task != current) - /* another task is sharing our hash bucket */ - continue; - - orig_ret_address = (unsigned long)ri->ret_addr; - - if (ri->rp && ri->rp->handler) { - ri->ret_addr = correct_ret_addr; + if (ri->rp && ri->rp->handler) ri->rp->handler(ri, regs); - } + orig_ret_address = (unsigned long)ri->ret_addr; recycle_rp_inst(ri, &empty_rp); if (orig_ret_address != trampoline_address) { @@ -409,7 +387,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, break; } } - + kretprobe_assert(ri, orig_ret_address, trampoline_address); regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; reset_current_kprobe(); @@ -487,6 +465,8 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) goto out; } reset_current_kprobe(); + if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) + local_irq_enable(); out: preempt_enable_no_resched(); @@ -502,7 +482,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) return 1; } -static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr) +int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) { struct kprobe *cur = kprobe_running(); struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); @@ -528,6 +508,8 @@ static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr) restore_previous_kprobe(kcb); else { reset_current_kprobe(); + if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) + local_irq_enable(); } preempt_enable_no_resched(); break; @@ -571,18 +553,6 @@ static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr) return 0; } -int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) -{ - int ret; - - if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) - local_irq_disable(); - ret = kprobe_trap_handler(regs, trapnr); - if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) - local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); - return ret; -} - /* * Wrapper routine to for handling exceptions. */ @@ -590,12 +560,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data) { struct die_args *args = (struct die_args *)data; - struct pt_regs *regs = args->regs; int ret = NOTIFY_DONE; - if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) - local_irq_disable(); - switch (val) { case DIE_BPT: if (kprobe_handler(args->regs)) @@ -606,17 +572,16 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, ret = NOTIFY_STOP; break; case DIE_TRAP: - if (!preemptible() && kprobe_running() && - kprobe_trap_handler(args->regs, args->trapnr)) + /* kprobe_running() needs smp_processor_id() */ + preempt_disable(); + if (kprobe_running() && + kprobe_fault_handler(args->regs, args->trapnr)) ret = NOTIFY_STOP; + preempt_enable(); break; default: break; } - - if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) - local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); - return ret; } @@ -630,7 +595,6 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) /* setup return addr to the jprobe handler routine */ regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; - regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); /* r14 is the function return address */ kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; diff --git a/trunk/arch/s390/mm/gup.c b/trunk/arch/s390/mm/gup.c index 45b405ca2567..38e641cdd977 100644 --- a/trunk/arch/s390/mm/gup.c +++ b/trunk/arch/s390/mm/gup.c @@ -20,17 +20,18 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, unsigned long end, int write, struct page **pages, int *nr) { - unsigned long mask; + unsigned long mask, result; pte_t *ptep, pte; struct page *page; - mask = (write ? _PAGE_RO : 0) | _PAGE_INVALID | _PAGE_SPECIAL; + result = write ? 0 : _PAGE_RO; + mask = result | _PAGE_INVALID | _PAGE_SPECIAL; ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); do { pte = *ptep; barrier(); - if ((pte_val(pte) & mask) != 0) + if ((pte_val(pte) & mask) != result) return 0; VM_BUG_ON(!pfn_valid(pte_pfn(pte))); page = pte_page(pte); diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c index 19835d39289d..3f91c01c217f 100644 --- a/trunk/drivers/ata/libata-scsi.c +++ b/trunk/drivers/ata/libata-scsi.c @@ -3183,7 +3183,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, * Return value from __ata_scsi_queuecmd() if @cmd can be queued, * 0 otherwise. */ -static int ata_scsi_queuecmd_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct ata_port *ap; struct ata_device *dev; @@ -3211,8 +3211,6 @@ static int ata_scsi_queuecmd_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi return rc; } -DEF_SCSI_QCMD(ata_scsi_queuecmd) - /** * ata_scsi_simulate - simulate SCSI command on ATA device * @dev: the target device diff --git a/trunk/drivers/base/power/main.c b/trunk/drivers/base/power/main.c index ead3e79d6fcf..31b526661ec4 100644 --- a/trunk/drivers/base/power/main.c +++ b/trunk/drivers/base/power/main.c @@ -475,33 +475,20 @@ static int device_resume_noirq(struct device *dev, pm_message_t state) */ void dpm_resume_noirq(pm_message_t state) { - struct list_head list; + struct device *dev; ktime_t starttime = ktime_get(); - INIT_LIST_HEAD(&list); mutex_lock(&dpm_list_mtx); transition_started = false; - while (!list_empty(&dpm_list)) { - struct device *dev = to_device(dpm_list.next); - - get_device(dev); + list_for_each_entry(dev, &dpm_list, power.entry) if (dev->power.status > DPM_OFF) { int error; dev->power.status = DPM_OFF; - mutex_unlock(&dpm_list_mtx); - error = device_resume_noirq(dev, state); - - mutex_lock(&dpm_list_mtx); if (error) pm_dev_err(dev, state, " early", error); } - if (!list_empty(&dev->power.entry)) - list_move_tail(&dev->power.entry, &list); - put_device(dev); - } - list_splice(&list, &dpm_list); mutex_unlock(&dpm_list_mtx); dpm_show_time(starttime, state, "early"); resume_device_irqs(); @@ -802,33 +789,20 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state) */ int dpm_suspend_noirq(pm_message_t state) { - struct list_head list; + struct device *dev; ktime_t starttime = ktime_get(); int error = 0; - INIT_LIST_HEAD(&list); suspend_device_irqs(); mutex_lock(&dpm_list_mtx); - while (!list_empty(&dpm_list)) { - struct device *dev = to_device(dpm_list.prev); - - get_device(dev); - mutex_unlock(&dpm_list_mtx); - + list_for_each_entry_reverse(dev, &dpm_list, power.entry) { error = device_suspend_noirq(dev, state); - - mutex_lock(&dpm_list_mtx); if (error) { pm_dev_err(dev, state, " late", error); - put_device(dev); break; } dev->power.status = DPM_OFF_IRQ; - if (!list_empty(&dev->power.entry)) - list_move(&dev->power.entry, &list); - put_device(dev); } - list_splice_tail(&list, &dpm_list); mutex_unlock(&dpm_list_mtx); if (error) dpm_resume_noirq(resume_event(state)); diff --git a/trunk/drivers/block/cciss_scsi.c b/trunk/drivers/block/cciss_scsi.c index 727d0225b7d0..575495f3c4b8 100644 --- a/trunk/drivers/block/cciss_scsi.c +++ b/trunk/drivers/block/cciss_scsi.c @@ -62,8 +62,8 @@ static int cciss_scsi_proc_info( int length, /* length of data in buffer */ int func); /* 0 == read, 1 == write */ -static int cciss_scsi_queue_command (struct Scsi_Host *h, - struct scsi_cmnd *cmd); +static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, + void (* done)(struct scsi_cmnd *)); static int cciss_eh_device_reset_handler(struct scsi_cmnd *); static int cciss_eh_abort_handler(struct scsi_cmnd *); @@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c, static int -cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) { ctlr_info_t *h; int rc; @@ -1504,8 +1504,6 @@ cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn return 0; } -static DEF_SCSI_QCMD(cciss_scsi_queue_command) - static void cciss_unregister_scsi(ctlr_info_t *h) { struct cciss_scsi_adapter_data_t *sa; diff --git a/trunk/drivers/firewire/sbp2.c b/trunk/drivers/firewire/sbp2.c index afa576a75a8e..bfae4b309791 100644 --- a/trunk/drivers/firewire/sbp2.c +++ b/trunk/drivers/firewire/sbp2.c @@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb, /* SCSI stack integration */ -static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done) +static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) { struct sbp2_logical_unit *lu = cmd->device->hostdata; struct fw_device *device = target_device(lu->tgt); @@ -1534,8 +1534,6 @@ static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done return retval; } -static DEF_SCSI_QCMD(sbp2_scsi_queuecommand) - static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) { struct sbp2_logical_unit *lu = sdev->hostdata; diff --git a/trunk/drivers/infiniband/ulp/srp/ib_srp.c b/trunk/drivers/infiniband/ulp/srp/ib_srp.c index 1e1e347a7715..cfc1d65c4577 100644 --- a/trunk/drivers/infiniband/ulp/srp/ib_srp.c +++ b/trunk/drivers/infiniband/ulp/srp/ib_srp.c @@ -1123,7 +1123,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) } } -static int srp_queuecommand_lck(struct scsi_cmnd *scmnd, +static int srp_queuecommand(struct scsi_cmnd *scmnd, void (*done)(struct scsi_cmnd *)) { struct srp_target_port *target = host_to_target(scmnd->device->host); @@ -1196,8 +1196,6 @@ static int srp_queuecommand_lck(struct scsi_cmnd *scmnd, return SCSI_MLQUEUE_HOST_BUSY; } -static DEF_SCSI_QCMD(srp_queuecommand) - static int srp_alloc_iu_bufs(struct srp_target_port *target) { int i; diff --git a/trunk/drivers/message/fusion/mptfc.c b/trunk/drivers/message/fusion/mptfc.c index d784c36707c0..e15220ff52fc 100644 --- a/trunk/drivers/message/fusion/mptfc.c +++ b/trunk/drivers/message/fusion/mptfc.c @@ -97,7 +97,8 @@ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; static int mptfc_target_alloc(struct scsi_target *starget); static int mptfc_slave_alloc(struct scsi_device *sdev); -static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); +static int mptfc_qcmd(struct scsi_cmnd *SCpnt, + void (*done)(struct scsi_cmnd *)); static void mptfc_target_destroy(struct scsi_target *starget); static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); static void __devexit mptfc_remove(struct pci_dev *pdev); @@ -649,7 +650,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) } static int -mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { struct mptfc_rport_info *ri; struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); @@ -680,8 +681,6 @@ mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) return mptscsih_qcmd(SCpnt,done); } -static DEF_SCSI_QCMD(mptfc_qcmd) - /* * mptfc_display_port_link_speed - displaying link speed * @ioc: Pointer to MPT_ADAPTER structure diff --git a/trunk/drivers/message/fusion/mptsas.c b/trunk/drivers/message/fusion/mptsas.c index d48c2c6058e1..83a5115f0251 100644 --- a/trunk/drivers/message/fusion/mptsas.c +++ b/trunk/drivers/message/fusion/mptsas.c @@ -1889,7 +1889,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) } static int -mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { MPT_SCSI_HOST *hd; MPT_ADAPTER *ioc; @@ -1913,8 +1913,6 @@ mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) return mptscsih_qcmd(SCpnt,done); } -static DEF_SCSI_QCMD(mptsas_qcmd) - /** * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout * if the device under question is currently in the diff --git a/trunk/drivers/message/fusion/mptspi.c b/trunk/drivers/message/fusion/mptspi.c index 6d9568d2ec59..0e2803155ae2 100644 --- a/trunk/drivers/message/fusion/mptspi.c +++ b/trunk/drivers/message/fusion/mptspi.c @@ -780,7 +780,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) } static int -mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); VirtDevice *vdevice = SCpnt->device->hostdata; @@ -805,8 +805,6 @@ mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) return mptscsih_qcmd(SCpnt,done); } -static DEF_SCSI_QCMD(mptspi_qcmd) - static void mptspi_slave_destroy(struct scsi_device *sdev) { struct scsi_target *starget = scsi_target(sdev); diff --git a/trunk/drivers/message/i2o/i2o_scsi.c b/trunk/drivers/message/i2o/i2o_scsi.c index 97bdf82ec905..ea6b2197da8a 100644 --- a/trunk/drivers/message/i2o/i2o_scsi.c +++ b/trunk/drivers/message/i2o/i2o_scsi.c @@ -506,7 +506,7 @@ static struct i2o_driver i2o_scsi_driver = { * Locks: takes the controller lock on error path only */ -static int i2o_scsi_queuecommand_lck(struct scsi_cmnd *SCpnt, +static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, void (*done) (struct scsi_cmnd *)) { struct i2o_controller *c; @@ -688,9 +688,7 @@ static int i2o_scsi_queuecommand_lck(struct scsi_cmnd *SCpnt, exit: return rc; -} - -static DEF_SCSI_QCMD(i2o_scsi_queuecommand) +}; /** * i2o_scsi_abort - abort a running command diff --git a/trunk/drivers/pci/pci-sysfs.c b/trunk/drivers/pci/pci-sysfs.c index 63d5042f2079..95712a375cd5 100644 --- a/trunk/drivers/pci/pci-sysfs.c +++ b/trunk/drivers/pci/pci-sysfs.c @@ -715,7 +715,7 @@ int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma, nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; start = vma->vm_pgoff; size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; - pci_start = (mmap_api == PCI_MMAP_PROCFS) ? + pci_start = (mmap_api == PCI_MMAP_SYSFS) ? pci_resource_start(pdev, resno) >> PAGE_SHIFT : 0; if (start >= pci_start && start < pci_start + size && start + nr <= pci_start + size) diff --git a/trunk/drivers/s390/char/tape_core.c b/trunk/drivers/s390/char/tape_core.c index b3a3e8e8656e..6c408670e08d 100644 --- a/trunk/drivers/s390/char/tape_core.c +++ b/trunk/drivers/s390/char/tape_core.c @@ -209,79 +209,29 @@ tape_state_set(struct tape_device *device, enum tape_state newstate) wake_up(&device->state_change_wq); } -struct tape_med_state_work_data { - struct tape_device *device; - enum tape_medium_state state; - struct work_struct work; -}; - -static void -tape_med_state_work_handler(struct work_struct *work) -{ - static char env_state_loaded[] = "MEDIUM_STATE=LOADED"; - static char env_state_unloaded[] = "MEDIUM_STATE=UNLOADED"; - struct tape_med_state_work_data *p = - container_of(work, struct tape_med_state_work_data, work); - struct tape_device *device = p->device; - char *envp[] = { NULL, NULL }; - - switch (p->state) { - case MS_UNLOADED: - pr_info("%s: The tape cartridge has been successfully " - "unloaded\n", dev_name(&device->cdev->dev)); - envp[0] = env_state_unloaded; - kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp); - break; - case MS_LOADED: - pr_info("%s: A tape cartridge has been mounted\n", - dev_name(&device->cdev->dev)); - envp[0] = env_state_loaded; - kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp); - break; - default: - break; - } - tape_put_device(device); - kfree(p); -} - -static void -tape_med_state_work(struct tape_device *device, enum tape_medium_state state) -{ - struct tape_med_state_work_data *p; - - p = kzalloc(sizeof(*p), GFP_ATOMIC); - if (p) { - INIT_WORK(&p->work, tape_med_state_work_handler); - p->device = tape_get_device(device); - p->state = state; - schedule_work(&p->work); - } -} - void tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate) { - enum tape_medium_state oldstate; - - oldstate = device->medium_state; - if (oldstate == newstate) + if (device->medium_state == newstate) return; - device->medium_state = newstate; switch(newstate){ case MS_UNLOADED: device->tape_generic_status |= GMT_DR_OPEN(~0); - if (oldstate == MS_LOADED) - tape_med_state_work(device, MS_UNLOADED); + if (device->medium_state == MS_LOADED) + pr_info("%s: The tape cartridge has been successfully " + "unloaded\n", dev_name(&device->cdev->dev)); break; case MS_LOADED: device->tape_generic_status &= ~GMT_DR_OPEN(~0); - if (oldstate == MS_UNLOADED) - tape_med_state_work(device, MS_LOADED); + if (device->medium_state == MS_UNLOADED) + pr_info("%s: A tape cartridge has been mounted\n", + dev_name(&device->cdev->dev)); break; default: + // print nothing break; } + device->medium_state = newstate; wake_up(&device->state_change_wq); } diff --git a/trunk/drivers/s390/char/vmlogrdr.c b/trunk/drivers/s390/char/vmlogrdr.c index 1cc726b98ec8..9f661426e4a1 100644 --- a/trunk/drivers/s390/char/vmlogrdr.c +++ b/trunk/drivers/s390/char/vmlogrdr.c @@ -249,25 +249,27 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, char cp_command[80]; char cp_response[160]; char *onoff, *qid_string; - int rc; - onoff = ((action == 1) ? "ON" : "OFF"); + memset(cp_command, 0x00, sizeof(cp_command)); + memset(cp_response, 0x00, sizeof(cp_response)); + + onoff = ((action == 1) ? "ON" : "OFF"); qid_string = ((recording_class_AB == 1) ? " QID * " : ""); - /* + /* * The recording commands needs to be called with option QID * for guests that have previlege classes A or B. * Purging has to be done as separate step, because recording * can't be switched on as long as records are on the queue. * Doing both at the same time doesn't work. */ - if (purge && (action == 1)) { - memset(cp_command, 0x00, sizeof(cp_command)); - memset(cp_response, 0x00, sizeof(cp_response)); + + if (purge) { snprintf(cp_command, sizeof(cp_command), "RECORDING %s PURGE %s", logptr->recording_name, qid_string); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); } @@ -277,33 +279,19 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, logptr->recording_name, onoff, qid_string); + cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); /* The recording command will usually answer with 'Command complete' * on success, but when the specific service was never connected * before then there might be an additional informational message * 'HCPCRC8072I Recording entry not found' before the - * 'Command complete'. So I use strstr rather then the strncmp. + * 'Command complete'. So I use strstr rather then the strncmp. */ if (strstr(cp_response,"Command complete")) - rc = 0; + return 0; else - rc = -EIO; - /* - * If we turn recording off, we have to purge any remaining records - * afterwards, as a large number of queued records may impact z/VM - * performance. - */ - if (purge && (action == 0)) { - memset(cp_command, 0x00, sizeof(cp_command)); - memset(cp_response, 0x00, sizeof(cp_response)); - snprintf(cp_command, sizeof(cp_command), - "RECORDING %s PURGE %s", - logptr->recording_name, - qid_string); - cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); - } + return -EIO; - return rc; } diff --git a/trunk/drivers/s390/cio/device.c b/trunk/drivers/s390/cio/device.c index e8391b89eff4..2ff8a22d4257 100644 --- a/trunk/drivers/s390/cio/device.c +++ b/trunk/drivers/s390/cio/device.c @@ -1455,16 +1455,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process) break; case IO_SCH_UNREG_ATTACH: case IO_SCH_UNREG: - if (!cdev) - break; - if (cdev->private->state == DEV_STATE_SENSE_ID) { - /* - * Note: delayed work triggered by this event - * and repeated calls to sch_event are synchronized - * by the above check for work_pending(cdev). - */ - dev_fsm_event(cdev, DEV_EVENT_NOTOPER); - } else + if (cdev) ccw_device_set_notoper(cdev); break; case IO_SCH_NOP: diff --git a/trunk/drivers/s390/scsi/zfcp_scsi.c b/trunk/drivers/s390/scsi/zfcp_scsi.c index 6bd2dbc4c316..50286d8707f3 100644 --- a/trunk/drivers/s390/scsi/zfcp_scsi.c +++ b/trunk/drivers/s390/scsi/zfcp_scsi.c @@ -76,7 +76,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) scpnt->scsi_done(scpnt); } -static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, +static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, void (*done) (struct scsi_cmnd *)) { struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); @@ -127,8 +127,6 @@ static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, return ret; } -static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) - static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); diff --git a/trunk/drivers/scsi/3w-9xxx.c b/trunk/drivers/scsi/3w-9xxx.c index b7bd5b0cc7aa..fcf08b3f52c1 100644 --- a/trunk/drivers/scsi/3w-9xxx.c +++ b/trunk/drivers/scsi/3w-9xxx.c @@ -1765,7 +1765,7 @@ static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt) } /* End twa_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { int request_id, retval; TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; @@ -1812,8 +1812,6 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ return retval; } /* End twa_scsi_queue() */ -static DEF_SCSI_QCMD(twa_scsi_queue) - /* This function hands scsi cdb's to the firmware */ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) { diff --git a/trunk/drivers/scsi/3w-sas.c b/trunk/drivers/scsi/3w-sas.c index 13e39e1fdfe2..6a95d111d207 100644 --- a/trunk/drivers/scsi/3w-sas.c +++ b/trunk/drivers/scsi/3w-sas.c @@ -1501,7 +1501,7 @@ static int twl_scsi_eh_reset(struct scsi_cmnd *SCpnt) } /* End twl_scsi_eh_reset() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +static int twl_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { int request_id, retval; TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; @@ -1536,8 +1536,6 @@ static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ return retval; } /* End twl_scsi_queue() */ -static DEF_SCSI_QCMD(twl_scsi_queue) - /* This function tells the controller to shut down */ static void __twl_shutdown(TW_Device_Extension *tw_dev) { diff --git a/trunk/drivers/scsi/3w-xxxx.c b/trunk/drivers/scsi/3w-xxxx.c index 7fe96ff60c58..b1125341f4c8 100644 --- a/trunk/drivers/scsi/3w-xxxx.c +++ b/trunk/drivers/scsi/3w-xxxx.c @@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r } /* End tw_scsiop_test_unit_ready_complete() */ /* This is the main scsi queue function to handle scsi opcodes */ -static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { unsigned char *command = SCpnt->cmnd; int request_id = 0; @@ -2023,8 +2023,6 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c return retval; } /* End tw_scsi_queue() */ -static DEF_SCSI_QCMD(tw_scsi_queue) - /* This function is the interrupt service routine */ static irqreturn_t tw_interrupt(int irq, void *dev_instance) { diff --git a/trunk/drivers/scsi/53c700.c b/trunk/drivers/scsi/53c700.c index f672491774eb..89fc1c8af86b 100644 --- a/trunk/drivers/scsi/53c700.c +++ b/trunk/drivers/scsi/53c700.c @@ -167,7 +167,7 @@ MODULE_LICENSE("GPL"); #include "53c700_d.h" -STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); +STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); @@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id) return IRQ_RETVAL(handled); } -static int -NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) +STATIC int +NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) { struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; @@ -1904,8 +1904,6 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *) return 0; } -STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) - STATIC int NCR_700_abort(struct scsi_cmnd * SCp) { diff --git a/trunk/drivers/scsi/BusLogic.c b/trunk/drivers/scsi/BusLogic.c index f66c33b9ab41..fc0b4b81d552 100644 --- a/trunk/drivers/scsi/BusLogic.c +++ b/trunk/drivers/scsi/BusLogic.c @@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt) Outgoing Mailbox for execution by the associated Host Adapter. */ -static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) +static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) { struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; @@ -2994,7 +2994,6 @@ static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*Completio return 0; } -static DEF_SCSI_QCMD(BusLogic_QueueCommand) #if 0 /* diff --git a/trunk/drivers/scsi/BusLogic.h b/trunk/drivers/scsi/BusLogic.h index 649fcb31f26d..73f237a1ed94 100644 --- a/trunk/drivers/scsi/BusLogic.h +++ b/trunk/drivers/scsi/BusLogic.h @@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co */ static const char *BusLogic_DriverInfo(struct Scsi_Host *); -static int BusLogic_QueueCommand(struct Scsi_Host *h, struct scsi_cmnd *); +static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *)); static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); static int BusLogic_SlaveConfigure(struct scsi_device *); diff --git a/trunk/drivers/scsi/NCR5380.c b/trunk/drivers/scsi/NCR5380.c index 9a5629f94f95..5d2f148889ad 100644 --- a/trunk/drivers/scsi/NCR5380.c +++ b/trunk/drivers/scsi/NCR5380.c @@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance) * Locks: host lock taken by caller */ -static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) +static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) { struct Scsi_Host *instance = cmd->device->host; struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; @@ -1021,7 +1021,6 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *) return 0; } -static DEF_SCSI_QCMD(NCR5380_queue_command) /** * NCR5380_main - NCR state machines diff --git a/trunk/drivers/scsi/NCR5380.h b/trunk/drivers/scsi/NCR5380.h index fd40a32b1f6f..bdc468c9e1d9 100644 --- a/trunk/drivers/scsi/NCR5380.h +++ b/trunk/drivers/scsi/NCR5380.h @@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance); #endif static int NCR5380_abort(Scsi_Cmnd * cmd); static int NCR5380_bus_reset(Scsi_Cmnd * cmd); -static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start, off_t offset, int length, int inout); diff --git a/trunk/drivers/scsi/NCR53c406a.c b/trunk/drivers/scsi/NCR53c406a.c index c91888a0a23c..6961f78742ae 100644 --- a/trunk/drivers/scsi/NCR53c406a.c +++ b/trunk/drivers/scsi/NCR53c406a.c @@ -693,7 +693,7 @@ static void wait_intr(void) } #endif -static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) +static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) { int i; @@ -726,8 +726,6 @@ static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) return 0; } -static DEF_SCSI_QCMD(NCR53c406a_queue) - static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) { DEB(printk("NCR53c406a_reset called\n")); diff --git a/trunk/drivers/scsi/a100u2w.c b/trunk/drivers/scsi/a100u2w.c index dc5ac6e528c4..dbbc601948e5 100644 --- a/trunk/drivers/scsi/a100u2w.c +++ b/trunk/drivers/scsi/a100u2w.c @@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc * queue the command down to the controller */ -static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) +static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) { struct orc_scb *scb; struct orc_host *host; /* Point to Host adapter control block */ @@ -930,8 +930,6 @@ static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_c return 0; } -static DEF_SCSI_QCMD(inia100_queue) - /***************************************************************************** Function name : inia100_abort Description : Abort a queued command. diff --git a/trunk/drivers/scsi/aacraid/linit.c b/trunk/drivers/scsi/aacraid/linit.c index 2c93d9496d62..29c0ed1cf507 100644 --- a/trunk/drivers/scsi/aacraid/linit.c +++ b/trunk/drivers/scsi/aacraid/linit.c @@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = { * TODO: unify with aac_scsi_cmd(). */ -static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct Scsi_Host *host = cmd->device->host; struct aac_dev *dev = (struct aac_dev *)host->hostdata; @@ -267,8 +267,6 @@ static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_ return (aac_scsi_cmd(cmd) ? FAILED : 0); } -static DEF_SCSI_QCMD(aac_queuecommand) - /** * aac_info - Returns the host adapter name * @shost: Scsi host to report on diff --git a/trunk/drivers/scsi/advansys.c b/trunk/drivers/scsi/advansys.c index 081c6de92bc5..0ec3da6f3e12 100644 --- a/trunk/drivers/scsi/advansys.c +++ b/trunk/drivers/scsi/advansys.c @@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) * in the 'scp' result field. */ static int -advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) +advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) { struct Scsi_Host *shost = scp->device->host; int asc_res, result = 0; @@ -9525,8 +9525,6 @@ advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd * return result; } -static DEF_SCSI_QCMD(advansys_queuecommand) - static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) { PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | diff --git a/trunk/drivers/scsi/aha152x.c b/trunk/drivers/scsi/aha152x.c index c5169f01c1cd..8eab8587ff21 100644 --- a/trunk/drivers/scsi/aha152x.c +++ b/trunk/drivers/scsi/aha152x.c @@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete, * queue a command * */ -static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) { #if 0 if(*SCpnt->cmnd == REQUEST_SENSE) { @@ -1070,8 +1070,6 @@ static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) return aha152x_internal_queue(SCpnt, NULL, 0, done); } -static DEF_SCSI_QCMD(aha152x_queue) - /* * diff --git a/trunk/drivers/scsi/aha1542.c b/trunk/drivers/scsi/aha1542.c index 195823a51aab..4f785f254c1f 100644 --- a/trunk/drivers/scsi/aha1542.c +++ b/trunk/drivers/scsi/aha1542.c @@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) }; } -static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) +static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) { unchar ahacmd = CMD_START_SCSI; unchar direction; @@ -718,8 +718,6 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * return 0; } -static DEF_SCSI_QCMD(aha1542_queuecommand) - /* Initialize mailboxes */ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) { diff --git a/trunk/drivers/scsi/aha1542.h b/trunk/drivers/scsi/aha1542.h index b871d2b57f93..1db538552d56 100644 --- a/trunk/drivers/scsi/aha1542.h +++ b/trunk/drivers/scsi/aha1542.h @@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ }; static int aha1542_detect(struct scsi_host_template *); -static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); static int aha1542_host_reset(Scsi_Cmnd * SCpnt); diff --git a/trunk/drivers/scsi/aha1740.c b/trunk/drivers/scsi/aha1740.c index d058f1ab82b5..0107a4cc3331 100644 --- a/trunk/drivers/scsi/aha1740.c +++ b/trunk/drivers/scsi/aha1740.c @@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id) return IRQ_RETVAL(handled); } -static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) +static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) { unchar direction; unchar *cmd = (unchar *) SCpnt->cmnd; @@ -503,8 +503,6 @@ static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *) return 0; } -static DEF_SCSI_QCMD(aha1740_queuecommand) - /* Query the board for its irq_level and irq_type. Nothing else matters in enhanced mode on an EISA bus. */ diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c index 25d066624476..88ad8482ef59 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host) * Queue an SCB to the controller. */ static int -ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) +ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) { struct ahd_softc *ahd; struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); @@ -588,8 +588,6 @@ ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd return rtn; } -static DEF_SCSI_QCMD(ahd_linux_queue) - static struct scsi_target ** ahd_linux_target_in_softc(struct scsi_target *starget) { diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c index 4a359bb307c6..aeea7a61478e 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host) * Queue an SCB to the controller. */ static int -ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) +ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) { struct ahc_softc *ahc; struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); @@ -548,8 +548,6 @@ ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd return rtn; } -static DEF_SCSI_QCMD(ahc_linux_queue) - static inline struct scsi_target ** ahc_linux_target_in_softc(struct scsi_target *starget) { diff --git a/trunk/drivers/scsi/aic7xxx_old.c b/trunk/drivers/scsi/aic7xxx_old.c index 4ff60a08df0f..aee73fafccc8 100644 --- a/trunk/drivers/scsi/aic7xxx_old.c +++ b/trunk/drivers/scsi/aic7xxx_old.c @@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd, * Description: * Queue a SCB to the controller. *-F*************************************************************************/ -static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) +static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) { struct aic7xxx_host *p; struct aic7xxx_scb *scb; @@ -10292,8 +10292,6 @@ static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd return (0); } -static DEF_SCSI_QCMD(aic7xxx_queue) - /*+F************************************************************************* * Function: * aic7xxx_bus_device_reset diff --git a/trunk/drivers/scsi/arcmsr/arcmsr_hba.c b/trunk/drivers/scsi/arcmsr/arcmsr_hba.c index 17e3df4f016f..05a78e515a24 100644 --- a/trunk/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/trunk/drivers/scsi/arcmsr/arcmsr_hba.c @@ -85,7 +85,8 @@ static int arcmsr_abort(struct scsi_cmnd *); static int arcmsr_bus_reset(struct scsi_cmnd *); static int arcmsr_bios_param(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int *info); -static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); +static int arcmsr_queue_command(struct scsi_cmnd *cmd, + void (*done) (struct scsi_cmnd *)); static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void arcmsr_remove(struct pci_dev *pdev); @@ -2080,7 +2081,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, } } -static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, +static int arcmsr_queue_command(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) { struct Scsi_Host *host = cmd->device->host; @@ -2123,8 +2124,6 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(arcmsr_queue_command) - static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) { struct MessageUnit_A __iomem *reg = acb->pmuA; diff --git a/trunk/drivers/scsi/arm/acornscsi.c b/trunk/drivers/scsi/arm/acornscsi.c index ec166726b314..918ccf818757 100644 --- a/trunk/drivers/scsi/arm/acornscsi.c +++ b/trunk/drivers/scsi/arm/acornscsi.c @@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id) * done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, +int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; @@ -2561,8 +2561,6 @@ static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, return 0; } -DEF_SCSI_QCMD(acornscsi_queuecmd) - /* * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 diff --git a/trunk/drivers/scsi/arm/fas216.c b/trunk/drivers/scsi/arm/fas216.c index 2b2ce21e227e..9e71ac611146 100644 --- a/trunk/drivers/scsi/arm/fas216.c +++ b/trunk/drivers/scsi/arm/fas216.c @@ -2198,7 +2198,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result) * Returns: 0 on success, else error. * Notes: io_request_lock is held, interrupts are disabled. */ -static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, +int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; @@ -2240,8 +2240,6 @@ static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, return result; } -DEF_SCSI_QCMD(fas216_queue_command) - /** * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command * @SCpnt: Command to wake @@ -2265,7 +2263,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt) * Returns: scsi result code. * Notes: io_request_lock is held, interrupts are disabled. */ -static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, +int fas216_noqueue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; @@ -2279,7 +2277,7 @@ static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, BUG_ON(info->scsi.irq != NO_IRQ); info->internal_done = 0; - fas216_queue_command_lck(SCpnt, fas216_internal_done); + fas216_queue_command(SCpnt, fas216_internal_done); /* * This wastes time, since we can't return until the command is @@ -2312,8 +2310,6 @@ static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, return 0; } -DEF_SCSI_QCMD(fas216_noqueue_command) - /* * Error handler timeout function. Indicate that we timed out, * and wake up any error handler process so it can continue. diff --git a/trunk/drivers/scsi/arm/fas216.h b/trunk/drivers/scsi/arm/fas216.h index 377cfb72cc66..b65f4cf0eec9 100644 --- a/trunk/drivers/scsi/arm/fas216.h +++ b/trunk/drivers/scsi/arm/fas216.h @@ -331,21 +331,23 @@ extern int fas216_init (struct Scsi_Host *instance); */ extern int fas216_add (struct Scsi_Host *instance, struct device *dev); -/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) +/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process. - * Params : h - host adapter - * : SCpnt - Command to queue + * Params : SCpnt - Command to queue + * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); +extern int fas216_queue_command(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); -/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) +/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process, and process it to completion. - * Params : h - host adapter - * : SCpnt - Command to queue + * Params : SCpnt - Command to queue + * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *) +extern int fas216_noqueue_command(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); /* Function: irqreturn_t fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command diff --git a/trunk/drivers/scsi/atari_NCR5380.c b/trunk/drivers/scsi/atari_NCR5380.c index 88b2928b4d3b..158ebc3644d8 100644 --- a/trunk/drivers/scsi/atari_NCR5380.c +++ b/trunk/drivers/scsi/atari_NCR5380.c @@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags) * */ -static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) { SETUP_HOSTDATA(cmd->device->host); Scsi_Cmnd *tmp; @@ -1022,8 +1022,6 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) return 0; } -static DEF_SCSI_QCMD(NCR5380_queue_command) - /* * Function : NCR5380_main (void) * diff --git a/trunk/drivers/scsi/atari_scsi.c b/trunk/drivers/scsi/atari_scsi.c index 3e8658e2f154..ad7a23aef0ec 100644 --- a/trunk/drivers/scsi/atari_scsi.c +++ b/trunk/drivers/scsi/atari_scsi.c @@ -572,6 +572,23 @@ static void falcon_get_lock(void) } +/* This is the wrapper function for NCR5380_queue_command(). It just + * tries to get the lock on the ST-DMA (see above) and then calls the + * original function. + */ + +#if 0 +int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +{ + /* falcon_get_lock(); + * ++guenther: moved to NCR5380_queue_command() to prevent + * race condition, see there for an explanation. + */ + return NCR5380_queue_command(cmd, done); +} +#endif + + int __init atari_scsi_detect(struct scsi_host_template *host) { static int called = 0; diff --git a/trunk/drivers/scsi/atp870u.c b/trunk/drivers/scsi/atp870u.c index 76029d570beb..ab5bdda6903e 100644 --- a/trunk/drivers/scsi/atp870u.c +++ b/trunk/drivers/scsi/atp870u.c @@ -605,7 +605,7 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id) * * Queue a command to the ATP queue. Called with the host lock held. */ -static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, +static int atp870u_queuecommand(struct scsi_cmnd * req_p, void (*done) (struct scsi_cmnd *)) { unsigned char c; @@ -694,8 +694,6 @@ static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, return 0; } -static DEF_SCSI_QCMD(atp870u_queuecommand) - /** * send_s870 - send a command to the controller * @host: host diff --git a/trunk/drivers/scsi/bfa/bfad_im.c b/trunk/drivers/scsi/bfa/bfad_im.c index 8ca967dee66d..8daa716739d1 100644 --- a/trunk/drivers/scsi/bfa/bfad_im.c +++ b/trunk/drivers/scsi/bfa/bfad_im.c @@ -30,7 +30,8 @@ DEFINE_IDR(bfad_im_port_index); struct scsi_transport_template *bfad_im_scsi_transport_template; struct scsi_transport_template *bfad_im_scsi_vport_transport_template; static void bfad_im_itnim_work_handler(struct work_struct *work); -static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd); +static int bfad_im_queuecommand(struct scsi_cmnd *cmnd, + void (*done)(struct scsi_cmnd *)); static int bfad_im_slave_alloc(struct scsi_device *sdev); static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim); @@ -1119,7 +1120,7 @@ bfad_im_itnim_work_handler(struct work_struct *work) * Scsi_Host template entry, queue a SCSI command to the BFAD. */ static int -bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) +bfad_im_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) { struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; @@ -1186,8 +1187,6 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd return 0; } -static DEF_SCSI_QCMD(bfad_im_queuecommand) - void bfad_os_rport_online_wait(struct bfad_s *bfad) { diff --git a/trunk/drivers/scsi/dc395x.c b/trunk/drivers/scsi/dc395x.c index 8f1b5c8bf903..54f50b07dac7 100644 --- a/trunk/drivers/scsi/dc395x.c +++ b/trunk/drivers/scsi/dc395x.c @@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, * and is expected to be held on return. * **/ -static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct DeviceCtlBlk *dcb; struct ScsiReqBlk *srb; @@ -1154,7 +1154,6 @@ static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct s return 0; } -static DEF_SCSI_QCMD(dc395x_queue_command) /* * Return the disk geometry for the given SCSI device. diff --git a/trunk/drivers/scsi/dpt_i2o.c b/trunk/drivers/scsi/dpt_i2o.c index cffcb108ac96..23dec0063385 100644 --- a/trunk/drivers/scsi/dpt_i2o.c +++ b/trunk/drivers/scsi/dpt_i2o.c @@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device) return 0; } -static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) +static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) { adpt_hba* pHba = NULL; struct adpt_device* pDev = NULL; /* dpt per device information */ @@ -491,8 +491,6 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd return adpt_scsi_to_i2o(pHba, cmd, pDev); } -static DEF_SCSI_QCMD(adpt_queue) - static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, sector_t capacity, int geom[]) { diff --git a/trunk/drivers/scsi/dpti.h b/trunk/drivers/scsi/dpti.h index beded716f93f..337746d46043 100644 --- a/trunk/drivers/scsi/dpti.h +++ b/trunk/drivers/scsi/dpti.h @@ -29,7 +29,7 @@ */ static int adpt_detect(struct scsi_host_template * sht); -static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd); +static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); static int adpt_abort(struct scsi_cmnd * cmd); static int adpt_reset(struct scsi_cmnd* cmd); static int adpt_release(struct Scsi_Host *host); diff --git a/trunk/drivers/scsi/dtc.h b/trunk/drivers/scsi/dtc.h index cdc621204b66..0b205f8c7326 100644 --- a/trunk/drivers/scsi/dtc.h +++ b/trunk/drivers/scsi/dtc.h @@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *); static int dtc_biosparam(struct scsi_device *, struct block_device *, sector_t, int*); static int dtc_detect(struct scsi_host_template *); -static int dtc_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int dtc_bus_reset(Scsi_Cmnd *); #ifndef CMD_PER_LUN diff --git a/trunk/drivers/scsi/eata.c b/trunk/drivers/scsi/eata.c index 53925ac178fd..d1c31378f6da 100644 --- a/trunk/drivers/scsi/eata.c +++ b/trunk/drivers/scsi/eata.c @@ -505,7 +505,8 @@ static int eata2x_detect(struct scsi_host_template *); static int eata2x_release(struct Scsi_Host *); -static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int eata2x_queuecommand(struct scsi_cmnd *, + void (*done) (struct scsi_cmnd *)); static int eata2x_eh_abort(struct scsi_cmnd *); static int eata2x_eh_host_reset(struct scsi_cmnd *); static int eata2x_bios_param(struct scsi_device *, struct block_device *, @@ -1757,7 +1758,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha) } -static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, +static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, void (*done) (struct scsi_cmnd *)) { struct Scsi_Host *shost = SCpnt->device->host; @@ -1842,8 +1843,6 @@ static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, return 0; } -static DEF_SCSI_QCMD(eata2x_queuecommand) - static int eata2x_eh_abort(struct scsi_cmnd *SCarg) { struct Scsi_Host *shost = SCarg->device->host; diff --git a/trunk/drivers/scsi/eata_pio.c b/trunk/drivers/scsi/eata_pio.c index 4a9641e69f54..60886c19065e 100644 --- a/trunk/drivers/scsi/eata_pio.c +++ b/trunk/drivers/scsi/eata_pio.c @@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned ch return 0; } -static int eata_pio_queue_lck(struct scsi_cmnd *cmd, +static int eata_pio_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { unsigned int x, y; @@ -438,8 +438,6 @@ static int eata_pio_queue_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(eata_pio_queue) - static int eata_pio_abort(struct scsi_cmnd *cmd) { unsigned int loop = 100; diff --git a/trunk/drivers/scsi/esp_scsi.c b/trunk/drivers/scsi/esp_scsi.c index 57558523c1b8..e2bc779f86c1 100644 --- a/trunk/drivers/scsi/esp_scsi.c +++ b/trunk/drivers/scsi/esp_scsi.c @@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent) scsi_track_queue_full(dev, lp->num_tagged - 1); } -static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct scsi_device *dev = cmd->device; struct esp *esp = shost_priv(dev->host); @@ -941,8 +941,6 @@ static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_ return 0; } -static DEF_SCSI_QCMD(esp_queuecommand) - static int esp_check_gross_error(struct esp *esp) { if (esp->sreg & ESP_STAT_SPAM) { diff --git a/trunk/drivers/scsi/fd_mcs.c b/trunk/drivers/scsi/fd_mcs.c index a2c6135d337e..2ad95aa8f585 100644 --- a/trunk/drivers/scsi/fd_mcs.c +++ b/trunk/drivers/scsi/fd_mcs.c @@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt) return 0; } -static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) +static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) { struct Scsi_Host *shpnt = SCpnt->device->host; @@ -1122,8 +1122,6 @@ static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) return 0; } -static DEF_SCSI_QCMD(fd_mcs_queue) - #if DEBUG_ABORT || DEBUG_RESET static void fd_mcs_print_info(Scsi_Cmnd * SCpnt) { diff --git a/trunk/drivers/scsi/fdomain.c b/trunk/drivers/scsi/fdomain.c index 69b7aa54f43f..e296bcc57d5c 100644 --- a/trunk/drivers/scsi/fdomain.c +++ b/trunk/drivers/scsi/fdomain.c @@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id) return IRQ_HANDLED; } -static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, +static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { if (in_command) { @@ -1469,8 +1469,6 @@ static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, return 0; } -static DEF_SCSI_QCMD(fdomain_16x0_queue) - #if DEBUG_ABORT static void print_info(struct scsi_cmnd *SCpnt) { diff --git a/trunk/drivers/scsi/fnic/fnic.h b/trunk/drivers/scsi/fnic/fnic.h index 92f185081e62..cbb20b13b228 100644 --- a/trunk/drivers/scsi/fnic/fnic.h +++ b/trunk/drivers/scsi/fnic/fnic.h @@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *); void fnic_update_mac(struct fc_lport *, u8 *new); void fnic_update_mac_locked(struct fnic *, u8 *new); -int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +int fnic_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); int fnic_abort_cmd(struct scsi_cmnd *); int fnic_device_reset(struct scsi_cmnd *); int fnic_host_reset(struct scsi_cmnd *); diff --git a/trunk/drivers/scsi/fnic/fnic_scsi.c b/trunk/drivers/scsi/fnic/fnic_scsi.c index 22d02404d15f..198cbab3e894 100644 --- a/trunk/drivers/scsi/fnic/fnic_scsi.c +++ b/trunk/drivers/scsi/fnic/fnic_scsi.c @@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, * Routine to send a scsi cdb * Called with host_lock held and interrupts disabled. */ -static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) { struct fc_lport *lp; struct fc_rport *rport; @@ -457,8 +457,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ return ret; } -DEF_SCSI_QCMD(fnic_queuecommand) - /* * fnic_fcpio_fw_reset_cmpl_handler * Routine to handle fw reset completion diff --git a/trunk/drivers/scsi/g_NCR5380.h b/trunk/drivers/scsi/g_NCR5380.h index 1bcdb7beb77b..921764c9ab24 100644 --- a/trunk/drivers/scsi/g_NCR5380.h +++ b/trunk/drivers/scsi/g_NCR5380.h @@ -46,7 +46,7 @@ static int generic_NCR5380_abort(Scsi_Cmnd *); static int generic_NCR5380_detect(struct scsi_host_template *); static int generic_NCR5380_release_resources(struct Scsi_Host *); -static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int generic_NCR5380_bus_reset(Scsi_Cmnd *); static const char* generic_NCR5380_info(struct Scsi_Host *); diff --git a/trunk/drivers/scsi/gdth.c b/trunk/drivers/scsi/gdth.c index 76365700e2d5..841101846b88 100644 --- a/trunk/drivers/scsi/gdth.c +++ b/trunk/drivers/scsi/gdth.c @@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); static void gdth_flush(gdth_ha_str *ha); -static int gdth_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); +static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, struct gdth_cmndinfo *cmndinfo); static void gdth_scsi_done(struct scsi_cmnd *scp); @@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se } -static int gdth_queuecommand_lck(struct scsi_cmnd *scp, +static int gdth_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) { gdth_ha_str *ha = shost_priv(scp->device->host); @@ -4022,8 +4022,6 @@ static int gdth_queuecommand_lck(struct scsi_cmnd *scp, return __gdth_queuecommand(ha, scp, cmndinfo); } -static DEF_SCSI_QCMD(gdth_queuecommand) - static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, struct gdth_cmndinfo *cmndinfo) { diff --git a/trunk/drivers/scsi/hpsa.c b/trunk/drivers/scsi/hpsa.c index 3759d1199b0c..c5d0606ad097 100644 --- a/trunk/drivers/scsi/hpsa.c +++ b/trunk/drivers/scsi/hpsa.c @@ -143,7 +143,8 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, int cmd_type); -static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); +static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, + void (*done)(struct scsi_cmnd *)); static void hpsa_scan_start(struct Scsi_Host *); static int hpsa_scan_finished(struct Scsi_Host *sh, unsigned long elapsed_time); @@ -1925,7 +1926,7 @@ static int hpsa_scatter_gather(struct ctlr_info *h, } -static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, +static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct ctlr_info *h; @@ -2019,8 +2020,6 @@ static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(hpsa_scsi_queue_command) - static void hpsa_scan_start(struct Scsi_Host *sh) { struct ctlr_info *h = shost_to_hba(sh); diff --git a/trunk/drivers/scsi/hptiop.c b/trunk/drivers/scsi/hptiop.c index 10b65556937b..0729f150b33a 100644 --- a/trunk/drivers/scsi/hptiop.c +++ b/trunk/drivers/scsi/hptiop.c @@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba, MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); } -static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, +static int hptiop_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) { struct Scsi_Host *host = scp->device->host; @@ -819,8 +819,6 @@ static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, return 0; } -static DEF_SCSI_QCMD(hptiop_queuecommand) - static const char *hptiop_info(struct Scsi_Host *host) { return driver_name_long; diff --git a/trunk/drivers/scsi/ibmmca.c b/trunk/drivers/scsi/ibmmca.c index 67fc8ffd52e6..9a4b69d4f4eb 100644 --- a/trunk/drivers/scsi/ibmmca.c +++ b/trunk/drivers/scsi/ibmmca.c @@ -39,7 +39,7 @@ #include /* Common forward declarations for all Linux-versions: */ -static int ibmmca_queuecommand (struct Scsi_Host *, struct scsi_cmnd *); +static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); static int ibmmca_abort (Scsi_Cmnd *); static int ibmmca_host_reset (Scsi_Cmnd *); static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); @@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev) } /* The following routine is the SCSI command queue for the midlevel driver */ -static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) +static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) { unsigned int ldn; unsigned int scsi_cmd; @@ -1996,8 +1996,6 @@ static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) return 0; } -static DEF_SCSI_QCMD(ibmmca_queuecommand) - static int __ibmmca_abort(Scsi_Cmnd * cmd) { /* Abort does not work, as the adapter never generates an interrupt on diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvfc.c b/trunk/drivers/scsi/ibmvscsi/ibmvfc.c index 57cad7e20caa..00d08b25425f 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost) * Returns: * 0 on success / other on failure **/ -static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, +static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) { struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); @@ -1672,8 +1672,6 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, return 0; } -static DEF_SCSI_QCMD(ibmvfc_queuecommand) - /** * ibmvfc_sync_completion - Signal that a synchronous command has completed * @evt: ibmvfc event struct diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c index 041958453e2a..67f78a470f5f 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev) * @cmd: struct scsi_cmnd to be executed * @done: Callback function to be called when cmd is completed */ -static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, +static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) { struct srp_cmd *srp_cmd; @@ -766,8 +766,6 @@ static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); } -static DEF_SCSI_QCMD(ibmvscsi_queuecommand) - /* ------------------------------------------------------------ * Routines for driver initialization */ diff --git a/trunk/drivers/scsi/imm.c b/trunk/drivers/scsi/imm.c index 99aa0e5699bc..4734ab0b3ff6 100644 --- a/trunk/drivers/scsi/imm.c +++ b/trunk/drivers/scsi/imm.c @@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) return 0; } -static int imm_queuecommand_lck(struct scsi_cmnd *cmd, +static int imm_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { imm_struct *dev = imm_dev(cmd->device->host); @@ -949,8 +949,6 @@ static int imm_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(imm_queuecommand) - /* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really diff --git a/trunk/drivers/scsi/in2000.c b/trunk/drivers/scsi/in2000.c index 6568aab745a0..52bdc6df6b92 100644 --- a/trunk/drivers/scsi/in2000.c +++ b/trunk/drivers/scsi/in2000.c @@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset) static void in2000_execute(struct Scsi_Host *instance); -static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) +static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) { struct Scsi_Host *instance; struct IN2000_hostdata *hostdata; @@ -431,8 +431,6 @@ static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) return 0; } -static DEF_SCSI_QCMD(in2000_queuecommand) - /* diff --git a/trunk/drivers/scsi/in2000.h b/trunk/drivers/scsi/in2000.h index 5821e1fbce08..0fb8b06b8392 100644 --- a/trunk/drivers/scsi/in2000.h +++ b/trunk/drivers/scsi/in2000.h @@ -396,7 +396,7 @@ struct IN2000_hostdata { flags) static int in2000_detect(struct scsi_host_template *) in2000__INIT; -static int in2000_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int in2000_abort(Scsi_Cmnd *); static void in2000_setup(char *, int *) in2000__INIT; static int in2000_biosparam(struct scsi_device *, struct block_device *, diff --git a/trunk/drivers/scsi/initio.c b/trunk/drivers/scsi/initio.c index 9627d062e16b..108797761b95 100644 --- a/trunk/drivers/scsi/initio.c +++ b/trunk/drivers/scsi/initio.c @@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c * will cause the mid layer to call us again later with the command) */ -static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, +static int i91u_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; @@ -2656,8 +2656,6 @@ static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(i91u_queuecommand) - /** * i91u_bus_reset - reset the SCSI bus * @cmnd: Command block we want to trigger the reset for diff --git a/trunk/drivers/scsi/ipr.c b/trunk/drivers/scsi/ipr.c index 5bbaee597e88..fa60d7df44be 100644 --- a/trunk/drivers/scsi/ipr.c +++ b/trunk/drivers/scsi/ipr.c @@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd) * SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy **/ -static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd, +static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd, void (*done) (struct scsi_cmnd *)) { struct ipr_ioa_cfg *ioa_cfg; @@ -5792,8 +5792,6 @@ static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd, return 0; } -static DEF_SCSI_QCMD(ipr_queuecommand) - /** * ipr_ioctl - IOCTL handler * @sdev: scsi device struct diff --git a/trunk/drivers/scsi/ips.c b/trunk/drivers/scsi/ips.c index b2511acd39bd..f83a116955f2 100644 --- a/trunk/drivers/scsi/ips.c +++ b/trunk/drivers/scsi/ips.c @@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *); static int ips_release(struct Scsi_Host *); static int ips_eh_abort(struct scsi_cmnd *); static int ips_eh_reset(struct scsi_cmnd *); -static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *); +static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *)); static const char *ips_info(struct Scsi_Host *); static irqreturn_t do_ipsintr(int, void *); static int ips_hainit(ips_ha_t *); @@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC) /* Linux obtains io_request_lock before calling this function */ /* */ /****************************************************************************/ -static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) +static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) { ips_ha_t *ha; ips_passthru_t *pt; @@ -1137,8 +1137,6 @@ static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *) return (0); } -static DEF_SCSI_QCMD(ips_queue) - /****************************************************************************/ /* */ /* Routine Name: ips_biosparam */ diff --git a/trunk/drivers/scsi/libfc/fc_fcp.c b/trunk/drivers/scsi/libfc/fc_fcp.c index 2924363d142b..e340373b509b 100644 --- a/trunk/drivers/scsi/libfc/fc_fcp.c +++ b/trunk/drivers/scsi/libfc/fc_fcp.c @@ -1753,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport) * This is the i/o strategy routine, called by the SCSI layer. This routine * is called with the host_lock held. */ -static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) +int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) { struct fc_lport *lport; struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); @@ -1851,8 +1851,6 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs spin_lock_irq(lport->host->host_lock); return rc; } - -DEF_SCSI_QCMD(fc_queuecommand) EXPORT_SYMBOL(fc_queuecommand); /** diff --git a/trunk/drivers/scsi/libiscsi.c b/trunk/drivers/scsi/libiscsi.c index c15fde808c33..633e09036357 100644 --- a/trunk/drivers/scsi/libiscsi.c +++ b/trunk/drivers/scsi/libiscsi.c @@ -1599,7 +1599,7 @@ enum { FAILURE_SESSION_NOT_READY, }; -static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) +int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) { struct iscsi_cls_session *cls_session; struct Scsi_Host *host; @@ -1736,8 +1736,6 @@ static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi spin_lock(host->host_lock); return 0; } - -DEF_SCSI_QCMD(iscsi_queuecommand) EXPORT_SYMBOL_GPL(iscsi_queuecommand); int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason) diff --git a/trunk/drivers/scsi/libsas/sas_scsi_host.c b/trunk/drivers/scsi/libsas/sas_scsi_host.c index 29251fabecc6..55f09e92ab59 100644 --- a/trunk/drivers/scsi/libsas/sas_scsi_host.c +++ b/trunk/drivers/scsi/libsas/sas_scsi_host.c @@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task) * Note: XXX: Remove the host unlock/lock pair when SCSI Core can * call us without holding an IRQ spinlock... */ -static int sas_queuecommand_lck(struct scsi_cmnd *cmd, +int sas_queuecommand(struct scsi_cmnd *cmd, void (*scsi_done)(struct scsi_cmnd *)) __releases(host->host_lock) __acquires(dev->sata_dev.ap->lock) @@ -254,8 +254,6 @@ static int sas_queuecommand_lck(struct scsi_cmnd *cmd, return res; } -DEF_SCSI_QCMD(sas_queuecommand) - static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) { struct sas_task *task = TO_SAS_TASK(cmd); diff --git a/trunk/drivers/scsi/lpfc/lpfc_scsi.c b/trunk/drivers/scsi/lpfc/lpfc_scsi.c index 581837b3c71a..f64b65a770b8 100644 --- a/trunk/drivers/scsi/lpfc/lpfc_scsi.c +++ b/trunk/drivers/scsi/lpfc/lpfc_scsi.c @@ -2899,7 +2899,7 @@ void lpfc_poll_timeout(unsigned long ptr) * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. **/ static int -lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) +lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) { struct Scsi_Host *shost = cmnd->device->host; struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; @@ -3060,8 +3060,6 @@ lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) return 0; } -static DEF_SCSI_QCMD(lpfc_queuecommand) - /** * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point * @cmnd: Pointer to scsi_cmnd data structure. diff --git a/trunk/drivers/scsi/mac53c94.c b/trunk/drivers/scsi/mac53c94.c index 6c42dff0f4d3..3ddb4dc62d5d 100644 --- a/trunk/drivers/scsi/mac53c94.c +++ b/trunk/drivers/scsi/mac53c94.c @@ -66,7 +66,7 @@ static void cmd_done(struct fsc_state *, int result); static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); -static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct fsc_state *state; @@ -99,8 +99,6 @@ static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cm return 0; } -static DEF_SCSI_QCMD(mac53c94_queue) - static int mac53c94_host_reset(struct scsi_cmnd *cmd) { struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata; diff --git a/trunk/drivers/scsi/megaraid.c b/trunk/drivers/scsi/megaraid.c index 9aa048525eb2..7ceb5cf12c6b 100644 --- a/trunk/drivers/scsi/megaraid.c +++ b/trunk/drivers/scsi/megaraid.c @@ -366,7 +366,7 @@ mega_runpendq(adapter_t *adapter) * The command queuing entry point for the mid-layer. */ static int -megaraid_queue_lck(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) +megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) { adapter_t *adapter; scb_t *scb; @@ -409,8 +409,6 @@ megaraid_queue_lck(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) return busy; } -static DEF_SCSI_QCMD(megaraid_queue) - /** * mega_allocate_scb() * @adapter - pointer to our soft state @@ -4458,7 +4456,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) scb->idx = CMDID_INT_CMDS; - megaraid_queue_lck(scmd, mega_internal_done); + megaraid_queue(scmd, mega_internal_done); wait_for_completion(&adapter->int_waitq); diff --git a/trunk/drivers/scsi/megaraid.h b/trunk/drivers/scsi/megaraid.h index f5644745e24e..2b4a048cadf1 100644 --- a/trunk/drivers/scsi/megaraid.h +++ b/trunk/drivers/scsi/megaraid.h @@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *); static int issue_scb(adapter_t *, scb_t *); static int mega_setup_mailbox(adapter_t *); -static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *); +static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); static void __mega_runpendq(adapter_t *); static int issue_scb_block(adapter_t *, u_char *); diff --git a/trunk/drivers/scsi/megaraid/megaraid_mbox.c b/trunk/drivers/scsi/megaraid/megaraid_mbox.c index 5708cb27d078..a7810a106b37 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mbox.c +++ b/trunk/drivers/scsi/megaraid/megaraid_mbox.c @@ -113,7 +113,8 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *); static void megaraid_mbox_display_scb(adapter_t *, scb_t *); static void megaraid_mbox_setup_device_map(adapter_t *); -static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int megaraid_queue_command(struct scsi_cmnd *, + void (*)(struct scsi_cmnd *)); static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); static void megaraid_mbox_runpendq(adapter_t *, scb_t *); static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, @@ -1483,7 +1484,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb) * Queue entry point for mailbox based controllers. */ static int -megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) +megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) { adapter_t *adapter; scb_t *scb; @@ -1512,8 +1513,6 @@ megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd return if_busy; } -static DEF_SCSI_QCMD(megaraid_queue_command) - /** * megaraid_mbox_build_cmd - transform the mid-layer scsi commands * @adapter : controller's soft state diff --git a/trunk/drivers/scsi/megaraid/megaraid_sas.c b/trunk/drivers/scsi/megaraid/megaraid_sas.c index 7451bc096a01..eb29d5085131 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_sas.c +++ b/trunk/drivers/scsi/megaraid/megaraid_sas.c @@ -1334,7 +1334,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance) * @done: Callback entry point */ static int -megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) +megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) { u32 frame_count; struct megasas_cmd *cmd; @@ -1417,8 +1417,6 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd return 0; } -static DEF_SCSI_QCMD(megasas_queue_command) - static struct megasas_instance *megasas_lookup_instance(u16 host_no) { int i; diff --git a/trunk/drivers/scsi/mesh.c b/trunk/drivers/scsi/mesh.c index 197aa1b3f0f3..1f784fde2510 100644 --- a/trunk/drivers/scsi/mesh.c +++ b/trunk/drivers/scsi/mesh.c @@ -1627,7 +1627,7 @@ static void cmd_complete(struct mesh_state *ms) * Called by midlayer with host locked to queue a new * request */ -static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct mesh_state *ms; @@ -1648,8 +1648,6 @@ static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd * return 0; } -static DEF_SCSI_QCMD(mesh_queue) - /* * Called to handle interrupts, either call by the interrupt * handler (do_mesh_interrupt) or by other functions in diff --git a/trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 1a96a00418a4..16e99b686354 100644 --- a/trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c @@ -3315,7 +3315,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full */ static int -_scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) +_scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) { struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); struct MPT2SAS_DEVICE *sas_device_priv_data; @@ -3441,8 +3441,6 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) return SCSI_MLQUEUE_HOST_BUSY; } -static DEF_SCSI_QCMD(_scsih_qcmd) - /** * _scsih_normalize_sense - normalize descriptor and fixed format sense data * @sense_buffer: sense data returned by target diff --git a/trunk/drivers/scsi/ncr53c8xx.c b/trunk/drivers/scsi/ncr53c8xx.c index 46cc3825638d..d013a2aa2fd5 100644 --- a/trunk/drivers/scsi/ncr53c8xx.c +++ b/trunk/drivers/scsi/ncr53c8xx.c @@ -8029,7 +8029,7 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device) return 0; } -static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) { struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; unsigned long flags; @@ -8068,8 +8068,6 @@ printk("ncr53c8xx : command successfully queued\n"); return sts; } -static DEF_SCSI_QCMD(ncr53c8xx_queue_command) - irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) { unsigned long flags; diff --git a/trunk/drivers/scsi/nsp32.c b/trunk/drivers/scsi/nsp32.c index 6b8b021400f8..4c1e54545200 100644 --- a/trunk/drivers/scsi/nsp32.c +++ b/trunk/drivers/scsi/nsp32.c @@ -196,7 +196,8 @@ static void __exit exit_nsp32 (void); static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); static int nsp32_detect (struct pci_dev *pdev); -static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int nsp32_queuecommand(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); static const char *nsp32_info (struct Scsi_Host *); static int nsp32_release (struct Scsi_Host *); @@ -908,7 +909,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt) return TRUE; } -static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_target *target; @@ -1049,8 +1050,6 @@ static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct s return 0; } -static DEF_SCSI_QCMD(nsp32_queuecommand) - /* initialize asic */ static int nsp32hw_init(nsp32_hw_data *data) { diff --git a/trunk/drivers/scsi/pas16.h b/trunk/drivers/scsi/pas16.h index a04281cace2e..8dc5b1a5f5da 100644 --- a/trunk/drivers/scsi/pas16.h +++ b/trunk/drivers/scsi/pas16.h @@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *); static int pas16_biosparam(struct scsi_device *, struct block_device *, sector_t, int*); static int pas16_detect(struct scsi_host_template *); -static int pas16_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int pas16_bus_reset(Scsi_Cmnd *); #ifndef CMD_PER_LUN diff --git a/trunk/drivers/scsi/pcmcia/nsp_cs.c b/trunk/drivers/scsi/pcmcia/nsp_cs.c index be3f33d31a99..9326c2c14880 100644 --- a/trunk/drivers/scsi/pcmcia/nsp_cs.c +++ b/trunk/drivers/scsi/pcmcia/nsp_cs.c @@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) SCpnt->scsi_done(SCpnt); } -static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, +static int nsp_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { #ifdef NSP_DEBUG @@ -264,8 +264,6 @@ static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, return 0; } -static DEF_SCSI_QCMD(nsp_queuecommand) - /* * setup PIO FIFO transfer mode and enable/disable to data out */ diff --git a/trunk/drivers/scsi/pcmcia/nsp_cs.h b/trunk/drivers/scsi/pcmcia/nsp_cs.h index 7fc9a9d0a448..d68c9f267c5e 100644 --- a/trunk/drivers/scsi/pcmcia/nsp_cs.h +++ b/trunk/drivers/scsi/pcmcia/nsp_cs.h @@ -299,7 +299,8 @@ static int nsp_proc_info ( off_t offset, int length, int inout); -static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); +static int nsp_queuecommand(struct scsi_cmnd *SCpnt, + void (* done)(struct scsi_cmnd *SCpnt)); /* Error handler */ /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ diff --git a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c index 8552296edaa1..0ae27cb5cd6f 100644 --- a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c @@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) } static int -SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) +SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { int i; int port_base = SCpnt->device->host->io_port; @@ -583,8 +583,6 @@ SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) return 0; } -static DEF_SCSI_QCMD(SYM53C500_queue) - static int SYM53C500_host_reset(struct scsi_cmnd *SCpnt) { diff --git a/trunk/drivers/scsi/pmcraid.c b/trunk/drivers/scsi/pmcraid.c index 5e76a624cb08..cf89091e4c3d 100644 --- a/trunk/drivers/scsi/pmcraid.c +++ b/trunk/drivers/scsi/pmcraid.c @@ -3478,7 +3478,7 @@ static int pmcraid_copy_sglist( * SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy */ -static int pmcraid_queuecommand_lck( +static int pmcraid_queuecommand( struct scsi_cmnd *scsi_cmd, void (*done) (struct scsi_cmnd *) ) @@ -3584,8 +3584,6 @@ static int pmcraid_queuecommand_lck( return rc; } -static DEF_SCSI_QCMD(pmcraid_queuecommand) - /** * pmcraid_open -char node "open" entry, allowed only users with admin access */ diff --git a/trunk/drivers/scsi/ppa.c b/trunk/drivers/scsi/ppa.c index d164c9639361..7bc2d796e403 100644 --- a/trunk/drivers/scsi/ppa.c +++ b/trunk/drivers/scsi/ppa.c @@ -798,7 +798,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) return 0; } -static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, +static int ppa_queuecommand(struct scsi_cmnd *cmd, void (*done) (struct scsi_cmnd *)) { ppa_struct *dev = ppa_dev(cmd->device->host); @@ -821,8 +821,6 @@ static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(ppa_queuecommand) - /* * Apparently the disk->capacity attribute is off by 1 sector * for all disk drives. We add the one here, but it should really diff --git a/trunk/drivers/scsi/ps3rom.c b/trunk/drivers/scsi/ps3rom.c index cd178b9e40cd..92ffbb510498 100644 --- a/trunk/drivers/scsi/ps3rom.c +++ b/trunk/drivers/scsi/ps3rom.c @@ -211,7 +211,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev, return 0; } -static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, +static int ps3rom_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct ps3rom_private *priv = shost_priv(cmd->device->host); @@ -260,8 +260,6 @@ static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(ps3rom_queuecommand) - static int decode_lv1_status(u64 status, unsigned char *sense_key, unsigned char *asc, unsigned char *ascq) { diff --git a/trunk/drivers/scsi/qla1280.c b/trunk/drivers/scsi/qla1280.c index 5dec684bf010..b8166ecfd0e3 100644 --- a/trunk/drivers/scsi/qla1280.c +++ b/trunk/drivers/scsi/qla1280.c @@ -727,7 +727,7 @@ qla1280_info(struct Scsi_Host *host) * context which is a big NO! NO!. **************************************************************************/ static int -qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) +qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) { struct Scsi_Host *host = cmd->device->host; struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; @@ -756,8 +756,6 @@ qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) return status; } -static DEF_SCSI_QCMD(qla1280_queuecommand) - enum action { ABORT_COMMAND, DEVICE_RESET, diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c index 1644eabaafeb..1830e6e97315 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_os.c +++ b/trunk/drivers/scsi/qla2xxx/qla_os.c @@ -179,7 +179,8 @@ static int qla2xxx_slave_alloc(struct scsi_device *); static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); static void qla2xxx_scan_start(struct Scsi_Host *); static void qla2xxx_slave_destroy(struct scsi_device *); -static int qla2xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); +static int qla2xxx_queuecommand(struct scsi_cmnd *cmd, + void (*fn)(struct scsi_cmnd *)); static int qla2xxx_eh_abort(struct scsi_cmnd *); static int qla2xxx_eh_device_reset(struct scsi_cmnd *); static int qla2xxx_eh_target_reset(struct scsi_cmnd *); @@ -534,7 +535,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, } static int -qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { scsi_qla_host_t *vha = shost_priv(cmd->device->host); fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; @@ -608,8 +609,6 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) return 0; } -static DEF_SCSI_QCMD(qla2xxx_queuecommand) - /* * qla2x00_eh_wait_on_command diff --git a/trunk/drivers/scsi/qla4xxx/ql4_os.c b/trunk/drivers/scsi/qla4xxx/ql4_os.c index 0d48fb4d1044..f4cd846abf6d 100644 --- a/trunk/drivers/scsi/qla4xxx/ql4_os.c +++ b/trunk/drivers/scsi/qla4xxx/ql4_os.c @@ -79,7 +79,8 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc); /* * SCSI host template entry points */ -static int qla4xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); +static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, + void (*done) (struct scsi_cmnd *)); static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); @@ -463,7 +464,7 @@ void qla4xxx_srb_compl(struct kref *ref) * completion handling). Unfortunely, it sometimes calls the scheduler * in interrupt context which is a big NO! NO!. **/ -static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, +static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct scsi_qla_host *ha = to_qla_host(cmd->device->host); @@ -537,8 +538,6 @@ static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(qla4xxx_queuecommand) - /** * qla4xxx_mem_free - frees memory allocated to adapter * @ha: Pointer to host adapter structure. diff --git a/trunk/drivers/scsi/qlogicfas408.c b/trunk/drivers/scsi/qlogicfas408.c index c3a9151ca823..1ad51552d6b1 100644 --- a/trunk/drivers/scsi/qlogicfas408.c +++ b/trunk/drivers/scsi/qlogicfas408.c @@ -439,7 +439,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id) * Queued command */ -static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, +int qlogicfas408_queuecommand(struct scsi_cmnd *cmd, void (*done) (struct scsi_cmnd *)) { struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); @@ -459,8 +459,6 @@ static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -DEF_SCSI_QCMD(qlogicfas408_queuecommand) - /* * Return bios parameters */ diff --git a/trunk/drivers/scsi/qlogicfas408.h b/trunk/drivers/scsi/qlogicfas408.h index 2f6c0a166200..260626427a32 100644 --- a/trunk/drivers/scsi/qlogicfas408.h +++ b/trunk/drivers/scsi/qlogicfas408.h @@ -103,7 +103,8 @@ struct qlogicfas408_priv { #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); -int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd); +int qlogicfas408_queuecommand(struct scsi_cmnd * cmd, + void (*done) (struct scsi_cmnd *)); int qlogicfas408_biosparam(struct scsi_device * disk, struct block_device *dev, sector_t capacity, int ip[]); diff --git a/trunk/drivers/scsi/qlogicpti.c b/trunk/drivers/scsi/qlogicpti.c index 664c9572d0c9..f8c561cf751e 100644 --- a/trunk/drivers/scsi/qlogicpti.c +++ b/trunk/drivers/scsi/qlogicpti.c @@ -1003,7 +1003,7 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev) * * "This code must fly." -davem */ -static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) +static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) { struct Scsi_Host *host = Cmnd->device->host; struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; @@ -1052,8 +1052,6 @@ static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struc return 1; } -static DEF_SCSI_QCMD(qlogicpti_queuecommand) - static int qlogicpti_return_status(struct Status_Entry *sts, int id) { int host_status = DID_ERROR; diff --git a/trunk/drivers/scsi/scsi.c b/trunk/drivers/scsi/scsi.c index 2aeb2e9c4d3b..348fba0a8976 100644 --- a/trunk/drivers/scsi/scsi.c +++ b/trunk/drivers/scsi/scsi.c @@ -634,13 +634,12 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) * Description: a serial number identifies a request for error recovery * and debugging purposes. Protected by the Host_Lock of host. */ -void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) +static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) { cmd->serial_number = host->cmd_serial_number++; if (cmd->serial_number == 0) cmd->serial_number = host->cmd_serial_number++; } -EXPORT_SYMBOL(scsi_cmd_get_serial); /** * scsi_dispatch_command - Dispatch a command to the low-level driver. @@ -652,6 +651,7 @@ EXPORT_SYMBOL(scsi_cmd_get_serial); int scsi_dispatch_cmd(struct scsi_cmnd *cmd) { struct Scsi_Host *host = cmd->device->host; + unsigned long flags = 0; unsigned long timeout; int rtn = 0; @@ -737,15 +737,23 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) goto out; } + spin_lock_irqsave(host->host_lock, flags); + /* + * AK: unlikely race here: for some reason the timer could + * expire before the serial number is set up below. + * + * TODO: kill serial or move to blk layer + */ + scsi_cmd_get_serial(host, cmd); + if (unlikely(host->shost_state == SHOST_DEL)) { cmd->result = (DID_NO_CONNECT << 16); scsi_done(cmd); } else { trace_scsi_dispatch_cmd_start(cmd); - cmd->scsi_done = scsi_done; - rtn = host->hostt->queuecommand(host, cmd); + rtn = host->hostt->queuecommand(cmd, scsi_done); } - + spin_unlock_irqrestore(host->host_lock, flags); if (rtn) { trace_scsi_dispatch_cmd_error(cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY && diff --git a/trunk/drivers/scsi/scsi_debug.c b/trunk/drivers/scsi/scsi_debug.c index 2f1f9b079b10..2c36bae3bd4b 100644 --- a/trunk/drivers/scsi/scsi_debug.c +++ b/trunk/drivers/scsi/scsi_debug.c @@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void) } static -int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done) +int scsi_debug_queuecommand(struct scsi_cmnd *SCpnt, done_funct_t done) { unsigned char *cmd = (unsigned char *) SCpnt->cmnd; int len, k; @@ -3884,8 +3884,6 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done) (delay_override ? 0 : scsi_debug_delay)); } -static DEF_SCSI_QCMD(scsi_debug_queuecommand) - static struct scsi_host_template sdebug_driver_template = { .proc_info = scsi_debug_proc_info, .proc_name = sdebug_proc_name, diff --git a/trunk/drivers/scsi/scsi_error.c b/trunk/drivers/scsi/scsi_error.c index 824b8fc03ce5..f3cf924a2cd9 100644 --- a/trunk/drivers/scsi/scsi_error.c +++ b/trunk/drivers/scsi/scsi_error.c @@ -773,15 +773,17 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, struct Scsi_Host *shost = sdev->host; DECLARE_COMPLETION_ONSTACK(done); unsigned long timeleft; + unsigned long flags; struct scsi_eh_save ses; int rtn; scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); shost->eh_action = &done; + spin_lock_irqsave(shost->host_lock, flags); scsi_log_send(scmd); - scmd->scsi_done = scsi_eh_done; - shost->hostt->queuecommand(shost, scmd); + shost->hostt->queuecommand(scmd, scsi_eh_done); + spin_unlock_irqrestore(shost->host_lock, flags); timeleft = wait_for_completion_timeout(&done, timeout); diff --git a/trunk/drivers/scsi/stex.c b/trunk/drivers/scsi/stex.c index 606215e54b88..9c73dbda3bbb 100644 --- a/trunk/drivers/scsi/stex.c +++ b/trunk/drivers/scsi/stex.c @@ -572,7 +572,7 @@ stex_slave_destroy(struct scsi_device *sdev) } static int -stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) { struct st_hba *hba; struct Scsi_Host *host; @@ -698,8 +698,6 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) return 0; } -static DEF_SCSI_QCMD(stex_queuecommand) - static void stex_scsi_done(struct st_ccb *ccb) { struct scsi_cmnd *cmd = ccb->cmd; diff --git a/trunk/drivers/scsi/sun3_NCR5380.c b/trunk/drivers/scsi/sun3_NCR5380.c index 4f0e5485ffde..713620ed70d9 100644 --- a/trunk/drivers/scsi/sun3_NCR5380.c +++ b/trunk/drivers/scsi/sun3_NCR5380.c @@ -908,7 +908,7 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags) */ /* Only make static if a wrapper function is used */ -static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, +static int NCR5380_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { SETUP_HOSTDATA(cmd->device->host); @@ -1019,8 +1019,6 @@ static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(NCR5380_queue_command) - /* * Function : NCR5380_main (void) * diff --git a/trunk/drivers/scsi/sun3_scsi.h b/trunk/drivers/scsi/sun3_scsi.h index bcefd8458e65..b29a9d661ca4 100644 --- a/trunk/drivers/scsi/sun3_scsi.h +++ b/trunk/drivers/scsi/sun3_scsi.h @@ -51,7 +51,8 @@ static int sun3scsi_abort(struct scsi_cmnd *); static int sun3scsi_detect (struct scsi_host_template *); static const char *sun3scsi_info (struct Scsi_Host *); static int sun3scsi_bus_reset(struct scsi_cmnd *); -static int sun3scsi_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int sun3scsi_queue_command(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); static int sun3scsi_release (struct Scsi_Host *); #ifndef CMD_PER_LUN diff --git a/trunk/drivers/scsi/sym53c416.c b/trunk/drivers/scsi/sym53c416.c index 190107ae120b..e5c369bb568f 100644 --- a/trunk/drivers/scsi/sym53c416.c +++ b/trunk/drivers/scsi/sym53c416.c @@ -734,7 +734,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost) return info; } -static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) { int base; unsigned long flags = 0; @@ -761,8 +761,6 @@ static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd * return 0; } -DEF_SCSI_QCMD(sym53c416_queuecommand) - static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) { int base; diff --git a/trunk/drivers/scsi/sym53c416.h b/trunk/drivers/scsi/sym53c416.h index 387de5d80a70..77860d0748ff 100644 --- a/trunk/drivers/scsi/sym53c416.h +++ b/trunk/drivers/scsi/sym53c416.h @@ -25,7 +25,7 @@ static int sym53c416_detect(struct scsi_host_template *); static const char *sym53c416_info(struct Scsi_Host *); static int sym53c416_release(struct Scsi_Host *); -static int sym53c416_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); static int sym53c416_host_reset(Scsi_Cmnd *); static int sym53c416_bios_param(struct scsi_device *, struct block_device *, sector_t, int *); diff --git a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c index 6b97ded9d45d..8b955b534a36 100644 --- a/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/trunk/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -505,7 +505,7 @@ void sym_log_bus_error(struct Scsi_Host *shost) * queuecommand method. Entered with the host adapter lock held and * interrupts disabled. */ -static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, +static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct sym_hcb *np = SYM_SOFTC_PTR(cmd); @@ -536,8 +536,6 @@ static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, return 0; } -static DEF_SCSI_QCMD(sym53c8xx_queue_command) - /* * Linux entry point of the interrupt handler. */ diff --git a/trunk/drivers/scsi/t128.h b/trunk/drivers/scsi/t128.h index ada1115079c9..76a069b7ac0b 100644 --- a/trunk/drivers/scsi/t128.h +++ b/trunk/drivers/scsi/t128.h @@ -96,7 +96,8 @@ static int t128_abort(struct scsi_cmnd *); static int t128_biosparam(struct scsi_device *, struct block_device *, sector_t, int*); static int t128_detect(struct scsi_host_template *); -static int t128_queue_command(struct Scsi_Host *, struct scsi_cmnd *); +static int t128_queue_command(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); static int t128_bus_reset(struct scsi_cmnd *); #ifndef CMD_PER_LUN diff --git a/trunk/drivers/scsi/tmscsim.c b/trunk/drivers/scsi/tmscsim.c index a124a28f2ccb..27866b0adfeb 100644 --- a/trunk/drivers/scsi/tmscsim.c +++ b/trunk/drivers/scsi/tmscsim.c @@ -1883,7 +1883,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB ) return; } -static int DC390_queuecommand_lck(struct scsi_cmnd *cmd, +static int DC390_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct scsi_device *sdev = cmd->device; @@ -1944,8 +1944,6 @@ static int DC390_queuecommand_lck(struct scsi_cmnd *cmd, return SCSI_MLQUEUE_DEVICE_BUSY; } -static DEF_SCSI_QCMD(DC390_queuecommand) - static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) { struct pci_dev *pdev; diff --git a/trunk/drivers/scsi/u14-34f.c b/trunk/drivers/scsi/u14-34f.c index edfc5da8be4c..5d9fdeeb2315 100644 --- a/trunk/drivers/scsi/u14-34f.c +++ b/trunk/drivers/scsi/u14-34f.c @@ -433,7 +433,7 @@ static int u14_34f_detect(struct scsi_host_template *); static int u14_34f_release(struct Scsi_Host *); -static int u14_34f_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int u14_34f_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); static int u14_34f_eh_abort(struct scsi_cmnd *); static int u14_34f_eh_host_reset(struct scsi_cmnd *); static int u14_34f_bios_param(struct scsi_device *, struct block_device *, @@ -1248,7 +1248,7 @@ static void scsi_to_dev_dir(unsigned int i, unsigned int j) { } -static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { +static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { unsigned int i, j, k; struct mscp *cpp; @@ -1329,8 +1329,6 @@ static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct return 0; } -static DEF_SCSI_QCMD(u14_34f_queuecommand) - static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { unsigned int i, j; diff --git a/trunk/drivers/scsi/ultrastor.c b/trunk/drivers/scsi/ultrastor.c index 0571ef9639cb..27aa40f3980e 100644 --- a/trunk/drivers/scsi/ultrastor.c +++ b/trunk/drivers/scsi/ultrastor.c @@ -700,7 +700,7 @@ static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) mscp->transfer_data_length = transfer_length; } -static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, +static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt, void (*done) (struct scsi_cmnd *)) { struct mscp *my_mscp; @@ -825,8 +825,6 @@ static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, return 0; } -static DEF_SCSI_QCMD(ultrastor_queuecommand) - /* This code must deal with 2 cases: 1. The command has not been written to the OGM. In this case, set diff --git a/trunk/drivers/scsi/ultrastor.h b/trunk/drivers/scsi/ultrastor.h index 165c18b5cf5f..a692905f95f7 100644 --- a/trunk/drivers/scsi/ultrastor.h +++ b/trunk/drivers/scsi/ultrastor.h @@ -15,7 +15,8 @@ static int ultrastor_detect(struct scsi_host_template *); static const char *ultrastor_info(struct Scsi_Host *shpnt); -static int ultrastor_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +static int ultrastor_queuecommand(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); static int ultrastor_abort(struct scsi_cmnd *); static int ultrastor_host_reset(struct scsi_cmnd *); static int ultrastor_biosparam(struct scsi_device *, struct block_device *, diff --git a/trunk/drivers/scsi/vmw_pvscsi.c b/trunk/drivers/scsi/vmw_pvscsi.c index a18996d24466..26894459c37f 100644 --- a/trunk/drivers/scsi/vmw_pvscsi.c +++ b/trunk/drivers/scsi/vmw_pvscsi.c @@ -690,7 +690,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter, return 0; } -static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) +static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct Scsi_Host *host = cmd->device->host; struct pvscsi_adapter *adapter = shost_priv(host); @@ -719,8 +719,6 @@ static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd return 0; } -static DEF_SCSI_QCMD(pvscsi_queue) - static int pvscsi_abort(struct scsi_cmnd *cmd) { struct pvscsi_adapter *adapter = shost_priv(cmd->device->host); diff --git a/trunk/drivers/scsi/wd33c93.c b/trunk/drivers/scsi/wd33c93.c index 5f697e0bd009..b701bf2cc187 100644 --- a/trunk/drivers/scsi/wd33c93.c +++ b/trunk/drivers/scsi/wd33c93.c @@ -371,8 +371,8 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast, msg[1] = offset; } -static int -wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, +int +wd33c93_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct WD33C93_hostdata *hostdata; @@ -468,8 +468,6 @@ wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, return 0; } -DEF_SCSI_QCMD(wd33c93_queuecommand) - /* * This routine attempts to start a scsi command. If the host_card is * already connected, we give up immediately. Otherwise, look through diff --git a/trunk/drivers/scsi/wd33c93.h b/trunk/drivers/scsi/wd33c93.h index 3b463d7304dc..1ed5f3bf388e 100644 --- a/trunk/drivers/scsi/wd33c93.h +++ b/trunk/drivers/scsi/wd33c93.h @@ -343,7 +343,8 @@ struct WD33C93_hostdata { void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, dma_setup_t setup, dma_stop_t stop, int clock_freq); int wd33c93_abort (struct scsi_cmnd *cmd); -int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd); +int wd33c93_queuecommand (struct scsi_cmnd *cmd, + void (*done)(struct scsi_cmnd *)); void wd33c93_intr (struct Scsi_Host *instance); int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); int wd33c93_host_reset (struct scsi_cmnd *); diff --git a/trunk/drivers/scsi/wd7000.c b/trunk/drivers/scsi/wd7000.c index db451ae0a368..333580bf37c5 100644 --- a/trunk/drivers/scsi/wd7000.c +++ b/trunk/drivers/scsi/wd7000.c @@ -1082,7 +1082,7 @@ static irqreturn_t wd7000_intr(int irq, void *dev_id) return IRQ_HANDLED; } -static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, +static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { Scb *scb; @@ -1139,8 +1139,6 @@ static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, return 0; } -static DEF_SCSI_QCMD(wd7000_queuecommand) - static int wd7000_diagnostics(Adapter * host, int code) { static IcbDiag icb = { ICB_OP_DIAGNOSTICS }; diff --git a/trunk/drivers/staging/hv/storvsc_drv.c b/trunk/drivers/staging/hv/storvsc_drv.c index 6f8d67d0d64f..41d9acf4cd61 100644 --- a/trunk/drivers/staging/hv/storvsc_drv.c +++ b/trunk/drivers/staging/hv/storvsc_drv.c @@ -72,7 +72,8 @@ struct storvsc_driver_context { /* Static decl */ static int storvsc_probe(struct device *dev); -static int storvsc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd); +static int storvsc_queuecommand(struct scsi_cmnd *scmnd, + void (*done)(struct scsi_cmnd *)); static int storvsc_device_alloc(struct scsi_device *); static int storvsc_device_configure(struct scsi_device *); static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); @@ -594,7 +595,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, /* * storvsc_queuecommand - Initiate command processing */ -static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, +static int storvsc_queuecommand(struct scsi_cmnd *scmnd, void (*done)(struct scsi_cmnd *)) { int ret; @@ -782,8 +783,6 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, return ret; } -static DEF_SCSI_QCMD(storvsc_queuecommand) - static int storvsc_merge_bvec(struct request_queue *q, struct bvec_merge_data *bmd, struct bio_vec *bvec) { diff --git a/trunk/drivers/staging/keucr/scsiglue.c b/trunk/drivers/staging/keucr/scsiglue.c index da4f42af3838..a2671404f7ac 100644 --- a/trunk/drivers/staging/keucr/scsiglue.c +++ b/trunk/drivers/staging/keucr/scsiglue.c @@ -87,7 +87,7 @@ static int slave_configure(struct scsi_device *sdev) /* This is always called with scsi_lock(host) held */ //----- queuecommand() --------------------- -static int queuecommand_lck(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) +static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) { struct us_data *us = host_to_us(srb->device->host); @@ -117,8 +117,6 @@ static int queuecommand_lck(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd return 0; } -static DEF_SCSI_QCMD(queuecommand) - /*********************************************************************** * Error handling functions ***********************************************************************/ diff --git a/trunk/drivers/usb/image/microtek.c b/trunk/drivers/usb/image/microtek.c index c90c89dc0003..5a47805d9580 100644 --- a/trunk/drivers/usb/image/microtek.c +++ b/trunk/drivers/usb/image/microtek.c @@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb) } static int -mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb); +mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback); static void mts_transfer_cleanup( struct urb *transfer ); static void mts_do_sg(struct urb * transfer); @@ -573,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc) static int -mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) +mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) { struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); int err = 0; @@ -626,8 +626,6 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback return err; } -static DEF_SCSI_QCMD(mts_scsi_queuecommand) - static struct scsi_host_template mts_scsi_host_template = { .module = THIS_MODULE, .name = "microtekX6", diff --git a/trunk/drivers/usb/storage/scsiglue.c b/trunk/drivers/usb/storage/scsiglue.c index 689ee1fb702a..a688b1e686ea 100644 --- a/trunk/drivers/usb/storage/scsiglue.c +++ b/trunk/drivers/usb/storage/scsiglue.c @@ -285,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev) /* queue a command */ /* This is always called with scsi_lock(host) held */ -static int queuecommand_lck(struct scsi_cmnd *srb, +static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) { struct us_data *us = host_to_us(srb->device->host); @@ -315,8 +315,6 @@ static int queuecommand_lck(struct scsi_cmnd *srb, return 0; } -static DEF_SCSI_QCMD(queuecommand) - /*********************************************************************** * Error handling functions ***********************************************************************/ diff --git a/trunk/drivers/usb/storage/uas.c b/trunk/drivers/usb/storage/uas.c index 339fac3949df..d1268191acbd 100644 --- a/trunk/drivers/usb/storage/uas.c +++ b/trunk/drivers/usb/storage/uas.c @@ -430,7 +430,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, return 0; } -static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, +static int uas_queuecommand(struct scsi_cmnd *cmnd, void (*done)(struct scsi_cmnd *)) { struct scsi_device *sdev = cmnd->device; @@ -488,8 +488,6 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, return 0; } -static DEF_SCSI_QCMD(uas_queuecommand) - static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) { struct scsi_device *sdev = cmnd->device; diff --git a/trunk/fs/lockd/host.c b/trunk/fs/lockd/host.c index 25e21e4023b2..ed0c59fe23ce 100644 --- a/trunk/fs/lockd/host.c +++ b/trunk/fs/lockd/host.c @@ -124,7 +124,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) continue; if (host->h_server != ni->server) continue; - if (ni->server && + if (ni->server && ni->src_len != 0 && !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) continue; @@ -167,6 +167,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) host->h_addrlen = ni->salen; rpc_set_port(nlm_addr(host), 0); memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); + host->h_srcaddrlen = ni->src_len; host->h_version = ni->version; host->h_proto = ni->protocol; host->h_rpcclnt = NULL; @@ -238,9 +239,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, const char *hostname, int noresvport) { - const struct sockaddr source = { - .sa_family = AF_UNSPEC, - }; struct nlm_lookup_host_info ni = { .server = 0, .sap = sap, @@ -249,8 +247,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, .version = version, .hostname = hostname, .hostname_len = strlen(hostname), - .src_sap = &source, - .src_len = sizeof(source), .noresvport = noresvport, }; @@ -357,7 +353,6 @@ nlm_bind_host(struct nlm_host *host) .protocol = host->h_proto, .address = nlm_addr(host), .addrsize = host->h_addrlen, - .saddress = nlm_srcaddr(host), .timeout = &timeparms, .servername = host->h_name, .program = &nlm_program, @@ -376,6 +371,8 @@ nlm_bind_host(struct nlm_host *host) args.flags |= RPC_CLNT_CREATE_HARDRTRY; if (host->h_noresvport) args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; + if (host->h_srcaddrlen) + args.saddress = nlm_srcaddr(host); clnt = rpc_create(&args); if (!IS_ERR(clnt)) diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index d947b1231662..15b77b8dc7e1 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, unsigned long, struct ata_port_operations *); extern int ata_scsi_detect(struct scsi_host_template *sht); extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); -extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); +extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, int cmd, void __user *arg); extern void ata_sas_port_destroy(struct ata_port *); diff --git a/trunk/include/linux/lockd/lockd.h b/trunk/include/linux/lockd/lockd.h index a34dea46b629..2dee05e5119a 100644 --- a/trunk/include/linux/lockd/lockd.h +++ b/trunk/include/linux/lockd/lockd.h @@ -43,6 +43,7 @@ struct nlm_host { struct sockaddr_storage h_addr; /* peer address */ size_t h_addrlen; struct sockaddr_storage h_srcaddr; /* our address (optional) */ + size_t h_srcaddrlen; struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ char *h_name; /* remote hostname */ u32 h_version; /* interface version */ diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 2c79e921a68b..d0036e52a24a 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -862,7 +862,6 @@ struct sched_group { * single CPU. */ unsigned int cpu_power, cpu_power_orig; - unsigned int group_weight; /* * The CPUs this group covers. diff --git a/trunk/include/linux/security.h b/trunk/include/linux/security.h index fd4d55fb8845..b8246a8df7d2 100644 --- a/trunk/include/linux/security.h +++ b/trunk/include/linux/security.h @@ -77,6 +77,7 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, extern int cap_task_setscheduler(struct task_struct *p); extern int cap_task_setioprio(struct task_struct *p, int ioprio); extern int cap_task_setnice(struct task_struct *p, int nice); +extern int cap_syslog(int type, bool from_file); extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); struct msghdr; @@ -1387,7 +1388,7 @@ struct security_operations { int (*sysctl) (struct ctl_table *table, int op); int (*quotactl) (int cmds, int type, int id, struct super_block *sb); int (*quota_on) (struct dentry *dentry); - int (*syslog) (int type); + int (*syslog) (int type, bool from_file); int (*settime) (struct timespec *ts, struct timezone *tz); int (*vm_enough_memory) (struct mm_struct *mm, long pages); @@ -1670,7 +1671,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap); int security_sysctl(struct ctl_table *table, int op); int security_quotactl(int cmds, int type, int id, struct super_block *sb); int security_quota_on(struct dentry *dentry); -int security_syslog(int type); +int security_syslog(int type, bool from_file); int security_settime(struct timespec *ts, struct timezone *tz); int security_vm_enough_memory(long pages); int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); @@ -1900,9 +1901,9 @@ static inline int security_quota_on(struct dentry *dentry) return 0; } -static inline int security_syslog(int type) +static inline int security_syslog(int type, bool from_file) { - return 0; + return cap_syslog(type, from_file); } static inline int security_settime(struct timespec *ts, struct timezone *tz) diff --git a/trunk/include/scsi/libfc.h b/trunk/include/scsi/libfc.h index 5c4c1678f7be..f986ab7ffe6f 100644 --- a/trunk/include/scsi/libfc.h +++ b/trunk/include/scsi/libfc.h @@ -1006,7 +1006,8 @@ void fc_fcp_destroy(struct fc_lport *); /* * SCSI INTERACTION LAYER *****************************/ -int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); +int fc_queuecommand(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); int fc_eh_abort(struct scsi_cmnd *); int fc_eh_device_reset(struct scsi_cmnd *); int fc_eh_host_reset(struct scsi_cmnd *); diff --git a/trunk/include/scsi/libiscsi.h b/trunk/include/scsi/libiscsi.h index b81d969ddc67..ae5196aae1a5 100644 --- a/trunk/include/scsi/libiscsi.h +++ b/trunk/include/scsi/libiscsi.h @@ -341,7 +341,8 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc); extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); -extern int iscsi_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *sc); +extern int iscsi_queuecommand(struct scsi_cmnd *sc, + void (*done)(struct scsi_cmnd *)); /* * iSCSI host helpers. diff --git a/trunk/include/scsi/libsas.h b/trunk/include/scsi/libsas.h index 90ce527ecf3d..3dec1949f69c 100644 --- a/trunk/include/scsi/libsas.h +++ b/trunk/include/scsi/libsas.h @@ -621,7 +621,8 @@ int sas_set_phy_speed(struct sas_phy *phy, int sas_phy_enable(struct sas_phy *phy, int enabled); int sas_phy_reset(struct sas_phy *phy, int hard_reset); int sas_queue_up(struct sas_task *task); -extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *); +extern int sas_queuecommand(struct scsi_cmnd *, + void (*scsi_done)(struct scsi_cmnd *)); extern int sas_target_alloc(struct scsi_target *); extern int sas_slave_alloc(struct scsi_device *); extern int sas_slave_configure(struct scsi_device *); diff --git a/trunk/include/scsi/scsi_host.h b/trunk/include/scsi/scsi_host.h index e7e385842a38..d0a6a845f204 100644 --- a/trunk/include/scsi/scsi_host.h +++ b/trunk/include/scsi/scsi_host.h @@ -127,7 +127,8 @@ struct scsi_host_template { * * STATUS: REQUIRED */ - int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); + int (* queuecommand)(struct scsi_cmnd *, + void (*done)(struct scsi_cmnd *)); /* * The transfer functions are used to queue a scsi command to @@ -503,25 +504,6 @@ struct scsi_host_template { u64 vendor_id; }; -/* - * Temporary #define for host lock push down. Can be removed when all - * drivers have been updated to take advantage of unlocked - * queuecommand. - * - */ -#define DEF_SCSI_QCMD(func_name) \ - int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ - { \ - unsigned long irq_flags; \ - int rc; \ - spin_lock_irqsave(shost->host_lock, irq_flags); \ - scsi_cmd_get_serial(shost, cmd); \ - rc = func_name##_lck (cmd, cmd->scsi_done); \ - spin_unlock_irqrestore(shost->host_lock, irq_flags); \ - return rc; \ - } - - /* * shost state: If you alter this, you also need to alter scsi_sysfs.c * (for the ascii descriptions) and the state model enforcer: @@ -770,7 +752,6 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); extern void scsi_host_put(struct Scsi_Host *t); extern struct Scsi_Host *scsi_host_lookup(unsigned short); extern const char *scsi_host_state_name(enum scsi_host_state); -extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index 40a8777a27d0..6c683b37f2ce 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -2489,8 +2489,7 @@ void exit_robust_list(struct task_struct *curr) { struct robust_list_head __user *head = curr->robust_list; struct robust_list __user *entry, *next_entry, *pending; - unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; - unsigned int uninitialized_var(next_pi); + unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; unsigned long futex_offset; int rc; diff --git a/trunk/kernel/futex_compat.c b/trunk/kernel/futex_compat.c index a7934ac75e5b..06da4dfc339b 100644 --- a/trunk/kernel/futex_compat.c +++ b/trunk/kernel/futex_compat.c @@ -49,8 +49,7 @@ void compat_exit_robust_list(struct task_struct *curr) { struct compat_robust_list_head __user *head = curr->compat_robust_list; struct robust_list __user *entry, *next_entry, *pending; - unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; - unsigned int uninitialized_var(next_pi); + unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; compat_uptr_t uentry, next_uentry, upending; compat_long_t futex_offset; int rc; diff --git a/trunk/kernel/pm_qos_params.c b/trunk/kernel/pm_qos_params.c index aeaa7f846821..c7a8f453919e 100644 --- a/trunk/kernel/pm_qos_params.c +++ b/trunk/kernel/pm_qos_params.c @@ -121,10 +121,10 @@ static inline int pm_qos_get_value(struct pm_qos_object *o) switch (o->type) { case PM_QOS_MIN: - return plist_first(&o->requests)->prio; + return plist_last(&o->requests)->prio; case PM_QOS_MAX: - return plist_last(&o->requests)->prio; + return plist_first(&o->requests)->prio; default: /* runtime check for not using enum */ diff --git a/trunk/kernel/power/Kconfig b/trunk/kernel/power/Kconfig index a5aff3ebad38..29bff6117abc 100644 --- a/trunk/kernel/power/Kconfig +++ b/trunk/kernel/power/Kconfig @@ -246,13 +246,9 @@ config PM_OPS depends on PM_SLEEP || PM_RUNTIME default y -config ARCH_HAS_OPP - bool - config PM_OPP bool "Operating Performance Point (OPP) Layer library" depends on PM - depends on ARCH_HAS_OPP ---help--- SOCs have a standard set of tuples consisting of frequency and voltage pairs that the device will support per voltage domain. This diff --git a/trunk/kernel/printk.c b/trunk/kernel/printk.c index 9a2264fc42ca..38e7d5868d60 100644 --- a/trunk/kernel/printk.c +++ b/trunk/kernel/printk.c @@ -274,20 +274,7 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) char c; int error = 0; - /* - * If this is from /proc/kmsg we only do the capabilities checks - * at open time. - */ - if (type == SYSLOG_ACTION_OPEN || !from_file) { - if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) - return -EPERM; - if ((type != SYSLOG_ACTION_READ_ALL && - type != SYSLOG_ACTION_SIZE_BUFFER) && - !capable(CAP_SYS_ADMIN)) - return -EPERM; - } - - error = security_syslog(type); + error = security_syslog(type, from_file); if (error) return error; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index dc91a4d09ac3..aa14a56f9d03 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -560,8 +560,18 @@ struct rq { static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +static inline +void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags) +{ + rq->curr->sched_class->check_preempt_curr(rq, p, flags); -static void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags); + /* + * A queue event has occurred, and we're going to schedule. In + * this case, we can save a useless back to back clock update. + */ + if (test_tsk_need_resched(p)) + rq->skip_clock_update = 1; +} static inline int cpu_of(struct rq *rq) { @@ -2108,31 +2118,6 @@ static inline void check_class_changed(struct rq *rq, struct task_struct *p, p->sched_class->prio_changed(rq, p, oldprio, running); } -static void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags) -{ - const struct sched_class *class; - - if (p->sched_class == rq->curr->sched_class) { - rq->curr->sched_class->check_preempt_curr(rq, p, flags); - } else { - for_each_class(class) { - if (class == rq->curr->sched_class) - break; - if (class == p->sched_class) { - resched_task(rq->curr); - break; - } - } - } - - /* - * A queue event has occurred, and we're going to schedule. In - * this case, we can save a useless back to back clock update. - */ - if (test_tsk_need_resched(rq->curr)) - rq->skip_clock_update = 1; -} - #ifdef CONFIG_SMP /* * Is this task likely cache-hot: @@ -6975,8 +6960,6 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) if (cpu != group_first_cpu(sd->groups)) return; - sd->groups->group_weight = cpumask_weight(sched_group_cpus(sd->groups)); - child = sd->child; sd->groups->cpu_power = 0; diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index 52ab113d8bb9..f4f6a8326dd0 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -1654,6 +1654,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ struct cfs_rq *cfs_rq = task_cfs_rq(curr); int scale = cfs_rq->nr_running >= sched_nr_latency; + if (unlikely(rt_prio(p->prio))) + goto preempt; + + if (unlikely(p->sched_class != &fair_sched_class)) + return; + if (unlikely(se == pse)) return; @@ -2029,16 +2035,13 @@ struct sd_lb_stats { unsigned long this_load_per_task; unsigned long this_nr_running; unsigned long this_has_capacity; - unsigned int this_idle_cpus; /* Statistics of the busiest group */ - unsigned int busiest_idle_cpus; unsigned long max_load; unsigned long busiest_load_per_task; unsigned long busiest_nr_running; unsigned long busiest_group_capacity; unsigned long busiest_has_capacity; - unsigned int busiest_group_weight; int group_imb; /* Is there imbalance in this sd */ #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) @@ -2060,8 +2063,6 @@ struct sg_lb_stats { unsigned long sum_nr_running; /* Nr tasks running in the group */ unsigned long sum_weighted_load; /* Weighted load of group's tasks */ unsigned long group_capacity; - unsigned long idle_cpus; - unsigned long group_weight; int group_imb; /* Is there an imbalance in the group ? */ int group_has_capacity; /* Is there extra capacity in the group? */ }; @@ -2430,8 +2431,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, sgs->group_load += load; sgs->sum_nr_running += rq->nr_running; sgs->sum_weighted_load += weighted_cpuload(i); - if (idle_cpu(i)) - sgs->idle_cpus++; + } /* @@ -2469,7 +2469,6 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE); if (!sgs->group_capacity) sgs->group_capacity = fix_small_capacity(sd, group); - sgs->group_weight = group->group_weight; if (sgs->group_capacity > sgs->sum_nr_running) sgs->group_has_capacity = 1; @@ -2577,16 +2576,13 @@ static inline void update_sd_lb_stats(struct sched_domain *sd, int this_cpu, sds->this_nr_running = sgs.sum_nr_running; sds->this_load_per_task = sgs.sum_weighted_load; sds->this_has_capacity = sgs.group_has_capacity; - sds->this_idle_cpus = sgs.idle_cpus; } else if (update_sd_pick_busiest(sd, sds, sg, &sgs, this_cpu)) { sds->max_load = sgs.avg_load; sds->busiest = sg; sds->busiest_nr_running = sgs.sum_nr_running; - sds->busiest_idle_cpus = sgs.idle_cpus; sds->busiest_group_capacity = sgs.group_capacity; sds->busiest_load_per_task = sgs.sum_weighted_load; sds->busiest_has_capacity = sgs.group_has_capacity; - sds->busiest_group_weight = sgs.group_weight; sds->group_imb = sgs.group_imb; } @@ -2864,26 +2860,8 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, if (sds.this_load >= sds.avg_load) goto out_balanced; - /* - * In the CPU_NEWLY_IDLE, use imbalance_pct to be conservative. - * And to check for busy balance use !idle_cpu instead of - * CPU_NOT_IDLE. This is because HT siblings will use CPU_NOT_IDLE - * even when they are idle. - */ - if (idle == CPU_NEWLY_IDLE || !idle_cpu(this_cpu)) { - if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) - goto out_balanced; - } else { - /* - * This cpu is idle. If the busiest group load doesn't - * have more tasks than the number of available cpu's and - * there is no imbalance between this and busiest group - * wrt to idle cpu's, it is balanced. - */ - if ((sds.this_idle_cpus <= sds.busiest_idle_cpus + 1) && - sds.busiest_nr_running <= sds.busiest_group_weight) - goto out_balanced; - } + if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) + goto out_balanced; force_balance: /* Looks like there is an imbalance. Compute it */ diff --git a/trunk/kernel/sched_stoptask.c b/trunk/kernel/sched_stoptask.c index 2bf6b47058c1..45bddc0c1048 100644 --- a/trunk/kernel/sched_stoptask.c +++ b/trunk/kernel/sched_stoptask.c @@ -19,14 +19,14 @@ select_task_rq_stop(struct rq *rq, struct task_struct *p, static void check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) { - /* we're never preempted */ + resched_task(rq->curr); /* we preempt everything */ } static struct task_struct *pick_next_task_stop(struct rq *rq) { struct task_struct *stop = rq->stop; - if (stop && stop->se.on_rq) + if (stop && stop->state == TASK_RUNNING) return stop; return NULL; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index 5abfa1518554..b65bf634035e 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -702,6 +702,7 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &ten_thousand, }, +#endif { .procname = "dmesg_restrict", .data = &dmesg_restrict, @@ -711,7 +712,6 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &one, }, -#endif { .procname = "ngroups_max", .data = &ngroups_max, diff --git a/trunk/kernel/trace/Kconfig b/trunk/kernel/trace/Kconfig index ea37e2ff4164..e04b8bcdef88 100644 --- a/trunk/kernel/trace/Kconfig +++ b/trunk/kernel/trace/Kconfig @@ -126,7 +126,7 @@ if FTRACE config FUNCTION_TRACER bool "Kernel Function Tracer" depends on HAVE_FUNCTION_TRACER - select FRAME_POINTER if !ARM_UNWIND && !S390 + select FRAME_POINTER if (!ARM_UNWIND) select KALLSYMS select GENERIC_TRACER select CONTEXT_SWITCH_TRACER diff --git a/trunk/security/capability.c b/trunk/security/capability.c index c773635ca3a0..30ae00fbecd5 100644 --- a/trunk/security/capability.c +++ b/trunk/security/capability.c @@ -17,11 +17,6 @@ static int cap_sysctl(ctl_table *table, int op) return 0; } -static int cap_syslog(int type) -{ - return 0; -} - static int cap_quotactl(int cmds, int type, int id, struct super_block *sb) { return 0; diff --git a/trunk/security/commoncap.c b/trunk/security/commoncap.c index 64c2ed9c9015..04b80f9912bf 100644 --- a/trunk/security/commoncap.c +++ b/trunk/security/commoncap.c @@ -27,6 +27,7 @@ #include #include #include +#include /* * If a non-root user executes a setuid-root binary in @@ -882,6 +883,26 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, return error; } +/** + * cap_syslog - Determine whether syslog function is permitted + * @type: Function requested + * @from_file: Whether this request came from an open file (i.e. /proc) + * + * Determine whether the current process is permitted to use a particular + * syslog function, returning 0 if permission is granted, -ve if not. + */ +int cap_syslog(int type, bool from_file) +{ + if (type != SYSLOG_ACTION_OPEN && from_file) + return 0; + if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) + return -EPERM; + if ((type != SYSLOG_ACTION_READ_ALL && + type != SYSLOG_ACTION_SIZE_BUFFER) && !capable(CAP_SYS_ADMIN)) + return -EPERM; + return 0; +} + /** * cap_vm_enough_memory - Determine whether a new virtual mapping is permitted * @mm: The VM space in which the new mapping is to be made diff --git a/trunk/security/security.c b/trunk/security/security.c index 1b798d3df710..3ef5e2a7a741 100644 --- a/trunk/security/security.c +++ b/trunk/security/security.c @@ -197,9 +197,9 @@ int security_quota_on(struct dentry *dentry) return security_ops->quota_on(dentry); } -int security_syslog(int type) +int security_syslog(int type, bool from_file) { - return security_ops->syslog(type); + return security_ops->syslog(type, from_file); } int security_settime(struct timespec *ts, struct timezone *tz) diff --git a/trunk/security/selinux/hooks.c b/trunk/security/selinux/hooks.c index 65fa8bf596f5..d9154cf90ae1 100644 --- a/trunk/security/selinux/hooks.c +++ b/trunk/security/selinux/hooks.c @@ -1973,10 +1973,14 @@ static int selinux_quota_on(struct dentry *dentry) return dentry_has_perm(cred, NULL, dentry, FILE__QUOTAON); } -static int selinux_syslog(int type) +static int selinux_syslog(int type, bool from_file) { int rc; + rc = cap_syslog(type, from_file); + if (rc) + return rc; + switch (type) { case SYSLOG_ACTION_READ_ALL: /* Read last kernel messages */ case SYSLOG_ACTION_SIZE_BUFFER: /* Return size of the log buffer */ diff --git a/trunk/security/smack/smack_lsm.c b/trunk/security/smack/smack_lsm.c index 489a85afa477..bc39f4067af6 100644 --- a/trunk/security/smack/smack_lsm.c +++ b/trunk/security/smack/smack_lsm.c @@ -157,11 +157,15 @@ static int smack_ptrace_traceme(struct task_struct *ptp) * * Returns 0 on success, error code otherwise. */ -static int smack_syslog(int typefrom_file) +static int smack_syslog(int type, bool from_file) { - int rc = 0; + int rc; char *sp = current_security(); + rc = cap_syslog(type, from_file); + if (rc != 0) + return rc; + if (capable(CAP_MAC_OVERRIDE)) return 0;