- if (req->rq_export && req->rq_export->exp_nid_stats &&
- req->rq_export->exp_nid_stats->nid_ldlm_stats)
- lprocfs_counter_incr(req->rq_export->exp_nid_stats->nid_ldlm_stats,
- LDLM_ENQUEUE - LDLM_FIRST_OPC);
-
- if (unlikely(dlm_req->lock_desc.l_resource.lr_type < LDLM_MIN_TYPE ||
- dlm_req->lock_desc.l_resource.lr_type >= LDLM_MAX_TYPE)) {
- DEBUG_REQ(D_ERROR, req, "invalid lock request type %d",
- dlm_req->lock_desc.l_resource.lr_type);
- GOTO(out, rc = -EFAULT);
- }
-
- if (unlikely(dlm_req->lock_desc.l_req_mode <= LCK_MINMODE ||
- dlm_req->lock_desc.l_req_mode >= LCK_MAXMODE ||
- dlm_req->lock_desc.l_req_mode &
- (dlm_req->lock_desc.l_req_mode-1))) {
- DEBUG_REQ(D_ERROR, req, "invalid lock request mode %d",
- dlm_req->lock_desc.l_req_mode);
- GOTO(out, rc = -EFAULT);
- }
-
- if (exp_connect_flags(req->rq_export) & OBD_CONNECT_IBITS) {
- if (unlikely(dlm_req->lock_desc.l_resource.lr_type ==
- LDLM_PLAIN)) {
- DEBUG_REQ(D_ERROR, req,
- "PLAIN lock request from IBITS client?");
- GOTO(out, rc = -EPROTO);
- }
- } else if (unlikely(dlm_req->lock_desc.l_resource.lr_type ==
- LDLM_IBITS)) {
- DEBUG_REQ(D_ERROR, req,
- "IBITS lock request from unaware client?");
- GOTO(out, rc = -EPROTO);
- }
-
-#if 0
- /* FIXME this makes it impossible to use LDLM_PLAIN locks -- check
- against server's _CONNECT_SUPPORTED flags? (I don't want to use
- ibits for mgc/mgs) */
-
- /* INODEBITS_INTEROP: Perform conversion from plain lock to
- * inodebits lock if client does not support them. */
- if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_IBITS) &&
- (dlm_req->lock_desc.l_resource.lr_type == LDLM_PLAIN)) {
- dlm_req->lock_desc.l_resource.lr_type = LDLM_IBITS;
- dlm_req->lock_desc.l_policy_data.l_inodebits.bits =
- MDS_INODELOCK_LOOKUP | MDS_INODELOCK_UPDATE;
- if (dlm_req->lock_desc.l_req_mode == LCK_PR)
- dlm_req->lock_desc.l_req_mode = LCK_CR;
- }
-#endif
+ if (req->rq_export && req->rq_export->exp_nid_stats &&
+ req->rq_export->exp_nid_stats->nid_ldlm_stats)
+ lprocfs_counter_incr(req->rq_export->exp_nid_stats->nid_ldlm_stats,
+ LDLM_ENQUEUE - LDLM_FIRST_OPC);
+
+ if (unlikely(dlm_req->lock_desc.l_resource.lr_type < LDLM_MIN_TYPE ||
+ dlm_req->lock_desc.l_resource.lr_type >= LDLM_MAX_TYPE)) {
+ DEBUG_REQ(D_ERROR, req, "invalid lock request type %d",
+ dlm_req->lock_desc.l_resource.lr_type);
+ GOTO(out, rc = -EFAULT);
+ }
+
+ if (unlikely(dlm_req->lock_desc.l_req_mode <= LCK_MINMODE ||
+ dlm_req->lock_desc.l_req_mode >= LCK_MAXMODE ||
+ dlm_req->lock_desc.l_req_mode &
+ (dlm_req->lock_desc.l_req_mode-1))) {
+ DEBUG_REQ(D_ERROR, req, "invalid lock request mode %d",
+ dlm_req->lock_desc.l_req_mode);
+ GOTO(out, rc = -EFAULT);
+ }