summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH 2/2] audit: fix sparse shadowed variable warningsHarvey Harrison2008-04-283-15/+13Star
| | | | | | | | | | | | | | | | | | | | | | Use msglen as the identifier. kernel/audit.c:724:10: warning: symbol 'len' shadows an earlier one kernel/audit.c:575:8: originally declared here Don't use ino_f to check the inode field at the end of the functions. kernel/auditfilter.c:429:22: warning: symbol 'f' shadows an earlier one kernel/auditfilter.c:420:21: originally declared here kernel/auditfilter.c:542:22: warning: symbol 'f' shadows an earlier one kernel/auditfilter.c:529:21: originally declared here i always used as a counter for a for loop and initialized to zero before use. Eliminate the inner i variables. kernel/auditsc.c:1295:8: warning: symbol 'i' shadows an earlier one kernel/auditsc.c:1152:6: originally declared here kernel/auditsc.c:1320:7: warning: symbol 'i' shadows an earlier one kernel/auditsc.c:1152:6: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* [PATCH 1/2] audit: move extern declarations to audit.hHarvey Harrison2008-04-283-11/+13
| | | | | | | | | | | | | | | Leave audit_sig_{uid|pid|sid} protected by #ifdef CONFIG_AUDITSYSCALL. Noticed by sparse: kernel/audit.c:73:6: warning: symbol 'audit_ever_enabled' was not declared. Should it be static? kernel/audit.c:100:8: warning: symbol 'audit_sig_uid' was not declared. Should it be static? kernel/audit.c:101:8: warning: symbol 'audit_sig_pid' was not declared. Should it be static? kernel/audit.c:102:6: warning: symbol 'audit_sig_sid' was not declared. Should it be static? kernel/audit.c:117:23: warning: symbol 'audit_ih' was not declared. Should it be static? kernel/auditfilter.c:78:18: warning: symbol 'audit_filter_list' was not declared. Should it be static? Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: MAINTAINERS updateEric Paris2008-04-281-3/+5
| | | | | | | Change maintainers to include me and al viro Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: increase the maximum length of the key fieldEric Paris2008-04-281-1/+1
| | | | | | | | | Key lengths were arbitrarily limited to 32 characters. If userspace is going to start using the single kernel key field as multiple virtual key fields (example key=key1,key2,key3,key4) we should give them enough room to work. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: standardize string audit interfacesEric Paris2008-04-285-24/+29
| | | | | | | | | | | | | | | | | | | | | This patch standardized the string auditing interfaces. No userspace changes will be visible and this is all just cleanup and consistancy work. We have the following string audit interfaces to use: void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, size_t len); void audit_log_n_string(struct audit_buffer *ab, const char *buf, size_t n); void audit_log_string(struct audit_buffer *ab, const char *buf); void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, size_t n); void audit_log_untrustedstring(struct audit_buffer *ab, const char *string); This may be the first step to possibly fixing some of the issues that people have with the string output from the kernel audit system. But we still don't have an agreed upon solution to that problem. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: stop deadlock from signals under loadEric Paris2008-04-281-5/+35
| | | | | | | | | | | | | | | | | A deadlock is possible between kauditd and auditd under load if auditd receives a signal. When auditd receives a signal it sends a netlink message to the kernel asking for information about the sender of the signal. In that same context the audit system will attempt to send a netlink message back to the userspace auditd. If kauditd has already filled the socket buffer (see netlink_attachskb()) auditd will now put itself to sleep waiting for room to send the message. Since auditd is responsible for draining that socket we have a deadlock. The fix, since the response from the kernel does not need to be synchronous is to send the signal information back to auditd in a separate thread. And thus auditd can continue to drain the audit queue normally. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: save audit_backlog_limit audit messages in case auditd comes backEric Paris2008-04-281-21/+81
| | | | | | | | | | | | | | | | | | This patch causes the kernel audit subsystem to store up to audit_backlog_limit messages for use by auditd if it ever appears sometime in the future in userspace. This is useful to collect audit messages during bootup and even when auditd is stopped. This is NOT a reliable mechanism, it does not ever call audit_panic, nor should it. audit_log_lost()/audit_panic() are called during the normal delivery mechanism. The messages are still sent to printk/syslog as usual and if too many messages appear to be queued they will be silently discarded. I liked doing it by default, but this patch only uses the queue in question if it was booted with audit=1 or if the kernel was built enabling audit by default. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: collect sessionid in netlink messagesEric Paris2008-04-2817-87/+132
| | | | | | | | | | Previously I added sessionid output to all audit messages where it was available but we still didn't know the sessionid of the sender of netlink messages. This patch adds that information to netlink messages so we can audit who sent netlink messages. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Audit: end printk with newlineEric Paris2008-04-281-4/+4
| | | | | | | A couple of audit printk statements did not have a newline. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2008-04-2774-5120/+4035Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (40 commits) [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug [SCSI] aic7xxx: add const [SCSI] aic7xxx: add static [SCSI] aic7xxx: Update _shipped files [SCSI] aic7xxx: teach aicasm to not emit unused debug code/data [SCSI] qla2xxx: Update version number to 8.02.01-k2. [SCSI] qla2xxx: Correct regression in relogin code. [SCSI] qla2xxx: Correct misc. endian and byte-ordering issues. [SCSI] qla2xxx: make qla2x00_issue_iocb_timeout() static [SCSI] qla2xxx: qla_os.c, make 2 functions static [SCSI] qla2xxx: Re-register FDMI information after a LIP. [SCSI] qla2xxx: Correct SRB usage-after-completion/free issues. [SCSI] qla2xxx: Correct ISP84XX verify-chip response handling. [SCSI] qla2xxx: Wakeup DPC thread to process any deferred-work requests. [SCSI] qla2xxx: Collapse RISC-RAM retrieval code during a firmware-dump. [SCSI] m68k: new mac_esp scsi driver [SCSI] zfcp: Add some statistics provided by the FCP adapter to the sysfs [SCSI] zfcp: Print some messages only during ERP [SCSI] zfcp: Wait for free SBAL during exchange config [SCSI] scsi_transport_fc: fc_user_scan correction ...
| * [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver ↵Kay Sievers2008-04-274-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hotplug/coldplug Since commit 43cc71eed1250755986da4c0f9898f9a635cb3bf Author: Kay Sievers <kay.sievers@vrfy.org> Date: Sat Aug 18 04:40:39 2007 +0200 platform: prefix MODALIAS with "platform:" the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable SCSI platform drivers, to re-enable auto loading. [dbrownell@users.sourceforge.net: more drivers, registration fixes] [akpm@linux-foundation.org: fix sgiwd93.c] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: add constDenys Vlasenko2008-04-2713-66/+61Star
| | | | | | | | | | | | | | | | This patch adds more const keywords where appropriate. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: add staticDenys Vlasenko2008-04-2712-257/+195Star
| | | | | | | | | | | | | | | | This patch adds static (and sometimes const) keywords where appropriate. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: Update _shipped filesHannes Reinecke2008-04-275-2544/+401Star
| | | | | | | | | | | | | | | | Update the precompiled sequencer code to match the latest aicasm changes. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: teach aicasm to not emit unused debug code/dataHannes Reinecke2008-04-277-16/+185
| | | | | | | | | | | | | | | | | | | | | | | | Add a 'count' variable to each symbol which gets increased every time the symbol is referenced. And then modify the register definition to include counts for symbols which are referenced from the source code only and not from the sequencer code. This will give us an automatic usage count for the symbols with only minimal hand-crafting. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Update version number to 8.02.01-k2.Andrew Vasquez2008-04-271-1/+1
| | | | | | | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Correct regression in relogin code.Andrew Vasquez2008-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commit 63a8651f2548c6bb5132c0b4e7dad4f57a9274db ([SCSI] qla2xxx: Correct infinite-login-retry issue.) introduced a small regression where a successful relogin would result in an fcport's loop_id to be incorrectly reset to FC_NO_LOOP_ID. Only clear-out loopid, if retries have been 'truly' exhausted. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Correct misc. endian and byte-ordering issues.Seokmann Ju2008-04-274-31/+14Star
| | | | | | | | | | | | | | | | | | There were several places in the driver which could cause byte ordering problem as provided by Al Viro <viro@ZenIV.linux.org.uk>. Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: make qla2x00_issue_iocb_timeout() staticAdrian Bunk2008-04-272-5/+1Star
| | | | | | | | | | | | | | | | | | This patch makes the needlessly global qla2x00_issue_iocb_timeout() static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: qla_os.c, make 2 functions staticAdrian Bunk2008-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | This patch makes the following needlessly global functions static: - qla2x00_alloc_work() - qla2x00_post_work() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Re-register FDMI information after a LIP.Andrew Vasquez2008-04-272-3/+3
| | | | | | | | | | | | | | | | | | Original code would (incorrectly) only re-register after a loop-down condition. Also, FDMI registration should be enabled by default. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Correct SRB usage-after-completion/free issues.Andrew Vasquez2008-04-271-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | The driver is incorrectly assuming that the 'sp' reference held in qla2[x00|4xx]_abort_command() is valid after the mailbox command is issued to abort the exchange. It is *not*, as the command may be completed during interrupt context before control is returned to the mailbox caller. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Correct ISP84XX verify-chip response handling.Andrew Vasquez2008-04-271-1/+1
| | | | | | | | | | | | | | | | Earlier code could trigger an infinite-retry if 1st invocation returned a non-CS_COMPLETE status. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Wakeup DPC thread to process any deferred-work requests.Andrew Vasquez2008-04-271-0/+4
| | | | | | | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx: Collapse RISC-RAM retrieval code during a firmware-dump.Andrew Vasquez2008-04-271-251/+143Star
| | | | | | | | | | | | | | | | | | | | | | Use the more efficient read-DMA'ble-buffer mailbox commands rather than reading a single word/dword at a time. We also remove a bulk of the duplicate mailbox command-handling codes in favor of more generic read-memory() routines (qla2xxx_dump_ram() and qla24xx_dump_ram()). Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] m68k: new mac_esp scsi driverFinn Thain2008-04-275-12/+700
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace the mac_esp driver with a new one based on the esp_scsi core. For esp_scsi: add support for sync transfers for the PIO mode, add a new esp_driver_ops method to get the maximum dma transfer size (like the old NCR53C9x driver), and some cleanups. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] zfcp: Add some statistics provided by the FCP adapter to the sysfsSwen Schillig2008-04-272-2/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new FCP adapter statistics provide a variety of information about the virtual adapter (subchannel). In order to collect this information the zfcp driver is extended to query this information. The information provided by the new FCP adapter statistics can be fetched by reading from the following files in the sysfs filesystem /sys/class/scsi_host/host<n>/seconds_active /sys/class/scsi_host/host<n>/requests /sys/class/scsi_host/host<n>/megabytes /sys/class/scsi_host/host<n>/utilization These are the statistics on a virtual adapter (subchannel) level. The information provided is raw and not modified or interpreted by any means. No interpretation or modification of the values is done by the zfcp driver. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] zfcp: Print some messages only during ERPSwen Schillig2008-04-271-17/+19
| | | | | | | | | | | | | | | | | | | | | | When statistics are polled from sysfs, the statistics use the same commands as the adapter initialization. Change the messages printed here, so they are only printed during initialization and not for each poll of adapter data. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] zfcp: Wait for free SBAL during exchange configSwen Schillig2008-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | When sending a exchange config data command, wait for a free SBAL. This does not matter during adapter initialization, but this is required for pulling adapter statistics during high I/O load. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] scsi_transport_fc: fc_user_scan correctionJames Smart2008-04-271-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | Way back when, when the fc_user_scan routine was created, it kept some of its original logic that walked the rport list and kicked off a scan. Unfortunately, it didn't keep any of the locking around the rport list, nor did it consider the synchronous nature of the scan invoked. The result, there are some scan requests where the rport list changes, thus a subsequent scan is called on a bogus rport structure and the system NMI's. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aha1542: minor irq handler cleanupsJeff Garzik2008-04-271-16/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | - where the 'irq' function argument is known never to be used, rename it to 'dummy' to make this more obvious - replace per-irq lookup functions and tables with a direct reference to data object obtained via 'dev_id' function argument, passed from request_irq() Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] scsi_transport_spi: include sysfs.hRandy Dunlap2008-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | scsi_transport_spi.c needs to #include <linux/sysfs.h>: next-20080423/drivers/scsi/scsi_transport_spi.c:1467: error: implicit declaration of function 'sysfs_update_group' make[3]: *** [drivers/scsi/scsi_transport_spi.o] Error 1 Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] FlashPoint: fix off-by-one errorsAdrian Bunk2008-04-271-1/+1
| | | | | | | | | | | | | | | | | | This patch fixes off-by-one errors in error checks (the variables are used as array indexes for arrays with MAX_SCSI_TAR resp. MAX_LUN elements) spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: Update type check in aicasm grammarHannes Reinecke2008-04-272-45/+66
| | | | | | | | | | | | | | | | | | | | | | | | The function type_check() in aicasm grammar code was never used properly due to a bug. This patch fixes it up and ensures it's only called if appropriate. In addition the unused 16bit instruction are disabled, but left in the code for reference. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] fix SLUB WARN_ONJames Bottomley2008-04-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're getting a WARN_ON from SLUB indicating that we're trying to free caches with in-use objects. The root cause is a new dependency in the command/sense free on unchecked_isa_dma. The WARN_ON is caused by drivers which change this in their setup after the command/sense cache is allocated. The fix is to move the allocation of this cache into scsi_add_host() so things like gdth have an opportunity to modify it between alloc and add (but *not* after). The true fix would be to move unchecked_isa_dma into the template and out of the host, so it because a truly read only variable. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] esp_scsi: Make cur_residue and tot_residue signed.David S. Miller2008-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | Many of the overflow checks test whether the value has gone negative, and we want to retain such checks. Reported by Julia Lawall. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aha152x, eata, u14-34f: minor irq handler cleanupsJeff Garzik2008-04-253-18/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove pointless casts from void* - remove needless references to 'irq' function argument, when that information is already stored somewhere in a driver-private struct. - where the 'irq' function argument is known never to be used, rename it to 'dummy' to make this more obvious - remove always-false tests for dev_id==NULL - remove always-true tests for 'irq == host_struct->irq' - replace per-irq lookup functions and tables with a direct reference to data object obtained via 'dev_id' function argument, passed from request_irq() This change's main purpose is to prepare for the patchset in jgarzik/misc-2.6.git#irq-remove, that explores removal of the never-used 'irq' argument in each interrupt handler. Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic79xx: fix MMIO for PPC 44x platformsSergei Shtylyov2008-04-242-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver stores the PCI resource address into 'u_long' variable before calling ioremap_nocache() on it. This warrants kernel oops when the registers are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped beyond 4 GB. The arch/ppc/ kernel has a fixup in ioremap() that helps create an illusion that the PCI memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx: fix MMIO for PPC 44x platformsSergei Shtylyov2008-04-242-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver stores the PCI resource address into 'u_long' variable before calling ioremap_nocache() on it. This warrants kernel oops when the registers are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped beyond 4 GB. The arch/ppc/ kernel has a fixup in ioremap() that helps create an illusion that the PCI memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] aic7xxx, aic79xx: deinline functionsDenys Vlasenko2008-04-2411-1679/+1719
| | | | | | | | | | | | | | | | Deinlines and moves big functions from .h to .c files. Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] scsi_transport_sas: fix the lifetime of sas bsg objectsFUJITA Tomonori2008-04-221-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scsi_transport_sas calls blk_cleanup_queue too early for bsg queues. If a user holds a sas_host, end_device, or expander device open, remove the device, then send a request to it, we get a kernel crash. We need to call blk_cleanup_queue in the release callback as we do with scsi devices. This patch moves blk_cleanup_queue to sas_expander_release and sas_end_device_release from sas_bsg_remove. sas_host can't use the release callback in struct device so use bsg's release callback. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] bsg: add release callback supportFUJITA Tomonori2008-04-224-20/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds release callback support, which is called when a bsg device goes away. bsg_register_queue() takes a pointer to a callback function. This feature is useful for stuff like sas_host that can't use the release callback in struct device. If a caller doesn't need bsg's release callback, it can call bsg_register_queue() with NULL pointer (e.g. scsi devices can use release callback in struct device so they don't need bsg's callback). With this patch, bsg uses kref for refcounts on bsg devices instead of get/put_device in fops->open/release. bsg calls put_device and the caller's release callback (if it was registered) in kref_put's release. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] rework scsi_target allocationJames Bottomley2008-04-223-39/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current target allocation code registeres each possible target with sysfs; it will be deleted again if no useable LUN on this target was found. This results in a string of 'target add/target remove' uevents. Based on a patch by Hannes Reinecke <hare@suse.de> this patch reworks the target allocation code so that only uevents for existing targets are sent. The sysfs registration is split off from the existing scsi_target_alloc() into a in a new scsi_add_target() function, which should be called whenever an existing target is found. Only then a uevent is sent, so we'll be generating events for existing targets only. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] use default attributes for scsi_hostHannes Reinecke2008-04-223-61/+25Star
| | | | | | | | | | | | | | | | | | | | This patch removes the unused sysfs attibute overwriting logic for the scsi host attibutes, and plugs them into the driver core default attribute creation. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] scsi_transport_spi: fix the attribute settingsJames Bottomley2008-04-221-24/+8Star
| | | | | | | | | | | | | | We now take advantage of the mode_t return of is_valid, and also update the attributes when the target is configured. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] sysfs: make group is_valid return a mode_tJames Bottomley2008-04-224-18/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | We have a problem in scsi_transport_spi in that we need to customise not only the visibility of the attributes, but also their mode. Fix this by making the is_visible() callback return a mode, with 0 indicating is not visible. Also add a sysfs_update_group() API to allow us to change either the visibility or mode of the files at any time on the fly. Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] qla2xxx, lfpc: Rename 'state' attribute to 'link_state'Hannes Reinecke2008-04-222-9/+9
| | | | | | | | | | | | | | | | | | | | | | lpfc and qla2xxx overwrite the standard 'state' attribute with custom callbacks. So rename the custom attributes to 'link_state' and retain the original meaning of the 'state' attribute. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Acked-by: James Smart <James.Smart@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] add scsi_host and scsi_target to scsi_busHannes Reinecke2008-04-224-10/+50
| | | | | | | | | | | | | | | | | | This patch implements scsi_host and scsi_target device types and adds both to the scsi_bus. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] ses: fix up functionality after class_device->device conversionJames Bottomley2008-04-221-29/+71
| | | | | | | | | | | | | | | | | | ses uses an unusual two level class hierarchy which broke in this conversion. Fix it up still with a two level hierarchy, but this time let the ses device manage the links to and from the real device in the enclosure. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
| * [SCSI] st: fix up after class_device removalJames Bottomley2008-04-221-5/+5
| | | | | | | | | | | | | | | | | | | | There's a change in the SCSI tree that adds another class_device, so change it to an ordinary device [jejb: this one got rebased until it's basically cosmetic only] Cc: Kai Makisara <Kai.Makisara@kolumbus.fi> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>