Whamcloud - gitweb
b=9926
authoryury <yury>
Fri, 30 Dec 2005 07:58:39 +0000 (07:58 +0000)
committeryury <yury>
Fri, 30 Dec 2005 07:58:39 +0000 (07:58 +0000)
r=adilger

- do not confuse developer looking at logs by saying that namespace is freeing on last lock put.
- cleanups in mds_init_lov_desc()
- using stripes = min(tgt_count, LOV_MAX_STRIPE_COUNT) as a basis for calculating easize/cookiesize on MDS and client.
- removed redundant obd_set_info("mds_conn") in mds_notify()

lustre/ldlm/ldlm_lock.c
lustre/mdc/mdc_request.c
lustre/mds/mds_lov.c

index 16ea94e..b1c9173 100644 (file)
@@ -131,7 +131,7 @@ void ldlm_lock_put(struct ldlm_lock *lock)
                 struct obd_export *export = NULL;
 
                 l_lock(&ns->ns_lock);
-                LDLM_DEBUG(lock, "final lock_put on destroyed lock, freeing");
+                LDLM_DEBUG(lock, "final lock_put on destroyed lock, freeing it.");
                 LASSERT(lock->l_destroyed);
                 LASSERT(list_empty(&lock->l_res_link));
 
index 4cb7bb5..0ec96b9 100644 (file)
@@ -1182,25 +1182,29 @@ int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp)
         struct lov_stripe_md lsm = { .lsm_magic = LOV_MAGIC };
         struct lov_desc desc;
         __u32 valsize = sizeof(desc);
+        __u32 stripes;
         int rc, size;
         ENTRY;
 
-        size = obd_size_diskmd(lov_exp, NULL);
-        if (cli->cl_max_mds_easize < size)
-                cli->cl_max_mds_easize = size;
-
         rc = obd_get_info(lov_exp, strlen("lovdesc") + 1, "lovdesc",
                           &valsize, &desc);
         if (rc)
                 RETURN(rc);
 
+        stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
+        lsm.lsm_stripe_count = stripes;
+        size = obd_size_diskmd(lov_exp, &lsm);
+        
+        if (cli->cl_max_mds_easize < size)
+                cli->cl_max_mds_easize = size;
+
         lsm.lsm_stripe_count = desc.ld_default_stripe_count;
         size = obd_size_diskmd(lov_exp, &lsm);
 
         if (cli->cl_default_mds_easize < size)
                 cli->cl_default_mds_easize = size;
 
-        size = desc.ld_tgt_count * sizeof(struct llog_cookie);
+        size = stripes * sizeof(struct llog_cookie);
         if (cli->cl_max_mds_cookiesize < size)
                 cli->cl_max_mds_cookiesize = size;
 
index 6c78bdf..6e1fe16 100644 (file)
@@ -148,29 +148,32 @@ int mds_lov_set_nextid(struct obd_device *obd)
 int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp)
 {
         struct mds_obd *mds = &obd->u.mds;
-        int valsize, rc;
+        int tgt_count, valsize, rc;
+        __u32 stripes;
         ENTRY;
 
+        mds->mds_has_lov_desc = 0;
         valsize = sizeof(mds->mds_lov_desc);
         rc = obd_get_info(mds->mds_osc_exp, strlen("lovdesc") + 1,
                           "lovdesc", &valsize, &mds->mds_lov_desc);
-        if (rc)
+        if (rc) {
                 CERROR("can't get lov_desc, rc %d\n", rc);
-        
-        mds->mds_has_lov_desc = rc ? 0 : 1;
+                RETURN(rc);
+        }
+                
+        mds->mds_has_lov_desc = 1;
+        tgt_count = mds->mds_lov_desc.ld_tgt_count;
+        stripes = min(tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
 
-        if (mds->mds_has_lov_desc) {
-                CDEBUG(D_HA, "updating lov_desc, tgt_count: %d\n",
-                       mds->mds_lov_desc.ld_tgt_count);
+        mds->mds_max_mdsize = lov_mds_md_size(stripes);
+        mds->mds_max_cookiesize = stripes * sizeof(struct llog_cookie);
 
-                mds->mds_max_mdsize = lov_mds_md_size(mds->mds_lov_desc.ld_tgt_count);
-                mds->mds_max_cookiesize = mds->mds_lov_desc.ld_tgt_count *
-                        sizeof(struct llog_cookie);
+        CDEBUG(D_HA, "updated lov_desc, tgt_count: %d\n", tgt_count);
 
-                CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n",
-                       mds->mds_max_mdsize, mds->mds_max_cookiesize);
-        }
-        RETURN(rc);
+        CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n",
+               mds->mds_max_mdsize, mds->mds_max_cookiesize);
+
+        RETURN(0);
 }
 
 /* update the LOV-OSC knowledge of the last used object id's */
@@ -626,11 +629,6 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched,
                 if (rc)
                         RETURN(rc);
 
-                rc = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"),
-                                  "mds_conn", 0, uuid);
-                if (rc != 0)
-                        RETURN(rc);
-
                 rc = mds_lov_start_synchronize(obd, uuid, 1);
                 lquota_recovery(quota_interface, obd);
         }