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

Commit 369a6fec authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging: lustre: obdclass: hoist locking in lu_context_exit()



Hoist lu_keys_guard locking out of the for loop in lu_context_exit().

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8918
Reviewed-on: https://review.whamcloud.com/24217


Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@gmail.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5394d48
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1721,10 +1721,11 @@ void lu_context_exit(struct lu_context *ctx)
	LINVRNT(ctx->lc_state == LCS_ENTERED);
	ctx->lc_state = LCS_LEFT;
	if (ctx->lc_tags & LCT_HAS_EXIT && ctx->lc_value) {
		for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) {
		/* could race with key quiescency */
		if (ctx->lc_tags & LCT_REMEMBER)
			read_lock(&lu_keys_guard);

		for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) {
			if (ctx->lc_value[i]) {
				struct lu_context_key *key;

@@ -1733,11 +1734,12 @@ void lu_context_exit(struct lu_context *ctx)
					key->lct_exit(ctx,
						      key, ctx->lc_value[i]);
			}
		}

		if (ctx->lc_tags & LCT_REMEMBER)
			read_unlock(&lu_keys_guard);
	}
}
}
EXPORT_SYMBOL(lu_context_exit);

/**