[RFC v8][PATCH 03/12] Make file_pos_read/write() public



These two are needed when we will use vfs_read() and vfs_write(),
in the next patch.

Signed-off-by: Oren Laadan <orenl@xxxxxxxxxxxxxxx>
---
fs/read_write.c | 10 ----------
include/linux/fs.h | 10 ++++++++++
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 9ba495d..5d5c192 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -324,16 +324,6 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_

EXPORT_SYMBOL(vfs_write);

-static inline loff_t file_pos_read(struct file *file)
-{
- return file->f_pos;
-}
-
-static inline void file_pos_write(struct file *file, loff_t pos)
-{
- file->f_pos = pos;
-}
-
asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
{
struct file *file;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 580b513..5537435 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1296,6 +1296,16 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct iovec *fast_pointer,
struct iovec **ret_pointer);

+static inline loff_t file_pos_read(struct file *file)
+{
+ return file->f_pos;
+}
+
+static inline void file_pos_write(struct file *file, loff_t pos)
+{
+ file->f_pos = pos;
+}
+
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
--
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] Hibernation: Add PM_RESTORE_PREPARE and PM_POST_RESTORE notifiers
    ... static int snapshot_open(struct inode *inode, struct file *filp) ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [patch 3/4] Refactor do_syslog interface
    ... This patch breaks out the read operations in do_sysloginto their ... there were declarations of do_syslog and a ... static int kmsg_open(struct inode * inode, ... static int kmsg_release(struct inode * inode, struct file * file) ...
    (Linux-Kernel)
  • Re: [PATCH] Code style fix for open_exec
    ... Code style fix for open_exec ... struct file *open_exec ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: kernel bug: futex_wait hang
    ... Try applying the patch below, which was recently posted by Jakub Jelinek. ... -static void queue_me(struct futex_q *q, int fd, struct file *filp) ... +static inline struct futex_hash_bucket * ...
    (Linux-Kernel)
  • [patch 3/4] Refactor do_syslog interface
    ... This patch breaks out the read operations in do_sysloginto their ... always had private declarations of printk.c functions (before, ... static int kmsg_open(struct inode * inode, ... static int kmsg_release(struct inode * inode, struct file * file) ...
    (Linux-Kernel)