Whamcloud - gitweb
b=1598
authorphil <phil>
Sun, 3 Aug 2003 23:57:51 +0000 (23:57 +0000)
committerphil <phil>
Sun, 3 Aug 2003 23:57:51 +0000 (23:57 +0000)
Final version of the read performance patch, tested on ALC.

lustre/llite/file.c
lustre/llite/iod.c
lustre/llite/rw.c
lustre/obdclass/obdo.c

index 2ccf3c0..164223b 100644 (file)
@@ -205,8 +205,9 @@ static int ll_osc_open(struct lustre_handle *conn, struct inode *inode,
                 GOTO(out, rc);
 
         file->f_flags &= ~O_LOV_DELAY_CREATE;
-        obdo_refresh_inode(inode, oa, (OBD_MD_FLBLOCKS | OBD_MD_FLATIME |
-                                       OBD_MD_FLMTIME | OBD_MD_FLCTIME));
+        obdo_refresh_inode(inode, oa, (OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ |
+                                       OBD_MD_FLATIME | OBD_MD_FLMTIME |
+                                       OBD_MD_FLCTIME));
         EXIT;
 out:
         obdo_free(oa);
@@ -263,6 +264,7 @@ static int ll_create_obj(struct lustre_handle *conn, struct inode *inode,
                 }
                 GOTO(out_oa, rc);
         }
+        obdo_refresh_inode(inode, oa, OBD_MD_FLBLKSZ);
 
         LASSERT(lsm && lsm->lsm_object_id);
         rc = obd_packmd(conn, &lmm, lsm);
@@ -469,8 +471,8 @@ int ll_inode_getattr(struct inode *inode, struct lov_stripe_md *lsm,
                  (aft != 0 || after < before) &&
                  oa.o_size < ((u64)before + 1) << PAGE_CACHE_SHIFT);
 
-        obdo_refresh_inode(inode, &oa, (OBD_MD_FLBLOCKS | OBD_MD_FLMTIME |
-                                        OBD_MD_FLCTIME));
+        obdo_refresh_inode(inode, &oa, (OBD_MD_FLBLOCKS | OBD_MD_FLBLKSZ |
+                                        OBD_MD_FLMTIME | OBD_MD_FLCTIME));
         if (inode->i_blksize < PAGE_CACHE_SIZE)
                 inode->i_blksize = PAGE_CACHE_SIZE;
 
index c30ef8a..eef67d4 100644 (file)
@@ -170,9 +170,11 @@ static void ll_writeback(struct inode *inode, struct obdo *oa,
                                    llwp->pga, set, NULL);
                 if (rc == 0)
                         rc = ptlrpc_set_wait(set);
-                if (rc == 0)
-                        obdo_refresh_inode(inode, oa,
-                                           oa->o_valid & ~OBD_MD_FLSIZE);
+                if (rc == 0) {
+                        /* bug 1598: don't clobber blksize */
+                        oa->o_valid &= ~(OBD_MD_FLSIZE | OBD_MD_FLBLKSZ);
+                        obdo_refresh_inode(inode, oa, oa->o_valid);
+                }
                 ptlrpc_set_destroy (set);
         }
         /*
index b79ee7d..741b170 100644 (file)
@@ -305,8 +305,11 @@ static int ll_readpage(struct file *file, struct page *first_page)
                 if (rc == 0)
                         rc = ptlrpc_set_wait(set);
                 ptlrpc_set_destroy(set);
-                if (rc == 0)
+                if (rc == 0) {
+                        /* bug 1598: don't clobber blksize */
+                        oa->o_valid &= ~(OBD_MD_FLSIZE | OBD_MD_FLBLKSZ);
                         obdo_refresh_inode(inode, oa, oa->o_valid);
+                }
                 if (rc && rc != -EIO)
                         CERROR("error from obd_brw_async: rc = %d\n", rc);
                 obdo_free(oa);
@@ -426,8 +429,11 @@ static int ll_prepare_write(struct file *file, struct page *page, unsigned from,
         oa.o_valid = OBD_MD_FLID |OBD_MD_FLMODE |OBD_MD_FLTYPE |OBD_MD_FLHANDLE;
 
         rc = ll_brw(OBD_BRW_READ, inode, &oa, page, 0);
-        if (rc == 0)
+        if (rc == 0) {
+                /* bug 1598: don't clobber blksize */
+                oa.o_valid &= ~(OBD_MD_FLSIZE | OBD_MD_FLBLKSZ);
                 obdo_refresh_inode(inode, &oa, oa.o_valid);
+        }
 
         EXIT;
  prepare_done:
index 493e829..6481121 100644 (file)
@@ -205,8 +205,9 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid)
                 LTIME_S(dst->i_ctime) = src->o_ctime;
         if (valid & OBD_MD_FLSIZE && src->o_size > dst->i_size)
                 dst->i_size = src->o_size;
-        /* Bug 1598: don't ever update i_blksize here; it needs to be managed
-         * by the LOV */
+        /* optimum IO size */
+        if (valid & OBD_MD_FLBLKSZ && src->o_blksize > dst->i_blksize)
+                dst->i_blksize = src->o_blksize;
         /* allocation of space */
         if (valid & OBD_MD_FLBLOCKS && src->o_blocks > dst->i_blocks)
                 dst->i_blocks = src->o_blocks;