]> git.baikalelectronics.ru Git - kernel.git/commit
fs: only set S_VERSION when updating times if necessary
authorJeff Layton <jlayton@redhat.com>
Mon, 11 Dec 2017 11:35:22 +0000 (06:35 -0500)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Jan 2018 11:42:21 +0000 (06:42 -0500)
commitf7cfc4680160efa67e330e90dd465e23c3b44a3f
tree4a59d032a40104f990883b445dc725f5fec8bba8
parent4fabae196c58b397c80fd3d3824b6d4d7d71309b
fs: only set S_VERSION when updating times if necessary

We only really need to update i_version if someone has queried for it
since we last incremented it. By doing that, we can avoid having to
update the inode if the times haven't changed.

If the times have changed, then we go ahead and forcibly increment the
counter, under the assumption that we'll be going to the storage
anyway, and the increment itself is relatively cheap.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
fs/inode.c