Whamcloud - gitweb
- take credits for objids update correctly
authortappro <tappro>
Fri, 30 Nov 2007 08:48:45 +0000 (08:48 +0000)
committertappro <tappro>
Fri, 30 Nov 2007 08:48:45 +0000 (08:48 +0000)
  b:13710
  i: nikita, fanyong

lustre/include/dt_object.h
lustre/mdd/mdd_trans.c
lustre/osd/osd_handler.c
lustre/tests/conf-sanity.sh

index 5eff04c..563adc1 100644 (file)
@@ -71,6 +71,8 @@ enum dt_txn_op {
         DTO_ATTR_SET,
         DTO_XATTR_SET,
         DTO_LOG_REC, /* XXX temporary: dt layer knows nothing about llog. */
         DTO_ATTR_SET,
         DTO_XATTR_SET,
         DTO_LOG_REC, /* XXX temporary: dt layer knows nothing about llog. */
+        DTO_WRITE_BASE,
+        DTO_WRITE_BLOCK,
 
         DTO_NR
 };
 
         DTO_NR
 };
index 3c84ee7..e1b1461 100644 (file)
 
 #include "mdd_internal.h"
 
 
 #include "mdd_internal.h"
 
+static int dto_txn_credits[DTO_NR];
+
 int mdd_txn_start_cb(const struct lu_env *env, struct txn_param *param,
                      void *cookie)
 {
 int mdd_txn_start_cb(const struct lu_env *env, struct txn_param *param,
                      void *cookie)
 {
+        struct mdd_device *mdd = cookie;
+        struct obd_device *obd = mdd2obd_dev(mdd);
+        /* Each transaction updates lov objids, the credits should be added for
+         * this */
+        int blk, shift = mdd->mdd_dt_conf.ddp_block_shift;
+        blk = ((obd->u.mds.mds_lov_desc.ld_tgt_count * sizeof(obd_id) +
+               (1 << shift) - 1) >> shift) + 1;
+
+        /* add lov objids credits */
+        param->tp_credits += blk * dto_txn_credits[DTO_WRITE_BLOCK] +
+                             dto_txn_credits[DTO_WRITE_BASE];
+
         return 0;
 }
 
         return 0;
 }
 
@@ -66,7 +80,6 @@ int mdd_txn_commit_cb(const struct lu_env *env, struct thandle *txn,
         return 0;
 }
 
         return 0;
 }
 
-static int dto_txn_credits[DTO_NR];
 void mdd_txn_param_build(const struct lu_env *env, struct mdd_device *mdd,
                          enum mdd_txn_op op)
 {
 void mdd_txn_param_build(const struct lu_env *env, struct mdd_device *mdd,
                          enum mdd_txn_op op)
 {
index 8361deb..20965ee 100644 (file)
@@ -566,7 +566,7 @@ static int osd_statfs(const struct lu_env *env,
         spin_lock(&osd->od_osfs_lock);
         /* cache 1 second */
         if (cfs_time_before_64(osd->od_osfs_age, cfs_time_shift_64(-1))) {
         spin_lock(&osd->od_osfs_lock);
         /* cache 1 second */
         if (cfs_time_before_64(osd->od_osfs_age, cfs_time_shift_64(-1))) {
-                result = sb->s_op->statfs(sb, &osd->od_kstatfs);
+                result = ll_do_statfs(sb, &osd->od_kstatfs);
                 if (likely(result == 0)) /* N.B. statfs can't really fail */
                         osd->od_osfs_age = cfs_time_current_64();
         }
                 if (likely(result == 0)) /* N.B. statfs can't really fail */
                         osd->od_osfs_age = cfs_time_current_64();
         }
@@ -811,7 +811,11 @@ static const int osd_dto_credits[DTO_NR] = {
          * also counted in. Do not know why?
          */
         [DTO_XATTR_SET]     = 16,
          * also counted in. Do not know why?
          */
         [DTO_XATTR_SET]     = 16,
-        [DTO_LOG_REC]       = 16
+        [DTO_LOG_REC]       = 16,
+        /* creadits for inode change during write */
+        [DTO_WRITE_BASE]    = 3,
+        /* credits for single block write */
+        [DTO_WRITE_BLOCK]   = 12 
 };
 
 static int osd_credit_get(const struct lu_env *env, struct dt_device *d,
 };
 
 static int osd_credit_get(const struct lu_env *env, struct dt_device *d,
index a483e3a..75b3644 100644 (file)
@@ -13,8 +13,8 @@ ONLY=${ONLY:-"$*"}
 
 # These tests don't apply to mountconf
 MOUNTCONFSKIP="10 11 12 13 13b 14 15"
 
 # These tests don't apply to mountconf
 MOUNTCONFSKIP="10 11 12 13 13b 14 15"
-# bug number for skipped test: 13739   13710
-HEAD_EXCEPT="                  32a 32b 33"
+# bug number for skipped test: 13739 
+HEAD_EXCEPT="                  32a 32b "
 
 # bug number for skipped test:                                  13709 10510 12743
 ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP $HEAD_EXCEPT 22    23    36"
 
 # bug number for skipped test:                                  13709 10510 12743
 ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP $HEAD_EXCEPT 22    23    36"