Whamcloud - gitweb
LU-191 mdd_close always set atime even it's same
authorLiang Zhen <liang@whamcloud.com>
Mon, 4 Apr 2011 16:31:20 +0000 (00:31 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Apr 2011 18:23:41 +0000 (11:23 -0700)
mdd_close always set atime even new atime is exactly same as old one,
this will impact performance of those shortly open/close applications
and tests because of unnecessary transaction.

Change-Id: Ib408dd238fca2e8a736aff1874e243f0d26894b0
Signed-off-by: Liang Zhen <liang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/396
Tested-by: Hudson
Reviewed-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_object.c

index b0e3911..581b876 100644 (file)
@@ -1035,9 +1035,9 @@ static int mdd_fix_attr(const struct lu_env *env, struct mdd_object *obj,
 
         if (la->la_valid == LA_ATIME) {
                 /* This is atime only set for read atime update on close. */
-                if (la->la_atime > tmp_la->la_atime &&
-                    la->la_atime <= (tmp_la->la_atime +
-                                     mdd_obj2mdd_dev(obj)->mdd_atime_diff))
+                if (la->la_atime >= tmp_la->la_atime &&
+                    la->la_atime < (tmp_la->la_atime +
+                                    mdd_obj2mdd_dev(obj)->mdd_atime_diff))
                         la->la_valid &= ~LA_ATIME;
                 RETURN(0);
         }