Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb830bef authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman
Browse files

staging: lustre: ldlm: minor list_entry improvements in ldlm_request.c



Small clarify improvements, and one local variable avoided.

Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7378caf4
Loading
Loading
Loading
Loading
+4 −8
Original line number Original line Diff line number Diff line
@@ -1656,7 +1656,7 @@ int ldlm_cli_cancel_list(struct list_head *cancels, int count,
	 */
	 */
	while (count > 0) {
	while (count > 0) {
		LASSERT(!list_empty(cancels));
		LASSERT(!list_empty(cancels));
		lock = list_entry(cancels->next, struct ldlm_lock, l_bl_ast);
		lock = list_first_entry(cancels, struct ldlm_lock, l_bl_ast);
		LASSERT(lock->l_conn_export);
		LASSERT(lock->l_conn_export);


		if (exp_connect_cancelset(lock->l_conn_export)) {
		if (exp_connect_cancelset(lock->l_conn_export)) {
@@ -1780,7 +1780,7 @@ EXPORT_SYMBOL(ldlm_cli_cancel_unused);
static int ldlm_resource_foreach(struct ldlm_resource *res,
static int ldlm_resource_foreach(struct ldlm_resource *res,
				 ldlm_iterator_t iter, void *closure)
				 ldlm_iterator_t iter, void *closure)
{
{
	struct list_head *tmp, *next;
	struct ldlm_lock *tmp;
	struct ldlm_lock *lock;
	struct ldlm_lock *lock;
	int rc = LDLM_ITER_CONTINUE;
	int rc = LDLM_ITER_CONTINUE;


@@ -1788,18 +1788,14 @@ static int ldlm_resource_foreach(struct ldlm_resource *res,
		return LDLM_ITER_CONTINUE;
		return LDLM_ITER_CONTINUE;


	lock_res(res);
	lock_res(res);
	list_for_each_safe(tmp, next, &res->lr_granted) {
	list_for_each_entry_safe(lock, tmp, &res->lr_granted, l_res_link) {
		lock = list_entry(tmp, struct ldlm_lock, l_res_link);

		if (iter(lock, closure) == LDLM_ITER_STOP) {
		if (iter(lock, closure) == LDLM_ITER_STOP) {
			rc = LDLM_ITER_STOP;
			rc = LDLM_ITER_STOP;
			goto out;
			goto out;
		}
		}
	}
	}


	list_for_each_safe(tmp, next, &res->lr_waiting) {
	list_for_each_entry_safe(lock, tmp, &res->lr_waiting, l_res_link) {
		lock = list_entry(tmp, struct ldlm_lock, l_res_link);

		if (iter(lock, closure) == LDLM_ITER_STOP) {
		if (iter(lock, closure) == LDLM_ITER_STOP) {
			rc = LDLM_ITER_STOP;
			rc = LDLM_ITER_STOP;
			goto out;
			goto out;