Whamcloud - gitweb
- for non-split lmv_placement_policy() should spread inodes over all MDSes smoothly...
authoryury <yury>
Tue, 17 Oct 2006 16:29:43 +0000 (16:29 +0000)
committeryury <yury>
Tue, 17 Oct 2006 16:29:43 +0000 (16:29 +0000)
lustre/lmv/lmv_obd.c
lustre/mdt/mdt_recovery.c

index d50891b..b5fbc8c 100644 (file)
@@ -763,16 +763,24 @@ static int lmv_placement_policy(struct obd_device *obd,
                                *mds, hint->ph_cname->name);
                 } else {
                         if (hint->ph_cname && (hint->ph_opc == LUSTRE_OPC_MKDIR)) {
-                                /* Default policy for directories. */
+                                /* 
+                                 * Default policy for directories is to use
+                                 * lmv_all_chars_policy() hash function, which
+                                 * allows to distribute objects by MDSes quite
+                                 * smoothly.
+                                 */
                                 *mds = lmv_all_chars_policy(lmv->desc.ld_tgt_count,
                                                             hint->ph_cname);
                                 rc = 0;
                         } else {
                                 /*
-                                 * Default policy for others is to use parent
-                                 * MDS.
+                                 * Default policy for others is the same as for
+                                 * dirs currently. May be later we will want to
+                                 * change it. 
                                  */
-                                rc = lmv_fld_lookup(lmv, hint->ph_pfid, mds);
+                                *mds = lmv_all_chars_policy(lmv->desc.ld_tgt_count,
+                                                            hint->ph_cname);
+                                rc = 0;
                         }
                 }
         } else {
index c126c0a..43fc07d 100644 (file)
@@ -943,7 +943,7 @@ int mdt_fs_setup(const struct lu_env *env, struct mdt_device *mdt,
         dt_txn_callback_add(mdt->mdt_bottom, &mdt->mdt_txn_cb);
 
         o = dt_store_open(env, mdt->mdt_bottom, LAST_RCVD, &fid);
-        if(!IS_ERR(o)) {
+        if (!IS_ERR(o)) {
                 mdt->mdt_last_rcvd = o;
                 rc = mdt_server_data_init(env, mdt);
                 if (rc) {
@@ -959,7 +959,7 @@ int mdt_fs_setup(const struct lu_env *env, struct mdt_device *mdt,
                 RETURN(rc);
 
         o = dt_store_open(env, mdt->mdt_bottom, CAPA_KEYS, &fid);
-        if(!IS_ERR(o)) {
+        if (!IS_ERR(o)) {
                 mdt->mdt_ck_obj = o;
                 rc = mdt_capa_keys_init(env, mdt);
                 if (rc) {