From: Pieter Smith <pieter@boesman.nl>
To: pieter@boesman.nl
Cc: Josh Triplett <josh@joshtriplett.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 02/56] moved kernel_write out of splice translation unit
Date: Thu, 13 Nov 2014 22:22:39 +0100 [thread overview]
Message-ID: <1415913813-362-3-git-send-email-pieter@boesman.nl> (raw)
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>
kernel_write shares infrastructure with the read_write translation unit but not
with the splice translation unit. Grouping kernel_write with the read_write
translation unit is more logical. It also paves the way to compiling out the
splice group of syscalls for embedded systems that do not need them.
Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
fs/read_write.c | 16 ++++++++++++++++
fs/splice.c | 16 ----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 3f7f04d..4361261 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1189,3 +1189,19 @@ COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd,
}
#endif
+ssize_t kernel_write(struct file *file, const char *buf, size_t count,
+ loff_t pos)
+{
+ mm_segment_t old_fs;
+ ssize_t res;
+
+ old_fs = get_fs();
+ set_fs(get_ds());
+ /* The cast to a user pointer is valid due to the set_fs() */
+ res = vfs_write(file, (__force const char __user *)buf, count, &pos);
+ set_fs(old_fs);
+
+ return res;
+}
+EXPORT_SYMBOL(kernel_write);
+
diff --git a/fs/splice.c b/fs/splice.c
index c1a2861..44b201b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -583,22 +583,6 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec,
return res;
}
-ssize_t kernel_write(struct file *file, const char *buf, size_t count,
- loff_t pos)
-{
- mm_segment_t old_fs;
- ssize_t res;
-
- old_fs = get_fs();
- set_fs(get_ds());
- /* The cast to a user pointer is valid due to the set_fs() */
- res = vfs_write(file, (__force const char __user *)buf, count, &pos);
- set_fs(old_fs);
-
- return res;
-}
-EXPORT_SYMBOL(kernel_write);
-
ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
--
1.9.1
next prev parent reply other threads:[~2014-11-13 21:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <pieter@boesman.nl>
[not found] ` <1415913813-362-1-git-send-email-pieter@boesman.nl>
2014-11-13 21:22 ` [PATCH 01/56] moved sendfile syscall to splice translation unit Pieter Smith
2014-11-13 21:22 ` Pieter Smith [this message]
[not found] ` <1415913813-362-1-git-send-email-pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org>
2014-11-13 21:22 ` [PATCH 03/56] fs: Support compiling out splice-family syscalls Pieter Smith
2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
2014-11-13 21:49 ` Richard Weinberger
2014-11-13 22:24 ` josh
2014-11-13 21:51 ` Al Viro
2014-11-13 21:22 ` [PATCH 07/56] fs/affs: support compiling out splice Pieter Smith
2014-11-13 21:22 ` [PATCH 09/56] fs/bad_inode: " Pieter Smith
2014-11-13 21:22 ` [PATCH 10/56] fs/block_dev: " Pieter Smith
2014-11-13 21:23 ` [PATCH 25/56] fs/hfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 26/56] fs/hfsplus: " Pieter Smith
2014-11-13 21:23 ` [PATCH 50/56] fs/read_write: " Pieter Smith
2014-11-13 21:23 ` [PATCH 56/56] fs/splice: full support for " Pieter Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415913813-362-3-git-send-email-pieter@boesman.nl \
--to=pieter@boesman.nl \
--cc=josh@joshtriplett.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).