Release 4.7 drivers/scsi/hosts.c
/*
* hosts.c Copyright (C) 1992 Drew Eckhardt
* Copyright (C) 1993, 1994, 1995 Eric Youngdale
* Copyright (C) 2002-2003 Christoph Hellwig
*
* mid to lowlevel SCSI driver interface
* Initial versions: Drew Eckhardt
* Subsequent revisions: Eric Youngdale
*
* <drew@colorado.edu>
*
* Jiffies wrap fixes (host->resetting), 3 Dec 1998 Andrea Arcangeli
* Added QLOGIC QLA1280 SCSI controller kernel host support.
* August 4, 1999 Fred Lewis, Intel DuPont
*
* Updated to reflect the new initialization scheme for the higher
* level of scsi drivers (sd/sr/st)
* September 17, 2000 Torben Mathiasen <tmm@image.dk>
*
* Restructured scsi_host lists and associated functions.
* September 04, 2002 Mike Anderson (andmike@us.ibm.com)
*/
#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/transport_class.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/idr.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
static DEFINE_IDA(host_index_ida);
static void scsi_host_cls_release(struct device *dev)
{
put_device(&class_to_shost(dev)->shost_gendev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 19 | 86.36% | 1 | 50.00% |
tony jones | tony jones | 3 | 13.64% | 1 | 50.00% |
| Total | 22 | 100.00% | 2 | 100.00% |
static struct class shost_class = {
.name = "scsi_host",
.dev_release = scsi_host_cls_release,
};
/**
* scsi_host_set_state - Take the given host through the host state model.
* @shost: scsi host to change the state of.
* @state: state to change to.
*
* Returns zero if unsuccessful or an error if the requested
* transition is illegal.
**/
int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)
{
enum scsi_host_state oldstate = shost->shost_state;
if (state == oldstate)
return 0;
switch (state) {
case SHOST_CREATED:
/* There are no legal states that come back to
* created. This is the manually initialised start
* state */
goto illegal;
case SHOST_RUNNING:
switch (oldstate) {
case SHOST_CREATED:
case SHOST_RECOVERY:
break;
default:
goto illegal;
}
break;
case SHOST_RECOVERY:
switch (oldstate) {
case SHOST_RUNNING:
break;
default:
goto illegal;
}
break;
case SHOST_CANCEL:
switch (oldstate) {
case SHOST_CREATED:
case SHOST_RUNNING:
case SHOST_CANCEL_RECOVERY:
break;
default:
goto illegal;
}
break;
case SHOST_DEL:
switch (oldstate) {
case SHOST_CANCEL:
case SHOST_DEL_RECOVERY:
break;
default:
goto illegal;
}
break;
case SHOST_CANCEL_RECOVERY:
switch (oldstate) {
case SHOST_CANCEL:
case SHOST_RECOVERY:
break;
default:
goto illegal;
}
break;
case SHOST_DEL_RECOVERY:
switch (oldstate) {
case SHOST_CANCEL_RECOVERY:
break;
default:
goto illegal;
}
break;
}
shost->shost_state = state;
return 0;
illegal:
SCSI_LOG_ERROR_RECOVERY(1,
shost_printk(KERN_ERR, shost,
"Illegal host state transition"
"%s->%s\n",
scsi_host_state_name(oldstate),
scsi_host_state_name(state)));
return -EINVAL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mike anderson | mike anderson | 161 | 77.78% | 1 | 33.33% |
james bottomley | james bottomley | 46 | 22.22% | 2 | 66.67% |
| Total | 207 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(scsi_host_set_state);
/**
* scsi_remove_host - remove a scsi host
* @shost: a pointer to a scsi host to remove
**/
void scsi_remove_host(struct Scsi_Host *shost)
{
unsigned long flags;
mutex_lock(&shost->scan_mutex);
spin_lock_irqsave(shost->host_lock, flags);
if (scsi_host_set_state(shost, SHOST_CANCEL))
if (scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY)) {
spin_unlock_irqrestore(shost->host_lock, flags);
mutex_unlock(&shost->scan_mutex);
return;
}
spin_unlock_irqrestore(shost->host_lock, flags);
scsi_autopm_get_host(shost);
flush_workqueue(shost->tmf_work_q);
scsi_forget_host(shost);
mutex_unlock(&shost->scan_mutex);
scsi_proc_host_rm(shost);
spin_lock_irqsave(shost->host_lock, flags);
if (scsi_host_set_state(shost, SHOST_DEL))
BUG_ON(scsi_host_set_state(shost, SHOST_DEL_RECOVERY));
spin_unlock_irqrestore(shost->host_lock, flags);
transport_unregister_device(&shost->shost_gendev);
device_unregister(&shost->shost_dev);
device_del(&shost->shost_gendev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
james bottomley | james bottomley | 92 | 54.44% | 4 | 19.05% |
mike anderson | mike anderson | 30 | 17.75% | 7 | 33.33% |
christoph hellwig | christoph hellwig | 24 | 14.20% | 3 | 14.29% |
hannes reinecke | hannes reinecke | 7 | 4.14% | 1 | 4.76% |
alan stern | alan stern | 5 | 2.96% | 1 | 4.76% |
alexey kuznetsov | alexey kuznetsov | 5 | 2.96% | 1 | 4.76% |
arjan van de ven | arjan van de ven | 2 | 1.18% | 1 | 4.76% |
tony jones | tony jones | 2 | 1.18% | 1 | 4.76% |
doug ledford | doug ledford | 1 | 0.59% | 1 | 4.76% |
pre-git | pre-git | 1 | 0.59% | 1 | 4.76% |
| Total | 169 | 100.00% | 21 | 100.00% |
EXPORT_SYMBOL(scsi_remove_host);
/**
* scsi_add_host_with_dma - add a scsi host with dma device
* @shost: scsi host pointer to add
* @dev: a struct device of type scsi class
* @dma_dev: dma device for the host
*
* Note: You rarely need to worry about this unless you're in a
* virtualised host environments, so use the simpler scsi_add_host()
* function instead.
*
* Return value:
* 0 on success / != 0 for error
**/
int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
struct device *dma_dev)
{
struct scsi_host_template *sht = shost->hostt;
int error = -EINVAL;
shost_printk(KERN_INFO, shost, "%s\n",
sht->info ? sht->info(shost) : sht->name);
if (!shost->can_queue) {
shost_printk(KERN_ERR, shost,
"can_queue = 0 no longer supported\n");
goto fail;
}
if (shost_use_blk_mq(shost)) {
error = scsi_mq_setup_tags(shost);
if (error)
goto fail;
} else {
shost->bqt = blk_init_tags(shost->can_queue,
shost->hostt->tag_alloc_policy);
if (!shost->bqt) {
error = -ENOMEM;
goto fail;
}
}
/*
* Note that we allocate the freelist even for the MQ case for now,
* as we need a command set aside for scsi_reset_provider. Having
* the full host freelist and one command available for that is a
* little heavy-handed, but avoids introducing a special allocator
* just for this. Eventually the structure of scsi_reset_provider
* will need a major overhaul.
*/
error = scsi_setup_command_freelist(shost);
if (error)
goto out_destroy_tags;
if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus;
if (!dma_dev)
dma_dev = shost->shost_gendev.parent;
shost->dma_dev = dma_dev;
error = device_add(&shost->shost_gendev);
if (error)
goto out_destroy_freelist;
/*
* Increase usage count temporarily here so that calling
* scsi_autopm_put_host() will trigger runtime idle if there is
* nothing else preventing suspending the device.
*/
pm_runtime_get_noresume(&shost->shost_gendev);
pm_runtime_set_active(&shost->shost_gendev);
pm_runtime_enable(&shost->shost_gendev);
device_enable_async_suspend(&shost->shost_gendev);
scsi_host_set_state(shost, SHOST_RUNNING);
get_device(shost->shost_gendev.parent);
device_enable_async_suspend(&shost->shost_dev);
error = device_add(&shost->shost_dev);
if (error)
goto out_del_gendev;
get_device(&shost->shost_gendev);
if (shost->transportt->host_size) {
shost->shost_data = kzalloc(shost->transportt->host_size,
GFP_KERNEL);
if (shost->shost_data == NULL) {
error = -ENOMEM;
goto out_del_dev;
}
}
if (shost->transportt->create_work_queue) {
snprintf(shost->work_q_name, sizeof(shost->work_q_name),
"scsi_wq_%d", shost->host_no);
shost->work_q = create_singlethread_workqueue(
shost->work_q_name);
if (!shost->work_q) {
error = -EINVAL;
goto out_free_shost_data;
}
}
error = scsi_sysfs_add_host(shost);
if (error)
goto out_destroy_host;
scsi_proc_host_add(shost);
scsi_autopm_put_host(shost);
return error;
out_destroy_host:
if (shost->work_q)
destroy_workqueue(shost->work_q);
out_free_shost_data:
kfree(shost->shost_data);
out_del_dev:
device_del(&shost->shost_dev);
out_del_gendev:
device_del(&shost->shost_gendev);
out_destroy_freelist:
scsi_destroy_command_freelist(shost);
out_destroy_tags:
if (shost_use_blk_mq(shost))
scsi_mq_destroy_tags(shost);
fail:
return error;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 220 | 44.62% | 8 | 26.67% |
james bottomley | james bottomley | 93 | 18.86% | 7 | 23.33% |
james smart | james smart | 90 | 18.26% | 2 | 6.67% |
alan stern | alan stern | 24 | 4.87% | 1 | 3.33% |
mike anderson | mike anderson | 21 | 4.26% | 4 | 13.33% |
mika westerberg | mika westerberg | 14 | 2.84% | 1 | 3.33% |
rafael j. wysocki | rafael j. wysocki | 8 | 1.62% | 1 | 3.33% |
hannes reinecke | hannes reinecke | 7 | 1.42% | 1 | 3.33% |
tony jones | tony jones | 6 | 1.22% | 1 | 3.33% |
kay sievers | kay sievers | 6 | 1.22% | 1 | 3.33% |
pre-git | pre-git | 2 | 0.41% | 1 | 3.33% |
fujita tomonori | fujita tomonori | 1 | 0.20% | 1 | 3.33% |
andrew morton | andrew morton | 1 | 0.20% | 1 | 3.33% |
| Total | 493 | 100.00% | 30 | 100.00% |
EXPORT_SYMBOL(scsi_add_host_with_dma);
static void scsi_host_dev_release(struct device *dev)
{
struct Scsi_Host *shost = dev_to_shost(dev);
struct device *parent = dev->parent;
struct request_queue *q;
void *queuedata;
scsi_proc_hostdir_rm(shost->hostt);
if (shost->tmf_work_q)
destroy_workqueue(shost->tmf_work_q);
if (shost->ehandler)
kthread_stop(shost->ehandler);
if (shost->work_q)
destroy_workqueue(shost->work_q);
q = shost->uspace_req_q;
if (q) {
queuedata = q->queuedata;
blk_cleanup_queue(q);
kfree(queuedata);
}
if (shost->shost_state == SHOST_CREATED) {
/*
* Free the shost_dev device name here if scsi_host_alloc()
* and scsi_host_put() have been called but neither
* scsi_host_add() nor scsi_host_remove() has been called.
* This avoids that the memory allocated for the shost_dev
* name is leaked.
*/
kfree(dev_name(&shost->shost_dev));
}
scsi_destroy_command_freelist(shost);
if (shost_use_blk_mq(shost)) {
if (shost->tag_set.tags)
scsi_mq_destroy_tags(shost);
} else {
if (shost->bqt)
blk_free_tags(shost->bqt);
}
kfree(shost->shost_data);
ida_simple_remove(&host_index_ida, shost->host_no);
if (parent)
put_device(parent);
kfree(shost);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 56 | 26.79% | 4 | 20.00% |
bart van assche | bart van assche | 49 | 23.44% | 3 | 15.00% |
mike anderson | mike anderson | 20 | 9.57% | 2 | 10.00% |
james bottomley | james bottomley | 20 | 9.57% | 2 | 10.00% |
james smart | james smart | 13 | 6.22% | 1 | 5.00% |
hannes reinecke | hannes reinecke | 13 | 6.22% | 1 | 5.00% |
fujita tomonori | fujita tomonori | 10 | 4.78% | 1 | 5.00% |
lee duncan | lee duncan | 10 | 4.78% | 1 | 5.00% |
alan stern | alan stern | 7 | 3.35% | 1 | 5.00% |
andrew morton | andrew morton | 4 | 1.91% | 1 | 5.00% |
luben tuikov | luben tuikov | 4 | 1.91% | 1 | 5.00% |
pre-git | pre-git | 3 | 1.44% | 2 | 10.00% |
| Total | 209 | 100.00% | 20 | 100.00% |
static int shost_eh_deadline = -1;
module_param_named(eh_deadline, shost_eh_deadline, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(eh_deadline,
"SCSI EH timeout in seconds (should be between 0 and 2^31-1)");
static struct device_type scsi_host_type = {
.name = "scsi_host",
.release = scsi_host_dev_release,
};
/**
* scsi_host_alloc - register a scsi host adapter instance.
* @sht: pointer to scsi host template
* @privsize: extra bytes to allocate for driver
*
* Note:
* Allocate a new Scsi_Host and perform basic initialization.
* The host is not published to the scsi midlayer until scsi_add_host
* is called.
*
* Return value:
* Pointer to a new Scsi_Host
**/
struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
{
struct Scsi_Host *shost;
gfp_t gfp_mask = GFP_KERNEL;
int index;
if (sht->unchecked_isa_dma && privsize)
gfp_mask |= __GFP_DMA;
shost = kzalloc(sizeof(struct Scsi_Host) + privsize, gfp_mask);
if (!shost)
return NULL;
shost->host_lock = &shost->default_lock;
spin_lock_init(shost->host_lock);
shost->shost_state = SHOST_CREATED;
INIT_LIST_HEAD(&shost->__devices);
INIT_LIST_HEAD(&shost->__targets);
INIT_LIST_HEAD(&shost->eh_cmd_q);
INIT_LIST_HEAD(&shost->starved_list);
init_waitqueue_head(&shost->host_wait);
mutex_init(&shost->scan_mutex);
index = ida_simple_get(&host_index_ida, 0, 0, GFP_KERNEL);
if (index < 0)
goto fail_kfree;
shost->host_no = index;
shost->dma_channel = 0xff;
/* These three are default values which can be overridden */
shost->max_channel = 0;
shost->max_id = 8;
shost->max_lun = 8;
/* Give each shost a default transportt */
shost->transportt = &blank_transport_template;
/*
* All drivers right now should be able to handle 12 byte
* commands. Every so often there are requests for 16 byte
* commands, but individual low-level drivers need to certify that
* they actually do something sensible with such commands.
*/
shost->max_cmd_len = 12;
shost->hostt = sht;
shost->this_id = sht->this_id;
shost->can_queue = sht->can_queue;
shost->sg_tablesize = sht->sg_tablesize;
shost->sg_prot_tablesize = sht->sg_prot_tablesize;
shost->cmd_per_lun = sht->cmd_per_lun;
shost->unchecked_isa_dma = sht->unchecked_isa_dma;
shost->use_clustering = sht->use_clustering;
shost->no_write_same = sht->no_write_same;
if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler)
shost->eh_deadline = -1;
else if ((ulong) shost_eh_deadline * HZ > INT_MAX) {
shost_printk(KERN_WARNING, shost,
"eh_deadline %u too large, setting to %u\n",
shost_eh_deadline, INT_MAX / HZ);
shost->eh_deadline = INT_MAX;
} else
shost->eh_deadline = shost_eh_deadline * HZ;
if (sht->supported_mode == MODE_UNKNOWN)
/* means we didn't set it ... default to INITIATOR */
shost->active_mode = MODE_INITIATOR;
else
shost->active_mode = sht->supported_mode;
if (sht->max_host_blocked)
shost->max_host_blocked = sht->max_host_blocked;
else
shost->max_host_blocked = SCSI_DEFAULT_HOST_BLOCKED;
/*
* If the driver imposes no hard sector transfer limit, start at
* machine infinity initially.
*/
if (sht->max_sectors)
shost->max_sectors = sht->max_sectors;
else
shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
/*
* assume a 4GB boundary, if not set
*/
if (sht->dma_boundary)
shost->dma_boundary = sht->dma_boundary;
else
shost->dma_boundary = 0xffffffff;
shost->use_blk_mq = scsi_use_blk_mq && !shost->hostt->disable_blk_mq;
device_initialize(&shost->shost_gendev);
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
shost->shost_gendev.bus = &scsi_bus_type;
shost->shost_gendev.type = &scsi_host_type;
device_initialize(&shost->shost_dev);
shost->shost_dev.parent = &shost->shost_gendev;
shost->shost_dev.class = &shost_class;
dev_set_name(&shost->shost_dev, "host%d", shost->host_no);
shost->shost_dev.groups = scsi_sysfs_shost_attr_groups;
shost->ehandler = kthread_run(scsi_error_handler, shost,
"scsi_eh_%d", shost->host_no);
if (IS_ERR(shost->ehandler)) {
shost_printk(KERN_WARNING, shost,
"error handler thread failed to spawn, error = %ld\n",
PTR_ERR(shost->ehandler));
goto fail_index_remove;
}
shost->tmf_work_q = alloc_workqueue("scsi_tmf_%d",
WQ_UNBOUND | WQ_MEM_RECLAIM,
1, shost->host_no);
if (!shost->tmf_work_q) {
shost_printk(KERN_WARNING, shost,
"failed to create tmf workq\n");
goto fail_kthread;
}
scsi_proc_hostdir_add(shost->hostt);
return shost;
fail_kthread:
kthread_stop(shost->ehandler);
fail_index_remove:
ida_simple_remove(&host_index_ida, shost->host_no);
fail_kfree:
kfree(shost);
return NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mike anderson | mike anderson | 184 | 28.09% | 6 | 13.95% |
christoph hellwig | christoph hellwig | 173 | 26.41% | 10 | 23.26% |
hannes reinecke | hannes reinecke | 83 | 12.67% | 7 | 16.28% |
james bottomley | james bottomley | 62 | 9.47% | 5 | 11.63% |
ren mingxin | ren mingxin | 53 | 8.09% | 1 | 2.33% |
lee duncan | lee duncan | 40 | 6.11% | 1 | 2.33% |
martin k. petersen | martin k. petersen | 13 | 1.98% | 2 | 4.65% |
patrick mansfield | patrick mansfield | 8 | 1.22% | 1 | 2.33% |
anton blanchard | anton blanchard | 7 | 1.07% | 1 | 2.33% |
doug ledford | doug ledford | 7 | 1.07% | 1 | 2.33% |
justin mattock | justin mattock | 6 | 0.92% | 1 | 2.33% |
tony jones | tony jones | 6 | 0.92% | 1 | 2.33% |
kay sievers | kay sievers | 4 | 0.61% | 1 | 2.33% |
joe eykholt | joe eykholt | 3 | 0.46% | 1 | 2.33% |
jens axboe | jens axboe | 2 | 0.31% | 1 | 2.33% |
al viro | al viro | 2 | 0.31% | 1 | 2.33% |
arjan van de ven | arjan van de ven | 1 | 0.15% | 1 | 2.33% |
jes sorensen | jes sorensen | 1 | 0.15% | 1 | 2.33% |
| Total | 655 | 100.00% | 43 | 100.00% |
EXPORT_SYMBOL(scsi_host_alloc);
struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize)
{
struct Scsi_Host *shost = scsi_host_alloc(sht, privsize);
if (!sht->detect) {
printk(KERN_WARNING "scsi_register() called on new-style "
"template for driver %s\n", sht->name);
dump_stack();
}
if (shost)
list_add_tail(&shost->sht_legacy_list, &sht->legacy_hosts);
return shost;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 54 | 77.14% | 6 | 85.71% |
mike anderson | mike anderson | 16 | 22.86% | 1 | 14.29% |
| Total | 70 | 100.00% | 7 | 100.00% |
EXPORT_SYMBOL(scsi_register);
void scsi_unregister(struct Scsi_Host *shost)
{
list_del(&shost->sht_legacy_list);
scsi_host_put(shost);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 15 | 65.22% | 1 | 50.00% |
mike anderson | mike anderson | 8 | 34.78% | 1 | 50.00% |
| Total | 23 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(scsi_unregister);
static int __scsi_host_match(struct device *dev, const void *data)
{
struct Scsi_Host *p;
const unsigned short *hostnum = data;
p = class_to_shost(dev);
return p->host_no == *hostnum;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dave young | dave young | 39 | 88.64% | 1 | 33.33% |
tony jones | tony jones | 3 | 6.82% | 1 | 33.33% |
michal miroslaw | michal miroslaw | 2 | 4.55% | 1 | 33.33% |
| Total | 44 | 100.00% | 3 | 100.00% |
/**
* scsi_host_lookup - get a reference to a Scsi_Host by host no
* @hostnum: host number to locate
*
* Return value:
* A pointer to located Scsi_Host or NULL.
*
* The caller must do a scsi_host_put() to drop the reference
* that scsi_host_get() took. The put_device() below dropped
* the reference from class_find_device().
**/
struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
{
struct device *cdev;
struct Scsi_Host *shost = NULL;
cdev = class_find_device(&shost_class, NULL, &hostnum,
__scsi_host_match);
if (cdev) {
shost = scsi_host_get(class_to_shost(cdev));
put_device(cdev);
}
return shost;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 28 | 45.16% | 1 | 11.11% |
mike anderson | mike anderson | 11 | 17.74% | 2 | 22.22% |
dave young | dave young | 10 | 16.13% | 1 | 11.11% |
mike christie | mike christie | 7 | 11.29% | 1 | 11.11% |
tony jones | tony jones | 2 | 3.23% | 1 | 11.11% |
greg kroah-hartman | greg kroah-hartman | 2 | 3.23% | 1 | 11.11% |
james smart | james smart | 1 | 1.61% | 1 | 11.11% |
pre-git | pre-git | 1 | 1.61% | 1 | 11.11% |
| Total | 62 | 100.00% | 9 | 100.00% |
EXPORT_SYMBOL(scsi_host_lookup);
/**
* scsi_host_get - inc a Scsi_Host ref count
* @shost: Pointer to Scsi_Host to inc.
**/
struct Scsi_Host *scsi_host_get(struct Scsi_Host *shost)
{
if ((shost->shost_state == SHOST_DEL) ||
!get_device(&shost->shost_gendev))
return NULL;
return shost;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mike anderson | mike anderson | 37 | 100.00% | 3 | 100.00% |
| Total | 37 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(scsi_host_get);
/**
* scsi_host_put - dec a Scsi_Host ref count
* @shost: Pointer to Scsi_Host to dec.
**/
void scsi_host_put(struct Scsi_Host *shost)
{
put_device(&shost->shost_gendev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mike anderson | mike anderson | 15 | 83.33% | 2 | 40.00% |
christoph hellwig | christoph hellwig | 1 | 5.56% | 1 | 20.00% |
james bottomley | james bottomley | 1 | 5.56% | 1 | 20.00% |
pre-git | pre-git | 1 | 5.56% | 1 | 20.00% |
| Total | 18 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL(scsi_host_put);
int scsi_init_hosts(void)
{
return class_register(&shost_class);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 14 | 100.00% | 1 | 100.00% |
| Total | 14 | 100.00% | 1 | 100.00% |
void scsi_exit_hosts(void)
{
class_unregister(&shost_class);
ida_destroy(&host_index_ida);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 13 | 68.42% | 1 | 50.00% |
lee duncan | lee duncan | 6 | 31.58% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
int scsi_is_host_device(const struct device *dev)
{
return dev->type == &scsi_host_type;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
james bottomley | james bottomley | 16 | 84.21% | 1 | 50.00% |
hannes reinecke | hannes reinecke | 3 | 15.79% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(scsi_is_host_device);
/**
* scsi_queue_work - Queue work to the Scsi_Host workqueue.
* @shost: Pointer to Scsi_Host.
* @work: Work to queue for execution.
*
* Return value:
* 1 - work queued for execution
* 0 - work is already queued
* -EINVAL - work queue doesn't exist
**/
int scsi_queue_work(struct Scsi_Host *shost, struct work_struct *work)
{
if (unlikely(!shost->work_q)) {
shost_printk(KERN_ERR, shost,
"ERROR: Scsi host '%s' attempted to queue scsi-work, "
"when no workqueue created.\n", shost->hostt->name);
dump_stack();
return -EINVAL;
}
return queue_work(shost->work_q, work);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
james smart | james smart | 56 | 93.33% | 1 | 50.00% |
hannes reinecke | hannes reinecke | 4 | 6.67% | 1 | 50.00% |
| Total | 60 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(scsi_queue_work);
/**
* scsi_flush_work - Flush a Scsi_Host's workqueue.
* @shost: Pointer to Scsi_Host.
**/
void scsi_flush_work(struct Scsi_Host *shost)
{
if (!shost->work_q) {
shost_printk(KERN_ERR, shost,
"ERROR: Scsi host '%s' attempted to flush scsi-work, "
"when no workqueue created.\n", shost->hostt->name);
dump_stack();
return;
}
flush_workqueue(shost->work_q);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mike christie | mike christie | 42 | 91.30% | 1 | 50.00% |
hannes reinecke | hannes reinecke | 4 | 8.70% | 1 | 50.00% |
| Total | 46 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(scsi_flush_work);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
christoph hellwig | christoph hellwig | 645 | 27.35% | 23 | 19.33% |
mike anderson | mike anderson | 512 | 21.71% | 11 | 9.24% |
james bottomley | james bottomley | 344 | 14.59% | 19 | 15.97% |
james smart | james smart | 165 | 7.00% | 3 | 2.52% |
hannes reinecke | hannes reinecke | 159 | 6.74% | 7 | 5.88% |
lee duncan | lee duncan | 62 | 2.63% | 1 | 0.84% |
ren mingxin | ren mingxin | 58 | 2.46% | 1 | 0.84% |
mike christie | mike christie | 56 | 2.37% | 2 | 1.68% |
dave young | dave young | 49 | 2.08% | 1 | 0.84% |
bart van assche | bart van assche | 49 | 2.08% | 3 | 2.52% |
adrian bunk | adrian bunk | 40 | 1.70% | 2 | 1.68% |
alan stern | alan stern | 39 | 1.65% | 2 | 1.68% |
pre-git | pre-git | 29 | 1.23% | 12 | 10.08% |
tony jones | tony jones | 23 | 0.98% | 1 | 0.84% |
mika westerberg | mika westerberg | 14 | 0.59% | 1 | 0.84% |
martin k. petersen | martin k. petersen | 13 | 0.55% | 2 | 1.68% |
fujita tomonori | fujita tomonori | 11 | 0.47% | 2 | 1.68% |
kay sievers | kay sievers | 10 | 0.42% | 2 | 1.68% |
patrick mansfield | patrick mansfield | 8 | 0.34% | 1 | 0.84% |
doug ledford | doug ledford | 8 | 0.34% | 2 | 1.68% |
rafael j. wysocki | rafael j. wysocki | 8 | 0.34% | 1 | 0.84% |
andrew morton | andrew morton | 7 | 0.30% | 3 | 2.52% |
anton blanchard | anton blanchard | 7 | 0.30% | 1 | 0.84% |
justin mattock | justin mattock | 6 | 0.25% | 1 | 0.84% |
alexey kuznetsov | alexey kuznetsov | 5 | 0.21% | 1 | 0.84% |
luben tuikov | luben tuikov | 4 | 0.17% | 1 | 0.84% |
arjan van de ven | arjan van de ven | 3 | 0.13% | 1 | 0.84% |
russell king | russell king | 3 | 0.13% | 1 | 0.84% |
tejun heo | tejun heo | 3 | 0.13% | 1 | 0.84% |
joe eykholt | joe eykholt | 3 | 0.13% | 1 | 0.84% |
greg kroah-hartman | greg kroah-hartman | 2 | 0.08% | 1 | 0.84% |
geert uytterhoeven | geert uytterhoeven | 2 | 0.08% | 1 | 0.84% |
josh hunt | josh hunt | 2 | 0.08% | 1 | 0.84% |
michal miroslaw | michal miroslaw | 2 | 0.08% | 1 | 0.84% |
jens axboe | jens axboe | 2 | 0.08% | 1 | 0.84% |
al viro | al viro | 2 | 0.08% | 1 | 0.84% |
rob landley | rob landley | 1 | 0.04% | 1 | 0.84% |
michael reed | michael reed | 1 | 0.04% | 1 | 0.84% |
jes sorensen | jes sorensen | 1 | 0.04% | 1 | 0.84% |
| Total | 2358 | 100.00% | 119 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.