1) currently, ofd_commitrw() calls lvbo_update()
from the read path with req == NULL.
The only effect of this call is lvb update from
disk. However, the read request does not update
inode info such as atime/mtime/ctime/i_size, so
there's no need for lvb update.
The comment above the removed code claims that
ofd_preprw_read() updated ondisk atime. In fact,
there's no code in the read path which updates
atime. Atime update was implemented by
obdo_to_inode() before we moved to osd.
We don't seem to suffer from this loss, so
attr_get and lvb update, which currently do nothing,
can be simply dropped.
2) ofd_commitrw_*() calls ofd_object_find()
whereas the corresponding preprw call has not
only received the pointer to the object, but
also keeps a reference on it when exits so
ofd_commitrw_*() has to put it twice.
We don't really need to look up the needed
object twice, just record it in the ofd info
and then take it from there.
Change-Id: If9692906e6c8c4e1254d166620d1ea7e68a933b6
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-8127
Reviewed-on: https://review.whamcloud.com/37795
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
RETURN(PTR_ERR(fo));
LASSERT(fo != NULL);
RETURN(PTR_ERR(fo));
LASSERT(fo != NULL);
+ ofd_info(env)->fti_obj = fo;
+
ofd_read_lock(env, fo);
if (!ofd_object_exists(fo))
GOTO(unlock, rc = -ENOENT);
ofd_read_lock(env, fo);
if (!ofd_object_exists(fo))
GOTO(unlock, rc = -ENOENT);
}
LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
}
LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
- rc = dt_attr_get(env, ofd_object_child(fo), la);
- if (unlikely(rc))
- GOTO(buf_put, rc);
-
rc = dt_read_prep(env, ofd_object_child(fo), lnb, *nr_local);
if (unlikely(rc))
GOTO(buf_put, rc);
rc = dt_read_prep(env, ofd_object_child(fo), lnb, *nr_local);
if (unlikely(rc))
GOTO(buf_put, rc);
GOTO(out, rc = PTR_ERR(fo));
LASSERT(fo != NULL);
GOTO(out, rc = PTR_ERR(fo));
LASSERT(fo != NULL);
+ ofd_info(env)->fti_obj = fo;
+
ofd_read_lock(env, fo);
if (!ofd_object_exists(fo)) {
CERROR("%s: BRW to missing obj "DOSTID"\n",
ofd_read_lock(env, fo);
if (!ofd_object_exists(fo)) {
CERROR("%s: BRW to missing obj "DOSTID"\n",
rc = ofd_preprw_read(env, exp, ofd, fid, &info->fti_attr, oa,
obj->ioo_bufcnt, rnb, nr_local, lnb,
jobid);
rc = ofd_preprw_read(env, exp, ofd, fid, &info->fti_attr, oa,
obj->ioo_bufcnt, rnb, nr_local, lnb,
jobid);
- obdo_from_la(oa, &info->fti_attr, LA_ATIME);
} else {
CERROR("%s: wrong cmd %d received!\n",
exp->exp_obd->obd_name, cmd);
} else {
CERROR("%s: wrong cmd %d received!\n",
exp->exp_obd->obd_name, cmd);
- fo = ofd_object_find(env, ofd, fid);
- if (IS_ERR(fo))
- RETURN(PTR_ERR(fo));
+ fo = ofd_info(env)->fti_obj;
LASSERT(fo != NULL);
LASSERT(ofd_object_exists(fo));
dt_bufs_put(env, ofd_object_child(fo), lnb, niocount);
ofd_read_unlock(env, fo);
ofd_object_put(env, fo);
LASSERT(fo != NULL);
LASSERT(ofd_object_exists(fo));
dt_bufs_put(env, ofd_object_child(fo), lnb, niocount);
ofd_read_unlock(env, fo);
ofd_object_put(env, fo);
- /* second put is pair to object_get in ofd_preprw_read */
- ofd_object_put(env, fo);
- fo = ofd_object_find(env, ofd, fid);
+ fo = ofd_info(env)->fti_obj;
LASSERT(fo != NULL);
o = ofd_object_child(fo);
LASSERT(fo != NULL);
o = ofd_object_child(fo);
out:
dt_bufs_put(env, o, lnb, niocount);
ofd_object_put(env, fo);
out:
dt_bufs_put(env, o, lnb, niocount);
ofd_object_put(env, fo);
- /* second put is pair to object_get in ofd_preprw_write */
- ofd_object_put(env, fo);
if (granted > 0)
tgt_grant_commit(exp, granted, old_rc);
RETURN(rc);
if (granted > 0)
tgt_grant_commit(exp, granted, old_rc);
RETURN(rc);
nodemap_putref(nodemap);
}
} else if (cmd == OBD_BRW_READ) {
nodemap_putref(nodemap);
}
} else if (cmd == OBD_BRW_READ) {
-
- /* If oa != NULL then ofd_preprw_read updated the inode
- * atime and we should update the lvb so that other glimpses
- * will also get the updated value. bug 5972 */
- if (oa && ns && ns->ns_lvbo && ns->ns_lvbo->lvbo_update) {
- ost_fid_build_resid(fid, &info->fti_resid);
- rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
- LDLM_EXTENT, 0);
- if (!IS_ERR(rs)) {
- ldlm_res_lvbo_update(rs, NULL, 1);
- ldlm_resource_putref(rs);
- }
- }
rc = ofd_commitrw_read(env, ofd, fid, objcount,
npages, lnb);
if (old_rc)
rc = ofd_commitrw_read(env, ofd, fid, objcount,
npages, lnb);
if (old_rc)