Whamcloud - gitweb
- yet smaller number of fld lookups in lmv in create paths. FLD lookups number is...
authoryury <yury>
Sun, 10 Dec 2006 10:37:31 +0000 (10:37 +0000)
committeryury <yury>
Sun, 10 Dec 2006 10:37:31 +0000 (10:37 +0000)
lustre/include/lustre/lustre_idl.h
lustre/llite/llite_lib.c
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c

index d1322ae..905de8d 100644 (file)
@@ -688,8 +688,9 @@ enum {
 };
 
 struct md_op_data {
-        struct lu_fid           op_fid1;
-        struct lu_fid           op_fid2;
+        struct lu_fid           op_fid1; /* operation fid1 (usualy parent) */
+        struct lu_fid           op_fid2; /* operation fid2 (usualy child) */
+        mdsno_t                 op_mds;  /* what mds server open will go to */
         struct lustre_handle    op_handle;
         __u64                   op_mod_time;
         const char             *op_name;
index e8ef86d..de96562 100644 (file)
@@ -2315,6 +2315,7 @@ ll_prep_md_op_data(struct md_op_data *op_data, struct inode *i1,
         op_data->op_cap = current->cap_effective;
         op_data->op_bias = MDS_CHECK_SPLIT;
         op_data->op_opc = opc;
+        op_data->op_mds = 0;
 
         return op_data;
 }
index 21fd015..150c084 100644 (file)
@@ -218,13 +218,18 @@ repeat:
 
                 rpid = obj->lo_inodes[mea_idx].li_fid;
 
-                tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
+                sop_data->op_mds = obj->lo_inodes[mea_idx].li_mds;
+                tgt_exp = lmv_get_export(lmv, sop_data->op_mds);
                 sop_data->op_bias &= ~MDS_CHECK_SPLIT;
                 lmv_obj_put(obj);
                 CDEBUG(D_OTHER, "Choose slave dir ("DFID")\n", PFID(&rpid));
         } else {
-                tgt_exp = lmv_find_export(lmv, &rpid);
+                struct lmv_tgt_desc *tgt;
+
                 sop_data->op_bias |= MDS_CHECK_SPLIT;
+                tgt = lmv_find_target(lmv, &rpid);
+                sop_data->op_mds = tgt->ltd_idx;
+                tgt_exp = tgt->ltd_exp;
         }
         if (IS_ERR(tgt_exp))
                 GOTO(out_free_sop_data, rc = PTR_ERR(tgt_exp));
index 0f13de9..7e8510f 100644 (file)
@@ -207,15 +207,14 @@ lmv_find_export(struct lmv_obd *lmv, const struct lu_fid *fid)
 {
         struct lmv_tgt_desc *tgt = lmv_find_target(lmv, fid);
         if (IS_ERR(tgt))
-                return (struct obd_export*)tgt;
-        else
-                return tgt->ltd_exp;
+                return (struct obd_export *)tgt;
+        return tgt->ltd_exp;
 }
 
 static inline void lmv_update_body(struct mdt_body *body, 
                                    struct lmv_inode *lino)
 {
-        /* update size */
+        /* update object size */
         body->size += lino->li_size;
 }
 
index e1e4e3c..2264e4c 100644 (file)
@@ -806,13 +806,21 @@ static int lmv_placement_policy(struct obd_device *obd,
                 }
 
                 /*
-                 * Allocate new fid on same mds where parent fid is located. In
-                 * case of split dir, ->op_fid1 here will contain fid of slave
-                 * directory object (assgined by caller).
+                 * Allocate new fid on same mds where parent fid is located and
+                 * where operation will be sent. In case of split dir, ->op_fid1
+                 * and ->op_mds here will contain fid and mds of slave directory
+                 * object (assigned by caller).
                  */
+                *mds = op_data->op_mds;
+                rc = 0;
+
+#if 0
+                /* XXX: This should be removed later wehn we sure it is not
+                 * needed. */
                 rc = lmv_fld_lookup(lmv, &op_data->op_fid1, mds);
                 if (rc)
                         GOTO(out, rc);
+#endif
         } else {
                 /*
                  * Parent directory is not split and we want to create a
@@ -1340,11 +1348,16 @@ repeat:
                                        op_data->op_name, op_data->op_namelen);
                 op_data->op_fid1 = obj->lo_inodes[mea_idx].li_fid;
                 op_data->op_bias &= ~MDS_CHECK_SPLIT;
-                tgt_exp = lmv_get_export(lmv, obj->lo_inodes[mea_idx].li_mds);
+                op_data->op_mds = obj->lo_inodes[mea_idx].li_mds;
+                tgt_exp = lmv_get_export(lmv, op_data->op_mds);
                 lmv_obj_put(obj);
         } else {
-                tgt_exp = lmv_find_export(lmv, &op_data->op_fid1);
+                struct lmv_tgt_desc *tgt;
+
+                tgt = lmv_find_target(lmv, &op_data->op_fid1);
                 op_data->op_bias |= MDS_CHECK_SPLIT;
+                op_data->op_mds = tgt->ltd_idx;
+                tgt_exp = tgt->ltd_exp;
         }
 
         if (IS_ERR(tgt_exp))