[PATCH] sem2mutex: blockdev #2

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Acked-by: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Arjan van de Ven 2006-03-23 03:00:28 -08:00 • committed by Linus Torvalds
commit c039e3134a
7 changed files with 38 additions and 38 deletions

View file

@ -310,12 +310,12 @@ static int rd_ioctl(struct inode *inode, struct file *file,
* cache
*/
error = -EBUSY;
down(&bdev->bd_sem);
mutex_lock(&bdev->bd_mutex);
if (bdev->bd_openers <= 2) {
truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
error = 0;
}
up(&bdev->bd_sem);
mutex_unlock(&bdev->bd_mutex);
return error;
}

View file

@ -151,9 +151,9 @@ dasd_ioctl_enable(struct block_device *bdev, int no, long args)
return -ENODEV;
dasd_enable_device(device);
/* Formatting the dasd device can change the capacity. */
down(&bdev->bd_sem);
mutex_lock(&bdev->bd_mutex);
i_size_write(bdev->bd_inode, (loff_t)get_capacity(device->gdp) << 9);
up(&bdev->bd_sem);
mutex_unlock(&bdev->bd_mutex);
return 0;
}
@ -184,9 +184,9 @@ dasd_ioctl_disable(struct block_device *bdev, int no, long args)
* Set i_size to zero, since read, write, etc. check against this
* value.
*/
down(&bdev->bd_sem);
mutex_lock(&bdev->bd_mutex);
i_size_write(bdev->bd_inode, 0);
up(&bdev->bd_sem);
mutex_unlock(&bdev->bd_mutex);
return 0;
}