Whamcloud - gitweb
LU-7902 osd: no need to set same [acm]time 88/19088/4
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 23 Mar 2016 12:32:54 +0000 (15:32 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Apr 2016 15:48:03 +0000 (15:48 +0000)
osd_attr_set() has [acm]time cached in the objects. so if the caller
wants to set them to the same value, there is no point to call very
expensive SA update procedure.

Change-Id: I4e06306198496170f5d9c486a8d245c0978c0f79
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/19088
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_object.c

index b875be2..f00d454 100644 (file)
@@ -954,6 +954,15 @@ static int osd_attr_set(const struct lu_env *env, struct dt_object *dt,
        if (!S_ISREG(dt->do_lu.lo_header->loh_attr))
                valid &= ~(LA_SIZE | LA_BLOCKS);
 
        if (!S_ISREG(dt->do_lu.lo_header->loh_attr))
                valid &= ~(LA_SIZE | LA_BLOCKS);
 
+       if (valid & LA_CTIME && la->la_ctime == obj->oo_attr.la_ctime)
+               valid &= ~LA_CTIME;
+
+       if (valid & LA_MTIME && la->la_mtime == obj->oo_attr.la_mtime)
+               valid &= ~LA_MTIME;
+
+       if (valid & LA_ATIME && la->la_atime == obj->oo_attr.la_atime)
+               valid &= ~LA_ATIME;
+
        if (valid == 0)
                GOTO(out, rc = 0);
 
        if (valid == 0)
                GOTO(out, rc = 0);