]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/read_write.c
xfs: check for obviously bad level values in the bmbt root
[mirror_ubuntu-zesty-kernel.git] / fs / read_write.c
index 7537b6b6b5a2dc80caa8774f8534ccc5e6b4fee2..f9f8bb137806b20a44019073f3ecd0380449a9f3 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/fs.h>
 #include "internal.h"
 
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/unistd.h>
 
 typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
@@ -515,6 +515,30 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
 }
 EXPORT_SYMBOL(__vfs_write);
 
+vfs_readf_t vfs_readf(struct file *file)
+{
+       const struct file_operations *fop = file->f_op;
+
+       if (fop->read)
+               return fop->read;
+       if (fop->read_iter)
+               return new_sync_read;
+       return ERR_PTR(-ENOSYS);
+}
+EXPORT_SYMBOL_GPL(vfs_readf);
+
+vfs_writef_t vfs_writef(struct file *file)
+{
+       const struct file_operations *fop = file->f_op;
+
+       if (fop->write)
+               return fop->write;
+       if (fop->write_iter)
+               return new_sync_write;
+       return ERR_PTR(-ENOSYS);
+}
+EXPORT_SYMBOL_GPL(vfs_writef);
+
 ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
 {
        mm_segment_t old_fs;