- rc = mdc_intent_lock(llu_i2mdexp(parent), &pid,
- pnode->p_base->pb_name.name,
- pnode->p_base->pb_name.len,
- NULL, 0, NULL, it, flags, &req,
- llu_mdc_blocking_ast);
+ if (it->it_op & IT_CREAT ||
+ (it->it_op & IT_OPEN && it->it_create_mode & O_CREAT)) {
+ opc = LUSTRE_OPC_CREATE;
+ } else {
+ opc = LUSTRE_OPC_ANY;
+ }
+
+ llu_prep_md_op_data(&op_data, parent, NULL,
+ pnode->p_base->pb_name.name,
+ pnode->p_base->pb_name.len, flags, opc);
+
+ rc = md_intent_lock(llu_i2mdexp(parent), &op_data, NULL, 0, it,
+ flags, &req, llu_md_blocking_ast,
+ LDLM_FL_CANCEL_ON_BLOCK);