]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[DLM] force removal of user lockspace
authorDavid Teigland <teigland@redhat.com>
Wed, 30 Aug 2006 15:50:18 +0000 (10:50 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 31 Aug 2006 16:15:37 +0000 (12:15 -0400)
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>
fs/dlm/user.c

index 494d00ac014e55ae07b1d6ebee9d54fa68fd0637..c37e93e4f2df6f8625ee31064f857469bb544290 100644 (file)
@@ -325,7 +325,7 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
 {
        dlm_lockspace_t *lockspace;
        struct dlm_ls *ls;
-       int error;
+       int error, force = 0;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
@@ -341,6 +341,9 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
        }
        kfree(ls->ls_device.name);
 
+       if (params->flags & DLM_USER_LSFLG_FORCEFREE)
+               force = 2;
+
        lockspace = ls->ls_local_handle;
 
        /* dlm_release_lockspace waits for references to go to zero,
@@ -348,8 +351,8 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
           before the release will procede */
 
        dlm_put_lockspace(ls);
-       error = dlm_release_lockspace(lockspace, 0);
-out:
+       error = dlm_release_lockspace(lockspace, force);
+ out:
        return error;
 }