瀏覽代碼

[PATCH] fs: remove redundant timespec_equal test in update_atime()

In update_atime(), timespec_equal() test is done twice in succession and
the second is always false.  This patch removes the second test.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tejun Heo 20 年之前
父節點
當前提交
5acd57936c
共有 1 個文件被更改,包括 0 次插入3 次删除
  1. 0 3
      fs/inode.c

+ 0 - 3
fs/inode.c

@@ -1195,9 +1195,6 @@ void update_atime(struct inode *inode)
 	if (!timespec_equal(&inode->i_atime, &now)) {
 		inode->i_atime = now;
 		mark_inode_dirty_sync(inode);
-	} else {
-		if (!timespec_equal(&inode->i_atime, &now))
-			inode->i_atime = now;
 	}
 }