]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: add helper to return real file
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 18 Jul 2018 13:44:41 +0000 (15:44 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 18 Jul 2018 13:44:41 +0000 (15:44 +0200)
commitd012e1513d9f333ce75b3ab3ae3a2d021c2bf3d9
treebd973408b1d27670a142b4215b581d8a45d294a0
parent9e28c8f24d7a7cdebee09c591ac5ff6be9e91a30
ovl: add helper to return real file

In the common case we can just use the real file cached in
file->private_data.  There are two exceptions:

1) File has been copied up since open: in this unlikely corner case just
use a throwaway real file for the operation.  If ever this becomes a
perfomance problem (very unlikely, since overlayfs has been doing most fine
without correctly handling this case at all), then we can deal with that by
updating the cached real file.

2) File's f_flags have changed since open: no need to reopen the cached
real file, we can just change the flags there as well.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/file.c