From cf8b8975c3c35d1269bf6f1c6f2ae4efb6909607 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 23 Mar 2006 03:00:45 -0800 Subject: [PATCH] sem2mutex: drivers/ide 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 Signed-off-by: Ingo Molnar Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ide/ide-disk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/ide/ide-disk.c') diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 09086b8b648..e238b7da824 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -60,6 +60,7 @@ #include #include #include +#include #define _IDE_DISK @@ -78,7 +79,7 @@ struct ide_disk_obj { struct kref kref; }; -static DECLARE_MUTEX(idedisk_ref_sem); +static DEFINE_MUTEX(idedisk_ref_mutex); #define to_ide_disk(obj) container_of(obj, struct ide_disk_obj, kref) @@ -89,11 +90,11 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) { struct ide_disk_obj *idkp = NULL; - down(&idedisk_ref_sem); + mutex_lock(&idedisk_ref_mutex); idkp = ide_disk_g(disk); if (idkp) kref_get(&idkp->kref); - up(&idedisk_ref_sem); + mutex_unlock(&idedisk_ref_mutex); return idkp; } @@ -101,9 +102,9 @@ static void ide_disk_release(struct kref *); static void ide_disk_put(struct ide_disk_obj *idkp) { - down(&idedisk_ref_sem); + mutex_lock(&idedisk_ref_mutex); kref_put(&idkp->kref, ide_disk_release); - up(&idedisk_ref_sem); + mutex_unlock(&idedisk_ref_mutex); } /* -- cgit v1.2.2