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

Commit 2b637d7f authored by Hongchao Zhang's avatar Hongchao Zhang Committed by Greg Kroah-Hartman
Browse files

staging/lustre/ldlm: engage ELC for all ldlm enqueue req



If there is no request passed into ldlm_cli_enqueue, the enqueue
request will not engage ELC to drop unneeded locks. currently,
this kind of request is mainly related to EXTENT locks enqueue
requests (except for glimpse EXTENT lock for it has an intent).

Signed-off-by: default avatarHongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/21739
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8209


Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarVitaly Fertman <vitaly.fertman@seagate.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9f4cf1a
Loading
Loading
Loading
Loading
+4 −17
Original line number Original line Diff line number Diff line
@@ -748,17 +748,14 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
	lock->l_last_activity = ktime_get_real_seconds();
	lock->l_last_activity = ktime_get_real_seconds();


	/* lock not sent to server yet */
	/* lock not sent to server yet */

	if (!reqp || !*reqp) {
	if (!reqp || !*reqp) {
		req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
		req = ldlm_enqueue_pack(exp, lvb_len);
						&RQF_LDLM_ENQUEUE,
		if (IS_ERR(req)) {
						LUSTRE_DLM_VERSION,
						LDLM_ENQUEUE);
		if (!req) {
			failed_lock_cleanup(ns, lock, einfo->ei_mode);
			failed_lock_cleanup(ns, lock, einfo->ei_mode);
			LDLM_LOCK_RELEASE(lock);
			LDLM_LOCK_RELEASE(lock);
			return -ENOMEM;
			return PTR_ERR(req);
		}
		}

		req_passed_in = 0;
		req_passed_in = 0;
		if (reqp)
		if (reqp)
			*reqp = req;
			*reqp = req;
@@ -778,16 +775,6 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
	body->lock_flags = ldlm_flags_to_wire(*flags);
	body->lock_flags = ldlm_flags_to_wire(*flags);
	body->lock_handle[0] = *lockh;
	body->lock_handle[0] = *lockh;


	/* Continue as normal. */
	if (!req_passed_in) {
		if (lvb_len > 0)
			req_capsule_extend(&req->rq_pill,
					   &RQF_LDLM_ENQUEUE_LVB);
		req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
				     lvb_len);
		ptlrpc_request_set_replen(req);
	}

	/*
	/*
	 * Liblustre client doesn't get extent locks, except for O_APPEND case
	 * Liblustre client doesn't get extent locks, except for O_APPEND case
	 * where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where
	 * where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where