Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=def5b5b26e6d97820465fadcb7d1cb73cc4daf33
Commit:     def5b5b26e6d97820465fadcb7d1cb73cc4daf33
Parent:     094262db9e4c615e0db7a7b924d244b7a6c186b0
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 22:38:52 2007 +0100
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Sat Oct 20 02:01:08 2007 +0100

    kcopyd use mutex instead of semaphore
    
    Kcopyd uses a semaphore as mutex.  Use the mutex API instead of the (binary)
    semaphore,
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Cc: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
 drivers/md/kcopyd.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 7e05237..f3831f3 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -198,7 +198,7 @@ struct kcopyd_job {
         * These fields are only used if the job has been split
         * into more manageable parts.
         */
-       struct semaphore lock;
+       struct mutex lock;
        atomic_t sub_jobs;
        sector_t progress;
 };
@@ -456,7 +456,7 @@ static void segment_complete(int read_err,
        sector_t count = 0;
        struct kcopyd_job *job = (struct kcopyd_job *) context;
 
-       down(&job->lock);
+       mutex_lock(&job->lock);
 
        /* update the error */
        if (read_err)
@@ -480,7 +480,7 @@ static void segment_complete(int read_err,
                        job->progress += count;
                }
        }
-       up(&job->lock);
+       mutex_unlock(&job->lock);
 
        if (count) {
                int i;
@@ -562,7 +562,7 @@ int kcopyd_copy(struct kcopyd_client *kc, struct io_region 
*from,
                dispatch_job(job);
 
        else {
-               init_MUTEX(&job->lock);
+               mutex_init(&job->lock);
                job->progress = 0;
                split_job(job);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to