Whamcloud - gitweb
- returned back grant related changes moved from 1_4 as they seem cause issues with #45
authoryury <yury>
Thu, 25 Aug 2005 06:34:25 +0000 (06:34 +0000)
committeryury <yury>
Thu, 25 Aug 2005 06:34:25 +0000 (06:34 +0000)
lustre/obdfilter/filter_io.c
lustre/osc/osc_request.c

index 4bf40fd..c986b2c 100644 (file)
@@ -406,7 +406,7 @@ static int filter_grant_check(struct obd_export *exp, int objcount,
                 for (i = 0; i < fso[obj].fso_bufcnt; i++, n++) {
                         int tmp, bytes;
 
-                        /* should match code in osc_exit_cache() */
+                        /* XXX: this is calculated with PAGE_SIZE on client */
                         bytes = rnb[n].len;
                         bytes += rnb[n].offset & (blocksize - 1);
                         tmp = (rnb[n].offset + rnb[n].len) & (blocksize - 1);
@@ -484,14 +484,6 @@ static int filter_grant_check(struct obd_export *exp, int objcount,
         }
         exp->exp_obd->u.filter.fo_tot_dirty -= used;
         fed->fed_dirty -= used;
-
-        if (fed->fed_dirty < 0 || fed->fed_grant < 0 || fed->fed_pending < 0) {
-                CERROR("%s: cli %s/%p dirty %ld pend %ld grant %ld\n",
-                       exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
-                       fed->fed_dirty, fed->fed_pending, fed->fed_grant);
-                spin_unlock(&exp->exp_obd->obd_osfs_lock);
-                LBUG();
-        }
         return rc;
 }
 
index 22297e8..180e7f4 100644 (file)
@@ -1948,7 +1948,6 @@ out:
 static void osc_exit_cache(struct client_obd *cli, struct osc_async_page *oap,
                            int sent)
 {
-        int blocksize = cli->cl_import->imp_obd->obd_osfs.os_bsize ? : 4096;
         ENTRY;
 
         if (!(oap->oap_brw_flags & OBD_BRW_FROM_GRANT)) {
@@ -1980,20 +1979,6 @@ static void osc_exit_cache(struct client_obd *cli, struct osc_async_page *oap,
                 cli->cl_lost_grant += PAGE_SIZE;
                 CDEBUG(D_CACHE, "lost grant: %lu avail grant: %lu dirty: %lu\n",
                        cli->cl_lost_grant, cli->cl_avail_grant, cli->cl_dirty);
-        } else if (PAGE_SIZE != blocksize && oap->oap_count != PAGE_SIZE) {
-                /* For short writes we shouldn't count parts of pages that span
-                 * a whole block on the OST side, or our accounting goes wrong.
-                 * Should match the code in filter_grant_check. */
-                int offset = (oap->oap_obj_off + oap->oap_page_off) & ~PAGE_MASK;
-                int count = oap->oap_count + (offset & (blocksize - 1));
-                int end = (offset + oap->oap_count) & (blocksize - 1);
-                if (end)
-                        count += blocksize - end;
-
-                cli->cl_lost_grant += PAGE_SIZE - count;
-                CDEBUG(D_CACHE, "lost %lu grant: %lu avail: %lu dirty: %lu\n",
-                       PAGE_SIZE - count, cli->cl_lost_grant,
-                       cli->cl_avail_grant, cli->cl_dirty);
         }
 
         EXIT;