diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-04-12 10:27:39 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-04-12 10:27:39 +0200 |
commit | 232a73dda2f2dba9002b727eb3ec76d82882b90c (patch) | |
tree | 308cdeea9bf18de71af79dcd5a30a8f2be9af6da /fs/read_write.c | |
parent | 889d66848b12d891248b03abcb2a42047f8e172a (diff) | |
parent | ca62bed0bbf9baf88d8bb404d72dee3b44ef057e (diff) | |
download | linux-232a73dda2f2dba9002b727eb3ec76d82882b90c.tar.bz2 |
Merge tag 'asoc-v3.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v3.9
A few updates, more than I'd like, fixing some relatively small issues
but mostly driver specific ones. Nothing wildly exciting so if it
doesn't make v3.9 it won't be the end of the world but it'd be nice.
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index a698eff457fb..e6ddc8dceb96 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -17,6 +17,7 @@ #include <linux/splice.h> #include <linux/compat.h> #include "read_write.h" +#include "internal.h" #include <asm/uaccess.h> #include <asm/unistd.h> @@ -417,6 +418,33 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof EXPORT_SYMBOL(do_sync_write); +ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) +{ + mm_segment_t old_fs; + const char __user *p; + ssize_t ret; + + if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write)) + return -EINVAL; + + old_fs = get_fs(); + set_fs(get_ds()); + p = (__force const char __user *)buf; + if (count > MAX_RW_COUNT) + count = MAX_RW_COUNT; + if (file->f_op->write) + ret = file->f_op->write(file, p, count, pos); + else + ret = do_sync_write(file, p, count, pos); + set_fs(old_fs); + if (ret > 0) { + fsnotify_modify(file); + add_wchar(current, ret); + } + inc_syscw(current); + return ret; +} + ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { ssize_t ret; |