aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lockspace.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-01-20 03:47:07 -0500
committerSteven Whitehouse <steve@chygwyn.com>2006-01-20 03:47:07 -0500
commit901359256b2666f52a3a7d3f31927677e91b3a2a (patch)
tree24d4ee2c1ad63a0e6c3a303ad67eac3342772c4f /fs/dlm/lockspace.c
parentec5800246607183a1d7fd0bae5f087c12439e9e7 (diff)
[DLM] Update DLM to the latest patch level
Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steve Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r--fs/dlm/lockspace.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index fee4659b6582..d2ff505d51cd 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -31,7 +31,7 @@ static inline void dlm_delete_debug_file(struct dlm_ls *ls) { }
31#endif 31#endif
32 32
33static int ls_count; 33static int ls_count;
34static struct semaphore ls_lock; 34static struct mutex ls_lock;
35static struct list_head lslist; 35static struct list_head lslist;
36static spinlock_t lslist_lock; 36static spinlock_t lslist_lock;
37static struct task_struct * scand_task; 37static struct task_struct * scand_task;
@@ -177,7 +177,7 @@ int dlm_lockspace_init(void)
177 int error; 177 int error;
178 178
179 ls_count = 0; 179 ls_count = 0;
180 init_MUTEX(&ls_lock); 180 mutex_init(&ls_lock);
181 INIT_LIST_HEAD(&lslist); 181 INIT_LIST_HEAD(&lslist);
182 spin_lock_init(&lslist_lock); 182 spin_lock_init(&lslist_lock);
183 183
@@ -351,10 +351,9 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
351 return -EEXIST; 351 return -EEXIST;
352 } 352 }
353 353
354 ls = kmalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL); 354 ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_KERNEL);
355 if (!ls) 355 if (!ls)
356 goto out; 356 goto out;
357 memset(ls, 0, sizeof(struct dlm_ls) + namelen);
358 memcpy(ls->ls_name, name, namelen); 357 memcpy(ls->ls_name, name, namelen);
359 ls->ls_namelen = namelen; 358 ls->ls_namelen = namelen;
360 ls->ls_exflags = flags; 359 ls->ls_exflags = flags;
@@ -398,7 +397,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
398 } 397 }
399 398
400 INIT_LIST_HEAD(&ls->ls_waiters); 399 INIT_LIST_HEAD(&ls->ls_waiters);
401 init_MUTEX(&ls->ls_waiters_sem); 400 mutex_init(&ls->ls_waiters_mutex);
402 401
403 INIT_LIST_HEAD(&ls->ls_nodes); 402 INIT_LIST_HEAD(&ls->ls_nodes);
404 INIT_LIST_HEAD(&ls->ls_nodes_gone); 403 INIT_LIST_HEAD(&ls->ls_nodes_gone);
@@ -416,14 +415,14 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
416 ls->ls_uevent_result = 0; 415 ls->ls_uevent_result = 0;
417 416
418 ls->ls_recoverd_task = NULL; 417 ls->ls_recoverd_task = NULL;
419 init_MUTEX(&ls->ls_recoverd_active); 418 mutex_init(&ls->ls_recoverd_active);
420 spin_lock_init(&ls->ls_recover_lock); 419 spin_lock_init(&ls->ls_recover_lock);
421 ls->ls_recover_status = 0; 420 ls->ls_recover_status = 0;
422 ls->ls_recover_seq = 0; 421 ls->ls_recover_seq = 0;
423 ls->ls_recover_args = NULL; 422 ls->ls_recover_args = NULL;
424 init_rwsem(&ls->ls_in_recovery); 423 init_rwsem(&ls->ls_in_recovery);
425 INIT_LIST_HEAD(&ls->ls_requestqueue); 424 INIT_LIST_HEAD(&ls->ls_requestqueue);
426 init_MUTEX(&ls->ls_requestqueue_lock); 425 mutex_init(&ls->ls_requestqueue_mutex);
427 426
428 ls->ls_recover_buf = kmalloc(dlm_config.buffer_size, GFP_KERNEL); 427 ls->ls_recover_buf = kmalloc(dlm_config.buffer_size, GFP_KERNEL);
429 if (!ls->ls_recover_buf) 428 if (!ls->ls_recover_buf)
@@ -493,7 +492,7 @@ int dlm_new_lockspace(char *name, int namelen, void **lockspace,
493{ 492{
494 int error = 0; 493 int error = 0;
495 494
496 down(&ls_lock); 495 mutex_lock(&ls_lock);
497 if (!ls_count) 496 if (!ls_count)
498 error = threads_start(); 497 error = threads_start();
499 if (error) 498 if (error)
@@ -503,7 +502,7 @@ int dlm_new_lockspace(char *name, int namelen, void **lockspace,
503 if (!error) 502 if (!error)
504 ls_count++; 503 ls_count++;
505 out: 504 out:
506 up(&ls_lock); 505 mutex_unlock(&ls_lock);
507 return error; 506 return error;
508} 507}
509 508
@@ -629,11 +628,11 @@ static int release_lockspace(struct dlm_ls *ls, int force)
629 kobject_unregister(&ls->ls_kobj); 628 kobject_unregister(&ls->ls_kobj);
630 kfree(ls); 629 kfree(ls);
631 630
632 down(&ls_lock); 631 mutex_lock(&ls_lock);
633 ls_count--; 632 ls_count--;
634 if (!ls_count) 633 if (!ls_count)
635 threads_stop(); 634 threads_stop();
636 up(&ls_lock); 635 mutex_unlock(&ls_lock);
637 636
638 module_put(THIS_MODULE); 637 module_put(THIS_MODULE);
639 return 0; 638 return 0;