From e6bd3e6b87f60ea37f341f74b94f4e66cd9dd264 Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 17 Oct 2006 16:29:43 +0000 Subject: [PATCH] - for non-split lmv_placement_policy() should spread inodes over all MDSes smoothly as well, not only fpor dirs. --- lustre/lmv/lmv_obd.c | 16 ++++++++++++---- lustre/mdt/mdt_recovery.c | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index d50891b..b5fbc8c 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -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 { diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index c126c0a..43fc07d 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -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) { -- 1.8.3.1