vfs: optimize touch_time() too
authorAndi Kleen <andi@firstfloor.org>
Fri, 18 Sep 2009 20:05:48 +0000 (13:05 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Sep 2009 11:47:27 +0000 (07:47 -0400)
commitce06e0b21d6732a2bab10a585a3ec6909499be28
tree5d796827ad968bf305c54a2dd7d6453a24e15344
parentb12536c27043f1c21195e587eb59950428326e22
vfs: optimize touch_time() too

Do a similar optimization as earlier for touch_atime.  Getting the lock in
mnt_get_write is relatively costly, so try all avenues to avoid it first.

This patch is careful to still only update inode fields inside the lock
region.

This didn't show up in benchmarks, but it's easy enough to do.

[akpm@linux-foundation.org: fix typo in comment]
[hugh.dickins@tiscali.co.uk: fix inverted test of mnt_want_write_file()]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Valerie Aurora <vaurora@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/inode.c