Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123506
b: refs/heads/master
c: 1f473e9
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Dec 29, 2008
1 parent b9b0183 commit 7dcc7d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e0e29f7373ec96a1bd972790649524af7353f42
refs/heads/master: 1f473e9c92ea458e60494561a2065a358b7239bb
3 changes: 0 additions & 3 deletions trunk/drivers/ide/ide-ioctls.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev,
const struct ide_ioctl_devset *s)
{
const struct ide_devset *ds;
unsigned long flags;
int err = -EOPNOTSUPP;

for (; (ds = s->setting); s++) {
Expand All @@ -33,9 +32,7 @@ int ide_setting_ioctl(ide_drive_t *drive, struct block_device *bdev,

read_val:
mutex_lock(&ide_setting_mtx);
spin_lock_irqsave(&ide_lock, flags);
err = ds->get(drive);
spin_unlock_irqrestore(&ide_lock, flags);
mutex_unlock(&ide_setting_mtx);
return err >= 0 ? put_user(err, (long __user *)arg) : err;

Expand Down
25 changes: 4 additions & 21 deletions trunk/drivers/ide/ide-proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,8 @@ static int ide_read_setting(ide_drive_t *drive,
const struct ide_devset *ds = setting->setting;
int val = -EINVAL;

if (ds->get) {
unsigned long flags;

spin_lock_irqsave(&ide_lock, flags);
if (ds->get)
val = ds->get(drive);
spin_unlock_irqrestore(&ide_lock, flags);
}

return val;
}
Expand Down Expand Up @@ -583,31 +578,19 @@ EXPORT_SYMBOL(ide_proc_register_driver);
* Clean up the driver specific /proc files and IDE settings
* for a given drive.
*
* Takes ide_setting_mtx and ide_lock.
* Caller must hold none of the locks.
* Takes ide_setting_mtx.
*/

void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver)
{
unsigned long flags;

ide_remove_proc_entries(drive->proc, driver->proc_entries(drive));

mutex_lock(&ide_setting_mtx);
spin_lock_irqsave(&ide_lock, flags);
/*
* ide_setting_mtx protects the settings list
* ide_lock protects the use of settings
*
* so we need to hold both, ide_settings_sem because we want to
* modify the settings list, and ide_lock because we cannot take
* a setting out that is being used.
*
* OTOH both ide_{read,write}_setting are only ever used under
* ide_setting_mtx.
* ide_setting_mtx protects both the settings list and the use
* of settings (we cannot take a setting out that is being used).
*/
drive->settings = NULL;
spin_unlock_irqrestore(&ide_lock, flags);
mutex_unlock(&ide_setting_mtx);
}
EXPORT_SYMBOL(ide_proc_unregister_driver);
Expand Down

0 comments on commit 7dcc7d3

Please sign in to comment.