X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_request.c;h=773dbd6d15c3d8427bdd32e43223a58ac2903fd0;hb=841fbac6378df39e357342d86d9380e6676c1faf;hp=66d94e1cf807b6d5c84bc235c7ffc7a967fa9bfe;hpb=93b4e956bbbf9795af6649416731af370d358baa;p=fs%2Flustre-release.git diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 66d94e1..773dbd6 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1823,11 +1823,16 @@ int ldlm_namespace_foreach_res(struct ldlm_namespace *ns, RETURN(rc); } -/* non-blocking function to manipulate a lock whose cb_data is being put away.*/ -void ldlm_resource_iterate(struct ldlm_namespace *ns, struct ldlm_res_id *res_id, +/* non-blocking function to manipulate a lock whose cb_data is being put away. + * return 0: find no resource + * > 0: must be LDLM_ITER_STOP/LDLM_ITER_CONTINUE. + * < 0: errors + */ +int ldlm_resource_iterate(struct ldlm_namespace *ns, struct ldlm_res_id *res_id, ldlm_iterator_t iter, void *data) { struct ldlm_resource *res; + int rc; ENTRY; if (ns == NULL) { @@ -1836,14 +1841,12 @@ void ldlm_resource_iterate(struct ldlm_namespace *ns, struct ldlm_res_id *res_id } res = ldlm_resource_get(ns, NULL, *res_id, 0, 0); - if (res == NULL) { - EXIT; - return; - } + if (res == NULL) + RETURN(0); - ldlm_resource_foreach(res, iter, data); + rc = ldlm_resource_foreach(res, iter, data); ldlm_resource_putref(res); - EXIT; + RETURN(rc); } /* Lock replay */