Skip to contentSkip to conversation

dlm: avoid unnecessary search in search_rsb

PATCH New David Teigland 1 participant 1 message May 21, 2012 Distributed lock manager (DLM)

lore
Share & tools
lore

David Teigland

author maintainer
#0 lore raw

PATCH 4/8 dlm: avoid unnecessary search in search_rsb

If the rsb is found in the "keep" tree, but is not the right type (i.e. not MASTER), we can return immediately with the result. There's no point in going on to search the "toss" list as if we hadn't found it.

---
 fs/dlm/lock.c |    3 +++
 1 file changed, 3 insertions(+)
fs/dlm/lock.c +3 -0
index 3d35c59..49926f1 100644
@@ -479,6 +479,9 @@ static int _search_rsb(struct dlm_ls *ls, char *name, int len, int b,
 		kref_get(&r->res_ref);
 		goto out;
 	}
+	if (error == -ENOTBLK)
+		goto out;
+
 	error = dlm_search_rsb_tree(&ls->ls_rsbtbl[b].toss, name, len, flags, &r);
 	if (error)
 		goto out;
Signature · 1 line
1.7.10.1.362.g242cab3