Skip to content

Commit

Permalink
Merge branch 'splice' of git://brick.kernel.dk/data/git/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'splice' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [PATCH] splice: add ->splice_write support for /dev/null
  [PATCH] splice: rearrange moving to/from pipe helpers
  [PATCH] Add support for the sys_vmsplice syscall
  [PATCH] splice: fix offset problems
  [PATCH] splice: fix min() warning
  • Loading branch information
Linus Torvalds committed Apr 26, 2006
2 parents 07db869 + 1ebd32f commit 7b97ebf
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 77 deletions.
1 change: 1 addition & 0 deletions arch/ia64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1610,5 +1610,6 @@ sys_call_table:
data8 sys_get_robust_list
data8 sys_sync_file_range // 1300
data8 sys_tee
data8 sys_vmsplice

.org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
1 change: 1 addition & 0 deletions arch/powerpc/kernel/systbl.S
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ COMPAT_SYS(ppoll)
SYSCALL(unshare)
SYSCALL(splice)
SYSCALL(tee)
SYSCALL(vmsplice)

/*
* please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/cell/spu_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ void *spu_syscall_table[] = {
[__NR_unshare] sys_unshare,
[__NR_splice] sys_splice,
[__NR_tee] sys_tee,
[__NR_vmsplice] sys_vmsplice,
};

long spu_sys_callback(struct spu_syscall_block *s)
Expand Down
14 changes: 14 additions & 0 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/crash_dump.h>
#include <linux/backing-dev.h>
#include <linux/bootmem.h>
#include <linux/pipe_fs_i.h>

#include <asm/uaccess.h>
#include <asm/io.h>
Expand Down Expand Up @@ -578,6 +579,18 @@ static ssize_t write_null(struct file * file, const char __user * buf,
return count;
}

static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
struct splice_desc *sd)
{
return sd->len;
}

static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
{
return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
}

#ifdef CONFIG_MMU
/*
* For fun, we are using the MMU for this.
Expand Down Expand Up @@ -785,6 +798,7 @@ static struct file_operations null_fops = {
.llseek = null_lseek,
.read = read_null,
.write = write_null,
.splice_write = splice_write_null,
};

#if defined(CONFIG_ISA) || !defined(__mc68000__)
Expand Down
Loading

0 comments on commit 7b97ebf

Please sign in to comment.