From: phil Date: Sun, 3 Aug 2003 23:57:51 +0000 (+0000) Subject: b=1598 X-Git-Tag: 0.9.1~386 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=55938c21203391199ef1c1540c721e866040dcdf;p=fs%2Flustre-release.git b=1598 Final version of the read performance patch, tested on ALC. --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 2ccf3c0..164223b 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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; diff --git a/lustre/llite/iod.c b/lustre/llite/iod.c index c30ef8a..eef67d4 100644 --- a/lustre/llite/iod.c +++ b/lustre/llite/iod.c @@ -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); } /* diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index b79ee7d..741b170 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -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: diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index 493e829..6481121 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -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;