summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 21:58:12 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 21:58:12 +0300
commitff0f962ca3c38239b299a70e7eea27abfbb979c3 (patch)
treeab37876cf2e8af4900f11f44ac4b96cb0f15e548 /include/linux/fs.h
parent087a76d390cbb8c0d21ea0cb3672ab4a7bb76362 (diff)
parentc3c8699664800a68600f1988302173067eaeaffa (diff)
downloadlinux-ff0f962ca3c38239b299a70e7eea27abfbb979c3.tar.xz
Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull overlayfs updates from Miklos Szeredi: "This update contains: - try to clone on copy-up - allow renaming a directory - split source into managable chunks - misc cleanups and fixes It does not contain the read-only fd data inconsistency fix, which Al didn't like. I'll leave that to the next year..." * 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: (36 commits) ovl: fix reStructuredText syntax errors in documentation ovl: fix return value of ovl_fill_super ovl: clean up kstat usage ovl: fold ovl_copy_up_truncate() into ovl_copy_up() ovl: create directories inside merged parent opaque ovl: opaque cleanup ovl: show redirect_dir mount option ovl: allow setting max size of redirect ovl: allow redirect_dir to default to "on" ovl: check for emptiness of redirect dir ovl: redirect on rename-dir ovl: lookup redirects ovl: consolidate lookup for underlying layers ovl: fix nested overlayfs mount ovl: check namelen ovl: split super.c ovl: use d_is_dir() ovl: simplify lookup ovl: check lower existence of rename target ovl: rename: simplify handling of lower/merged directory ...
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b84230e070be..83de8b6601ba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1731,6 +1731,19 @@ extern int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
extern int vfs_dedupe_file_range(struct file *file,
struct file_dedupe_range *same);
+static inline int do_clone_file_range(struct file *file_in, loff_t pos_in,
+ struct file *file_out, loff_t pos_out,
+ u64 len)
+{
+ int ret;
+
+ sb_start_write(file_inode(file_out)->i_sb);
+ ret = vfs_clone_file_range(file_in, pos_in, file_out, pos_out, len);
+ sb_end_write(file_inode(file_out)->i_sb);
+
+ return ret;
+}
+
struct super_operations {
struct inode *(*alloc_inode)(struct super_block *sb);
void (*destroy_inode)(struct inode *);