summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/file.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ovl: Open file with data except for the case of fsyncVivek Goyal2018-07-201-9/+30
| | | | | | | | | | | | | | | | | | | ovl_open() should open file which contains data and not open metacopy inode. With the introduction of metacopy inodes, with current implementaion we will end up opening metacopy inode as well. But there can be certain circumstances like ovl_fsync() where we want to allow opening a metacopy inode instead. Hence, change ovl_open_realfile() and and add extra parameter which specifies whether to allow opening metacopy inode or not. If this parameter is false, we look for data inode and open that. This should allow covering both the cases. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add reflink/copyfile/dedup supportMiklos Szeredi2018-07-181-0/+87
| | | | | | Since set of arguments are so similar, handle in a common helper. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add O_DIRECT supportMiklos Szeredi2018-07-181-0/+3
| | | | Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add lsattr/chattr supportMiklos Szeredi2018-07-181-0/+79
| | | | | | Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add ovl_fallocate()Miklos Szeredi2018-07-181-0/+24
| | | | | | Implement stacked fallocate. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add ovl_mmap()Miklos Szeredi2018-07-181-0/+32
| | | | | | Implement stacked mmap. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add ovl_fsync()Miklos Szeredi2018-07-181-0/+23
| | | | | | | | Implement stacked fsync(). Don't sync if lower (noticed by Amir Goldstein). Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add ovl_write_iter()Miklos Szeredi2018-07-181-0/+39
| | | | | | Implement stacked writes. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add ovl_read_iter()Miklos Szeredi2018-07-181-0/+67
| | | | | | Implement stacked reading. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
* ovl: add helper to return real fileMiklos Szeredi2018-07-181-0/+60
| | | | | | | | | | | | | | | | 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>
* ovl: stack file opsMiklos Szeredi2018-07-181-0/+76
Implement file operations on a regular overlay file. The underlying file is opened separately and cached in ->private_data. It might be worth making an exception for such files when accounting in nr_file to confirm to userspace expectations. We are only adding a small overhead (248bytes for the struct file) since the real inode and dentry are pinned by overlayfs anyway. This patch doesn't have any effect, since the vfs will use d_real() to find the real underlying file to open. The patch at the end of the series will actually enable this functionality. AV: make it use open_with_fake_path(), don't mess with override_creds SzM: still need to mess with override_creds() until no fs uses current_cred() in their open method. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>