summaryrefslogtreecommitdiffstats
path: root/block/bsg.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | [BLOCK] Get rid of request_queue_t typedefJens Axboe2007-07-241-6/+6
|/ | | | | | | | | Some of the code has been gradually transitioned to using the proper struct request_queue, but there's lots left. So do a full sweet of the kernel and get rid of this typedef and replace its uses with the proper type. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2007-07-221-38/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (60 commits) [SCSI] libsas: make ATA functions selectable by a config option [SCSI] bsg: unexport sg v3 helper functions [SCSI] bsg: fix bsg_unregister_queue [SCSI] bsg: make class backlinks [SCSI] 3w-9xxx: add support for 9690SA [SCSI] bsg: fix bsg_register_queue error path [SCSI] ESP: Increase ESP_BUS_TIMEOUT to 275. [SCSI] libsas: fix scr_read/write users and update the libata documentation [SCSI] mpt fusion: update Kconfig help [SCSI] scsi_transport_sas: add destructor for bsg [SCSI] iscsi_tcp: buggered kmalloc() [SCSI] qla2xxx: Update version number to 8.02.00-k2. [SCSI] qla2xxx: Add ISP25XX support. [SCSI] qla2xxx: Use pci_try_set_mwi(). [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces. [SCSI] qla2xxx: Re-factor isp_operations to static structures. [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling. [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration. [SCSI] qla2xxx: Generalize iIDMA support. [SCSI] qla2xxx: Generalize FW-Interface-2 support. ...
| * [SCSI] bsg: fix bsg_unregister_queueFUJITA Tomonori2007-07-211-1/+2
| | | | | | | | | | | | | | | | scsi_sysfs_add_sdev ignores the bsg_register_queue failure, so bsg_unregister_queue must check whether the queue has a bsg device. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * [SCSI] bsg: make class backlinksJames Bottomley2007-07-211-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, bsg doesn't make class backlinks (a process whereby you'd get a link to bsg in the device directory in the same way you get one for sg). This is because the bsg device is uninitialised, so the class device has nothing it can attach to. The fix is to make the bsg device point to the cdevice of the entity creating the bsg, necessitating changing the bsg_register_queue() prototype into a form that takes the generic device. Acked-by: FUJITA Tomonori <tomof@acm.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * [SCSI] bsg: fix bsg_register_queue error pathJames Bottomley2007-07-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | unfortunately, if IS_ERR(class_dev) is true, that means class_dev isn't null and the check in the error leg is pointless ... it's also asking for trouble to request unregistration of a device we haven't actually created (although it works currently). Fix by using explicit gotos and unregisters. Acked-by: FUJITA Tomonori <tomof@acm.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * [SCSI] bsg: separate bsg and SCSI (so SCSI can be modular)James Bottomley2007-07-191-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the bsg registration into SCSI so that bsg no longer has a dependency on the scsi_interface_register API. This can be viewed as a temporary expedient until we can get universal bsg binding sorted out properly. Also use the sdev bus_id as the generic bsg name (to avoid clashes with the queue name). Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* | mm: Remove slab destructors from kmem_cache_create().Paul Mundt2007-07-201-1/+1
|/ | | | | | | | | | | | | | Slab destructors were no longer supported after Christoph's c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been BUGs for both slab and slub, and slob never supported them either. This rips out support for the dtor pointer from kmem_cache_create() completely and fixes up every single callsite in the kernel (there were about 224, not including the slab allocator definitions themselves, or the documentation references). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* bsg: fix missing space in version printJens Axboe2007-07-171-1/+1
| | | | | | | Tomo introduced a bug in his commit, removing the space between "driver" and "version" in the init printk. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: minor cleanupFUJITA Tomonori2007-07-171-3/+5
| | | | | | | | - fix MODULE_DESCRIPTION typo. - unify MODULE_DESCRIPTION and bsg_version. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: device hash table cleanupFUJITA Tomonori2007-07-171-8/+4
| | | | | | | | - kill unused bsg_list_idx macro. - add bsg_dev_idx_hash() that returns an appropriate hlist_head. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: fix initialization error handling bugsFUJITA Tomonori2007-07-171-20/+18
| | | | | | | | | | This fixes the following bugs and cleans up the initialization code: - cdev_del is missing. - unregister_chrdev_region should be used instead of unregister_chrdev. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: convert to dynamic majorJens Axboe2007-07-171-13/+12
| | | | | | | 240 was hardcoded, that was clearly a dumb mistake. Convert bsg to use alloc_chrdev_region() to retrieve a dynamic major. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: address various review commentsJens Axboe2007-07-171-58/+44
| | | | | | | This address most of the comments made by Andrew. The two remaining are conversion to idr, and dynamic major. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Fix new generic block device SG compileLinus Torvalds2007-07-161-1/+1
| | | | | | | | | | | We had a merge issue with the "dentry" field going away from the kobject, and being replaced by a sysfs_dirent field (named "sd") instead. That broke the BSG compile. Cc: Jens Axboe <jens.axboe@oracle.com> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* bsg: add SCSI transport-level request supportFUJITA Tomonori2007-07-161-6/+21
| | | | | | | | | | | This enables bsg to handle SCSI transport-level request like SAS management protocol (SMP). - add BSG_SUB_PROTOCOL_{SCSI_CMD, SCSI_TMF, SCSI_TRANSPORT} definitions. - SCSI transport-level requests skip blk_verify_command(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: add bidi supportFUJITA Tomonori2007-07-161-25/+49
| | | | | | | bsg uses the rq->next_rq pointer for a bidi request. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: fix the deadlock on discarding done commandsFUJITA Tomonori2007-07-161-0/+1
| | | | | | | | The previous commit introduced a deadlock in discarding commands, because we forget to unlock the bd spinlock. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: fix a blocking read bugFUJITA Tomonori2007-07-161-61/+23
| | | | | | | | | | This patch fixes a bug that read() returns ENODATA even with a blocking file descriptor when there are no commands pending. This also includes some cleanups. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: minor bug fixesFUJITA Tomonori2007-07-161-1/+3
| | | | | | | | | | | | This fixes the following minor issues: - add EXPORT_SYMBOL_GPL for bsg_register_queue and bsg_unregister_queue. - shut up gcc warnings Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <axboe@nelson.home.kernel.dk>
* improve bsg device allocationFUJITA Tomonori2007-07-161-8/+41
| | | | | | | | | | | | | | | | | | This patch addresses on two issues on bsg device allocation. - the current maxium number of bsg devices is 256. It's too small if we allocate bsg devices to all SCSI devices, transport entities, etc. This increses the maxium number to 32768 (taken from the sg driver). - SCSI devices are dynamically added and removed. Currently, bsg can't handle it well since bsd_device->minor is simply increased. This is dependent on the patchset that I posted yesterday: http://marc.info/?l=linux-scsi&m=117440208726755&w=2 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bind bsg to all SCSI devicesFUJITA Tomonori2007-07-161-7/+52
| | | | | | | | | | | | | This patch binds bsg to all SCSI devices (their request queues) like the current sg driver does. We can send SCSI commands to non disk and cdrom scsi devices like OSD via bsg. This patch removes bsg_register_queue from blk_register_queue so bsg devices aren't bound to non SCSI block devices. If they want bsg, I'll send a patch to do that. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: bind bsg to request_queue instead of gendiskFUJITA Tomonori2007-07-161-20/+17
| | | | | | | | | This patch binds bsg devices to request_queue instead of gendisk. Any objects (like transport entities) can define own request_handler and create own bsg device. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: add a request_queue argument to scsi_cmd_ioctl()FUJITA Tomonori2007-07-161-1/+1
| | | | | | | | | | | | bsg uses scsi_cmd_ioctl() for some SCSI/sg ioctl commands. scsi_cmd_ioctl() gets a request queue from a gendisk arguement. This prevents bsg being bound to SCSI devices that don't have a gendisk (like OSD). This adds a request_queue argument to scsi_cmd_ioctl(). The SCSI/sg ioctl commands doesn't use a gendisk so it's safe for any SCSI devices to use scsi_cmd_ioctl(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: simplify __bsg_alloc_command failpathFUJITA Tomonori2007-07-161-3/+2
| | | | | Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: add cheasy error checks for sysfs stuffJens Axboe2007-07-161-1/+10
| | | | Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Add queue resizing supportJens Axboe2007-07-161-64/+32
| | | | | | | | | | Just get rid of the preallocated command map, use the slab cache to get/free commands instead. Original patch from FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>, changed by me to not use a mempool. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: silence a bogus gcc warningJens Axboe2007-07-161-1/+1
| | | | Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: style cleanupJens Axboe2007-07-161-2/+2
| | | | Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: add SG_IO to SG v4FUJITA Tomonori2007-07-161-2/+21
| | | | | | | This adds SG_IO support to SG v4. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: replace SG v3 with SG v4FUJITA Tomonori2007-07-161-77/+121
| | | | | | | This patch replaces SG v3 in bsg with SG v4 (except for SG_IO). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: minor cleanupsFUJITA Tomonori2007-07-161-7/+6
| | | | | | | This just kills linux/config.h and dprintk warnings. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* bsg: support for full generic block layer SG v3Jens Axboe2007-07-161-0/+997
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
OpenPOWER on IntegriCloud