]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove dead code about LKF_CONVERT flag
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 7 Mar 2016 09:31:03 +0000 (17:31 +0800)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 7 Mar 2016 20:21:04 +0000 (15:21 -0500)
Since flags is only set as LKF_NOQUEUE, the code
with LKF_CONVERT flag should be delete.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
mdadm.h
util.c

diff --git a/mdadm.h b/mdadm.h
index 355c455630f095e2bc902f87314758de334a8a23..97aac5294839306a1b851e794e968cf46c02f5b6 100755 (executable)
--- a/mdadm.h
+++ b/mdadm.h
@@ -64,7 +64,6 @@ typedef uint64_t cmap_handle_t;
 #include       <errno.h>
 #else
 #define LKF_NOQUEUE    0x00000001
-#define LKF_CONVERT    0x00000004
 #define LKM_PWMODE     4
 #define EUNLOCK                0x10002
 
diff --git a/util.c b/util.c
index 96a806d4ee236d26d3a85908a768a5c186fdd885..09c2f6f90e2d36cf709e6b406ec2c56349d70a02 100644 (file)
--- a/util.c
+++ b/util.c
@@ -147,13 +147,7 @@ int cluster_get_dlmlock(int *lockid)
                return -ENOMEM;
        }
 
-       /* Conversions need the lockid in the LKSB */
-       if (flags & LKF_CONVERT)
-               dlm_lock_res->lksb.sb_lkid = *lockid;
-
        snprintf(str, 64, "bitmap%s", cluster_name);
-       /* if flags with LKF_CONVERT causes below return ENOENT which means
-        * "No such file or directory" */
        ret = dlm_hooks->ls_lock(dlm_lock_res->ls, LKM_PWMODE, &dlm_lock_res->lksb,
                          flags, str, strlen(str), 0, dlm_ast,
                          dlm_lock_res, NULL, NULL);
@@ -177,8 +171,6 @@ int cluster_release_dlmlock(int lockid)
        if (!cluster_name)
                return -1;
 
-       /* if flags with LKF_CONVERT causes below return EINVAL which means
-        * "Invalid argument" */
        ret = dlm_hooks->ls_unlock(dlm_lock_res->ls, lockid, 0,
                                     &dlm_lock_res->lksb, dlm_lock_res);
        if (ret) {