Commit beaa2647 authored by Swapnil Pimpale's avatar Swapnil Pimpale Committed by Greg Kroah-Hartman

staging/lustre/osc: Update inode timestamp for lockless IO as well

Removed the checks for oi_lockless from osc_io_read_start() and
osc_io_write_start(). This patch also removes the unnecessary call to
cl_object_attr_get() in osc_io_write_start() before calling
cl_object_attr_set()
Signed-off-by: default avatarSwapnil Pimpale <spimpale@ddn.com>
Reviewed-on: http://review.whamcloud.com/8797
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3868Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5e42bc9d
...@@ -509,12 +509,11 @@ static void osc_io_setattr_end(const struct lu_env *env, ...@@ -509,12 +509,11 @@ static void osc_io_setattr_end(const struct lu_env *env,
static int osc_io_read_start(const struct lu_env *env, static int osc_io_read_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct osc_io *oio = cl2osc_io(env, slice);
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
int rc = 0; int rc = 0;
if (oio->oi_lockless == 0 && !slice->cis_io->ci_noatime) { if (!slice->cis_io->ci_noatime) {
cl_object_attr_lock(obj); cl_object_attr_lock(obj);
attr->cat_atime = LTIME_S(CURRENT_TIME); attr->cat_atime = LTIME_S(CURRENT_TIME);
rc = cl_object_attr_set(env, obj, attr, CAT_ATIME); rc = cl_object_attr_set(env, obj, attr, CAT_ATIME);
...@@ -526,24 +525,17 @@ static int osc_io_read_start(const struct lu_env *env, ...@@ -526,24 +525,17 @@ static int osc_io_read_start(const struct lu_env *env,
static int osc_io_write_start(const struct lu_env *env, static int osc_io_write_start(const struct lu_env *env,
const struct cl_io_slice *slice) const struct cl_io_slice *slice)
{ {
struct osc_io *oio = cl2osc_io(env, slice);
struct cl_object *obj = slice->cis_obj; struct cl_object *obj = slice->cis_obj;
struct cl_attr *attr = &osc_env_info(env)->oti_attr; struct cl_attr *attr = &osc_env_info(env)->oti_attr;
int result = 0; int rc = 0;
if (oio->oi_lockless == 0) { OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1); cl_object_attr_lock(obj);
cl_object_attr_lock(obj); attr->cat_mtime = attr->cat_ctime = LTIME_S(CURRENT_TIME);
result = cl_object_attr_get(env, obj, attr); rc = cl_object_attr_set(env, obj, attr, CAT_MTIME | CAT_CTIME);
if (result == 0) { cl_object_attr_unlock(obj);
attr->cat_mtime = attr->cat_ctime =
LTIME_S(CURRENT_TIME); return rc;
result = cl_object_attr_set(env, obj, attr,
CAT_MTIME | CAT_CTIME);
}
cl_object_attr_unlock(obj);
}
return result;
} }
static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj, static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment