• Miklos Szeredi's avatar
    ovl: add helper to return real file · 2ef66b8a
    Miklos Szeredi authored
    
    
    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: default avatarMiklos Szeredi <mszeredi@redhat.com>
    2ef66b8a
file.c 3.31 KB