]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/aufs/vfsub.h
UBUNTU: SAUCE: aufs: for v4.5, use vfs_clone_file_range() in copy-up
[mirror_ubuntu-zesty-kernel.git] / fs / aufs / vfsub.h
index 8fae3d491ddfb2f620561d8581401d1782bed01c..71d2bc47d5c9cf9dd1843e0012848999f3241756 100644 (file)
@@ -266,6 +266,22 @@ int vfsub_trunc(struct path *h_path, loff_t length, unsigned int attr,
                struct file *h_file);
 int vfsub_fsync(struct file *file, struct path *path, int datasync);
 
+/*
+ * re-use branch fs's ioctl(FICLONE) while aufs itself doesn't support such
+ * ioctl.
+ */
+static inline int vfsub_clone_file_range(struct file *src, struct file *dst,
+                                        u64 len)
+{
+       int err;
+
+       lockdep_off();
+       err = vfs_clone_file_range(src, 0, dst, 0, len);
+       lockdep_on();
+
+       return err;
+}
+
 /* ---------------------------------------------------------------------- */
 
 static inline loff_t vfsub_llseek(struct file *file, loff_t offset, int origin)