linux/drivers/ide
Borislav Petkov 9d01e4cd7e ide-tape: fix proc warning
ide_tape_chrdev_get() was missing an ide_device_get() refcount increment
which lead to the following warning:

[  278.147906] ------------[ cut here ]------------
[  278.152685] WARNING: at fs/proc/generic.c:847 remove_proc_entry+0x199/0x1b8()
[  278.160070] Hardware name: P4I45PE    1.00
[  278.160076] remove_proc_entry: removing non-empty directory 'ide0/hdb', leaking at least 'name'
[  278.160080] Modules linked in: rtc intel_agp pcspkr thermal processor thermal_sys parport_pc parport agpgart button
[  278.160100] Pid: 2312, comm: mt Not tainted 2.6.30-rc2 #3
[  278.160105] Call Trace:
[  278.160117]  [<c012141d>] warn_slowpath+0x71/0xa0
[  278.160126]  [<c035f219>] ? _spin_unlock_irqrestore+0x29/0x2c
[  278.160132]  [<c011c686>] ? try_to_wake_up+0x1b6/0x1c0
[  278.160141]  [<c011c69b>] ? default_wake_function+0xb/0xd
[  278.160149]  [<c0177ead>] ? pollwake+0x4a/0x55
[  278.160156]  [<c035f240>] ? _spin_unlock+0x24/0x26
[  278.160163]  [<c0165d38>] ? add_partial+0x44/0x49
[  278.160169]  [<c01669e8>] ? __slab_free+0xba/0x29c
[  278.160177]  [<c01a13d8>] ? sysfs_delete_inode+0x0/0x3c
[  278.160184]  [<c019ca92>] remove_proc_entry+0x199/0x1b8
[  278.160191]  [<c01a297e>] ? remove_dir+0x27/0x2e
[  278.160199]  [<c025f3ab>] ide_proc_unregister_device+0x40/0x4c
[  278.160207]  [<c02599cd>] drive_release_dev+0x14/0x47
[  278.160214]  [<c0250538>] device_release+0x35/0x5a
[  278.160221]  [<c01f8bed>] kobject_release+0x40/0x50
[  278.160226]  [<c01f8bad>] ? kobject_release+0x0/0x50
[  278.160232]  [<c01f96ac>] kref_put+0x3c/0x4a
[  278.160238]  [<c01f8b29>] kobject_put+0x37/0x3c
[  278.160243]  [<c025020c>] put_device+0xf/0x11
[  278.160249]  [<c025789f>] ide_device_put+0x2d/0x30
[  278.160255]  [<c02658da>] ide_tape_put+0x24/0x32
[  278.160261]  [<c0266e0c>] idetape_chrdev_release+0x17f/0x18e
[  278.160269]  [<c016c4f5>] __fput+0xca/0x175
[  278.160275]  [<c016c5b9>] fput+0x19/0x1b
[  278.160280]  [<c0169d19>] filp_close+0x51/0x5b
[  278.160286]  [<c0169d96>] sys_close+0x73/0xad
[  278.160293]  [<c0102a61>] syscall_call+0x7/0xb
[  278.160298] ---[ end trace f16d907ea1f89336 ]---

Instead of trivially fixing it by adding the missing call,
ide_tape_chrdev_get() and ide_tape_get() were merged into one function
since both were almost identical. The only difference was that
ide_tape_chrdev_get() was accessing the ide-tape reference through the
idetape_devs[] array of minors instead of through the gendisk.

Accomodate that by adding two additional parameters to ide_tape_get() to
annotate the call site and invoke the proper behavior.

As a result, remove ide_tape_chrdev_get().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-06-08 22:03:03 +02:00
..
aec62xx.c ide: fix ->init_chipset method to return 'int' value 2009-03-24 23:22:53 +01:00
ali14xx.c ide: remove useless subdirs from drivers/ide/ 2008-10-21 20:57:23 +02:00
alim15x3.c alim15x3: Remove historical hacks, re-enable init_hwif for PowerPC 2009-04-30 18:38:01 +02:00
amd74xx.c ide: fix ->init_chipset method to return 'int' value 2009-03-24 23:22:53 +01:00
at91_ide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
atiixp.c ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS 2009-03-24 23:22:52 +01:00
au1xxx-ide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
buddha.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
cmd64x.c ide: set/clear drive->waiting_for_dma flag in the core code 2009-03-31 20:15:22 +02:00
cmd640.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
cs5520.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
cs5530.c ide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3) 2009-03-31 20:15:27 +02:00
cs5535.c ide: remove useless subdirs from drivers/ide/ 2008-10-21 20:57:23 +02:00
cs5536.c cs5536: define dma_sff_read_status() method 2009-04-18 17:42:20 +02:00
cy82c693.c ide: remove HWIF() macro 2009-01-06 17:20:52 +01:00
delkin_cb.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
dtc2278.c ide: add IDE_HFLAG_DTC2278 host flag 2009-03-27 12:46:28 +01:00
falconide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
gayle.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
hpt366.c ide: add IDE_DFLAG_NIEN_QUIRK device flag 2009-06-07 15:37:10 +02:00
ht6560b.c ide: turn selectproc() method into dev_select() method (take 5) 2009-03-31 20:15:32 +02:00
icside.c icside: remove superfluous ->maskproc method 2009-06-07 15:37:06 +02:00
ide-4drives.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-acpi.c ide: simplify 'struct ide_taskfile' 2009-04-08 14:13:02 +02:00
ide-atapi.c ide-tape: change IDE_AFLAG_IGNORE_DSC non-atomically 2009-06-07 15:37:05 +02:00
ide-cd.c Merge branch 'for-linus' into for-next 2009-04-30 18:28:35 +02:00
ide-cd.h ide-cd: convert to using generic sense request 2009-04-19 07:00:42 +09:00
ide-cd_ioctl.c ide: remove IDE_AFLAG_NO_DOORLOCKING 2008-10-17 18:09:11 +02:00
ide-cd_verbose.c block: replace sizeof(rq->cmd) with BLK_MAX_CDB 2008-04-29 14:48:55 +02:00
ide-cs.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-devsets.c ide: remove ide_end_request() 2009-03-27 12:46:45 +01:00
ide-disk.c Merge branch 'for-linus' into for-next 2009-06-07 14:27:11 +02:00
ide-disk.h [PATCH] switch ide_disk_ops ->ioctl() to sane prototype 2008-10-21 07:47:30 -04:00
ide-disk_ioctl.c [PATCH] switch ide_disk_ops ->ioctl() to sane prototype 2008-10-21 07:47:30 -04:00
ide-disk_proc.c ide: replace IDE_TFLAG_* flags by IDE_VALID_* 2009-04-08 14:13:01 +02:00
ide-dma-sff.c ide: remove wmb() from ide-dma-sff.c and scc_pata.c 2009-04-08 14:12:49 +02:00
ide-dma.c ide-dma: don't reset request fields on dma_timeout_retry() 2009-04-21 12:16:56 +09:00
ide-eh.c ide: add IDE_DFLAG_NIEN_QUIRK device flag 2009-06-07 15:37:10 +02:00
ide-floppy.c ide-atapi,tape,floppy: allow ->pc_callback() to change rq->data_len 2009-04-19 08:46:02 +09:00
ide-floppy.h [PATCH] switch ide_disk_ops ->ioctl() to sane prototype 2008-10-21 07:47:30 -04:00
ide-floppy_ioctl.c ide: decrease size of ->pc_buf field in struct ide_atapi_pc 2009-03-31 20:15:25 +02:00
ide-floppy_proc.c ide: NULL noise: drivers/ide/ide-*.c 2009-03-05 16:10:56 +01:00
ide-gd.c ide-gd: implement block device ->set_capacity method (v2) 2009-06-07 13:52:52 +02:00
ide-gd.h ide: move ->failed_pc to ide_drive_t 2009-03-27 12:46:34 +01:00
ide-generic.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-h8300.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-io-std.c ide: refactor tf_read() method 2009-04-08 14:13:03 +02:00
ide-io.c ide: add IDE_DFLAG_NIEN_QUIRK device flag 2009-06-07 15:37:10 +02:00
ide-ioctls.c ide: don't set REQ_SOFTBARRIER 2009-04-19 07:00:41 +09:00
ide-iops.c ide: add IDE_DFLAG_NIEN_QUIRK device flag 2009-06-07 15:37:10 +02:00
ide-legacy.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-lib.c ide: improve failed opcode reporting 2009-05-22 16:23:38 +02:00
ide-park.c ide: use blk_run_queue() instead of blk_start_queueing() 2009-04-19 07:00:41 +09:00
ide-pci-generic.c ide_pci_generic: add quirk for Netcell ATA RAID 2009-05-30 20:06:54 +02:00
ide-pio-blacklist.c ide: move PIO blacklist to ide-pio-blacklist.c 2008-07-16 20:33:39 +02:00
ide-pm.c ide-pm: don't abuse rq->data 2009-04-19 07:00:43 +09:00
ide-pnp.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
ide-probe.c ide: respect quirk_drives[] list on all controllers 2009-06-07 15:37:09 +02:00
ide-proc.c ide: replace IDE_TFLAG_* flags by IDE_VALID_* 2009-04-08 14:13:01 +02:00
ide-scan-pci.c ide: replace remaining __FUNCTION__ occurrences 2008-04-26 22:25:20 +02:00
ide-sysfs.c ide: move sysfs support to ide-sysfs.c 2009-01-02 16:12:48 +01:00
ide-tape.c ide-tape: fix proc warning 2009-06-08 22:03:03 +02:00
ide-taskfile.c ide: remove superfluous SELECT_MASK() call from do_rw_taskfile() 2009-06-07 15:37:07 +02:00
ide-timings.c ide: add support for CFA specified transfer modes (take 3) 2009-03-31 20:15:28 +02:00
ide-xfer-mode.c ide: add support for CFA specified transfer modes (take 3) 2009-03-31 20:15:28 +02:00
ide.c ide: preserve Host Protected Area by default (v2) 2009-06-07 13:52:52 +02:00
ide_platform.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
it821x.c ide: add ->dma_clear method and remove ->dma_timeout one 2009-03-31 20:15:19 +02:00
it8172.c Resurrect IT8172 IDE controller driver 2009-01-06 17:21:01 +01:00
it8213.c ide: remove HWIF() macro 2009-01-06 17:20:52 +01:00
jmicron.c ide: Switch to a common address 2008-11-02 21:40:08 +01:00
Kconfig ide: be able to build pmac driver without IDE built-in 2009-03-31 20:15:34 +02:00
macide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
Makefile ide: merge ide_arm and ide_generic host drivers 2009-03-31 20:15:24 +02:00
ns87415.c ide: refactor tf_read() method 2009-04-08 14:13:03 +02:00
opti621.c ide: remove useless subdirs from drivers/ide/ 2008-10-21 20:57:23 +02:00
palm_bk3710.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
pdc202xx_new.c ide: respect quirk_drives[] list on all controllers 2009-06-07 15:37:09 +02:00
pdc202xx_old.c ide: respect quirk_drives[] list on all controllers 2009-06-07 15:37:09 +02:00
piix.c piix: The Sony TZ90 needs the cable type hardcoding 2009-05-16 19:03:36 +02:00
pmac.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
q40ide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
qd65xx.c ide: turn selectproc() method into dev_select() method (take 5) 2009-03-31 20:15:32 +02:00
qd65xx.h Fix my email address in qd65xx.[ch]/pata_qdi.c 2009-02-03 16:53:56 -08:00
rapide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
rz1000.c rz1000: apply chipset quirks early (v2) 2008-12-29 20:27:33 +01:00
sc1200.c ide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3) 2009-03-31 20:15:27 +02:00
scc_pata.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
serverworks.c ide: fix ->init_chipset method to return 'int' value 2009-03-24 23:22:53 +01:00
setup-pci.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
sgiioc4.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
siimage.c ide: replace special_t typedef by IDE_SFLAG_* flags 2009-05-17 19:12:21 +02:00
sis5513.c ide: fix ->init_chipset method to return 'int' value 2009-03-24 23:22:53 +01:00
sl82c105.c ide: add support for CFA specified transfer modes (take 3) 2009-03-31 20:15:28 +02:00
slc90e66.c ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS 2009-03-24 23:22:52 +01:00
tc86c001.c ide: add ->dma_clear method and remove ->dma_timeout one 2009-03-31 20:15:19 +02:00
triflex.c ide: remove HWIF() macro 2009-01-06 17:20:52 +01:00
trm290.c ide: turn selectproc() method into dev_select() method (take 5) 2009-03-31 20:15:32 +02:00
tx4938ide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
tx4939ide.c ide: remove hw_regs_t typedef 2009-05-17 19:12:25 +02:00
umc8672.c ide: merge ide_hwgroup_t with ide_hwif_t (v2) 2009-01-06 17:20:50 +01:00
via82cxxx.c via82cxxx: Add VIA VX855 PCI Device ID 2009-05-22 16:23:39 +02:00