aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-08-30 11:50:18 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-31 12:15:37 -0400
commitc6e6f0ba8fc1dea99c7bd020916f24d533b62697 (patch)
treea27f0c7695e22fe83123448428bf77d32a5aa6ee /fs/dlm
parent623d93555c8884768db65ffc11509c93e50dd4db (diff)
[DLM] force removal of user lockspace
Check if the FORCEFREE flag has been provided from user space. If so, set the force option to dlm_release_lockspace() so that any remaining locks will be freed. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/user.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 494d00ac014e..c37e93e4f2df 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -325,7 +325,7 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
325{ 325{
326 dlm_lockspace_t *lockspace; 326 dlm_lockspace_t *lockspace;
327 struct dlm_ls *ls; 327 struct dlm_ls *ls;
328 int error; 328 int error, force = 0;
329 329
330 if (!capable(CAP_SYS_ADMIN)) 330 if (!capable(CAP_SYS_ADMIN))
331 return -EPERM; 331 return -EPERM;
@@ -341,6 +341,9 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
341 } 341 }
342 kfree(ls->ls_device.name); 342 kfree(ls->ls_device.name);
343 343
344 if (params->flags & DLM_USER_LSFLG_FORCEFREE)
345 force = 2;
346
344 lockspace = ls->ls_local_handle; 347 lockspace = ls->ls_local_handle;
345 348
346 /* dlm_release_lockspace waits for references to go to zero, 349 /* dlm_release_lockspace waits for references to go to zero,
@@ -348,8 +351,8 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
348 before the release will procede */ 351 before the release will procede */
349 352
350 dlm_put_lockspace(ls); 353 dlm_put_lockspace(ls);
351 error = dlm_release_lockspace(lockspace, 0); 354 error = dlm_release_lockspace(lockspace, force);
352out: 355 out:
353 return error; 356 return error;
354} 357}
355 358