Whamcloud - gitweb
b=18468
[fs/lustre-release.git] / lustre / mdt / mdt_reint.c
index fefcf74..4de1f39 100644 (file)
@@ -80,7 +80,8 @@ static int mdt_create_pack_capa(struct mdt_thread_info *info, int rc,
         if (repbody->valid & OBD_MD_FLMDSCAPA)
                 RETURN(rc);
 
-        if (rc == 0 && info->mti_mdt->mdt_opts.mo_mds_capa) {
+        if (rc == 0 && info->mti_mdt->mdt_opts.mo_mds_capa &&
+            info->mti_exp->exp_connect_flags & OBD_CONNECT_MDS_CAPA) {
                 struct lustre_capa *capa;
 
                 capa = req_capsule_server_get(info->mti_pill, &RMF_CAPA1);
@@ -144,6 +145,7 @@ static int mdt_md_create(struct mdt_thread_info *info)
                  * or not.
                  */
                 info->mti_spec.sp_cr_lookup = 1;
+                info->mti_spec.sp_feat = &dt_directory_features;
 
                 lname = mdt_name(info->mti_env, (char *)rr->rr_name,
                                  rr->rr_namelen);
@@ -291,7 +293,6 @@ out_unlock:
 static int mdt_reint_setattr(struct mdt_thread_info *info,
                              struct mdt_lock_handle *lhc)
 {
-        struct mdt_device       *mdt = info->mti_mdt;
         struct md_attr          *ma = &info->mti_attr;
         struct mdt_reint_record *rr = &info->mti_rr;
         struct ptlrpc_request   *req = mdt_info_req(info);
@@ -387,7 +388,8 @@ static int mdt_reint_setattr(struct mdt_thread_info *info,
 
         mdt_pack_attr2body(info, repbody, &ma->ma_attr, mdt_object_fid(mo));
 
-        if (mdt->mdt_opts.mo_oss_capa &&
+        if (info->mti_mdt->mdt_opts.mo_oss_capa &&
+            info->mti_exp->exp_connect_flags & OBD_CONNECT_OSS_CAPA &&
             S_ISREG(lu_object_attr(&mo->mot_obj.mo_lu)) &&
             (ma->ma_attr.la_valid & LA_SIZE)) {
                 struct lustre_capa *capa;
@@ -470,9 +472,9 @@ static int mdt_reint_unlink(struct mdt_thread_info *info,
         if (OBD_FAIL_CHECK(OBD_FAIL_MDS_REINT_UNLINK))
                 RETURN(err_serious(-ENOENT));
 
-        /* 
+        /*
          * step 1: lock the parent. Note, this may be child in case of
-         * remote operation denoted by ->mti_cross_ref flag. 
+         * remote operation denoted by ->mti_cross_ref flag.
          */
         parent_lh = &info->mti_lh[MDT_LH_PARENT];
         if (info->mti_cross_ref) {
@@ -723,7 +725,7 @@ static int mdt_rename_lock(struct mdt_thread_info *info,
         struct ldlm_namespace *ns     = info->mti_mdt->mdt_namespace;
         ldlm_policy_data_t    *policy = &info->mti_policy;
         struct ldlm_res_id    *res_id = &info->mti_res_id;
-        struct lu_site        *ls;
+        struct md_site        *ms;
         int rc;
         ENTRY;
 
@@ -735,13 +737,13 @@ static int mdt_rename_lock(struct mdt_thread_info *info,
          * such handling in controller mds. XXX
          */
         RETURN(0);
-        ls = info->mti_mdt->mdt_md_dev.md_lu_dev.ld_site;
+        ms = mdt_md_site(info->mti_mdt);
         fid_build_reg_res_name(&LUSTRE_BFL_FID, res_id);
 
         memset(policy, 0, sizeof *policy);
         policy->l_inodebits.bits = MDS_INODELOCK_UPDATE;
 
-        if (ls->ls_control_exp == NULL) {
+        if (ms->ms_control_exp == NULL) {
                 int flags = LDLM_FL_LOCAL_ONLY | LDLM_FL_ATOMIC_CB;
 
                 /*
@@ -751,17 +753,20 @@ static int mdt_rename_lock(struct mdt_thread_info *info,
                 rc = ldlm_cli_enqueue_local(ns, res_id, LDLM_IBITS, policy,
                                             LCK_EX, &flags, ldlm_blocking_ast,
                                             ldlm_completion_ast, NULL, NULL, 0,
-                                            NULL, lh);
+                                            NULL,
+                                            &info->mti_exp->exp_handle.h_cookie,
+                                            lh);
         } else {
                 struct ldlm_enqueue_info einfo = { LDLM_IBITS, LCK_EX,
-                        ldlm_blocking_ast, ldlm_completion_ast, NULL, NULL };
+                     ldlm_blocking_ast, ldlm_completion_ast, NULL, NULL, NULL };
                 int flags = 0;
 
                 /*
                  * This is the case mdt0 is remote node, issue DLM lock like
                  * other clients.
                  */
-                rc = ldlm_cli_enqueue(ls->ls_control_exp, NULL, &einfo, res_id,
+                rc = ldlm_cli_enqueue(ms->ms_control_exp,
+                                      NULL, &einfo, res_id,
                                       policy, &flags, NULL, 0, NULL, lh, 0);
         }