--- /dev/null
+From c66fb347946ebdd5b10908866ecc9fa05ee2cf3d Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sun, 28 Nov 2010 14:09:57 -0800
+Subject: Export 'get_pipe_info()' to other users
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit c66fb347946ebdd5b10908866ecc9fa05ee2cf3d upstream.
+
+And in particular, use it in 'pipe_fcntl()'.
+
+The other pipe functions do not need to use the 'careful' version, since
+they are only ever called for things that are already known to be pipes.
+
+The normal read/write/ioctl functions are called through the file
+operations structures, so if a file isn't a pipe, they'd never get
+called. But pipe_fcntl() is special, and called directly from the
+generic fcntl code, and needs to use the same careful function that the
+splice code is using.
+
+Cc: Jens Axboe <jaxboe@fusionio.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Dave Jones <davej@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/pipe.c | 2 +-
+ fs/splice.c | 11 -----------
+ include/linux/pipe_fs_i.h | 12 ++++++++++++
+ 3 files changed, 13 insertions(+), 12 deletions(-)
+
+--- a/fs/pipe.c
++++ b/fs/pipe.c
+@@ -1202,7 +1202,7 @@ long pipe_fcntl(struct file *file, unsig
+ struct pipe_inode_info *pipe;
+ long ret;
+
+- pipe = file->f_path.dentry->d_inode->i_pipe;
++ pipe = get_pipe_info(file);
+ if (!pipe)
+ return -EBADF;
+
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -1311,17 +1311,6 @@ long do_splice_direct(struct file *in, l
+ static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
+ struct pipe_inode_info *opipe,
+ size_t len, unsigned int flags);
+-/*
+- * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
+- * location, so checking ->i_pipe is not enough to verify that this is a
+- * pipe.
+- */
+-static inline struct pipe_inode_info *get_pipe_info(struct file *file)
+-{
+- struct inode *i = file->f_path.dentry->d_inode;
+-
+- return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
+-}
+
+ /*
+ * Determine where to splice to/from.
+--- a/include/linux/pipe_fs_i.h
++++ b/include/linux/pipe_fs_i.h
+@@ -161,4 +161,16 @@ void generic_pipe_buf_release(struct pip
+ /* for F_SETPIPE_SZ and F_GETPIPE_SZ */
+ long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
+
++/*
++ * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
++ * location, so checking ->i_pipe is not enough to verify that this is a
++ * pipe.
++ */
++static inline struct pipe_inode_info *get_pipe_info(struct file *file)
++{
++ struct inode *i = file->f_path.dentry->d_inode;
++
++ return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
++}
++
+ #endif
--- /dev/null
+From 71993e62a47dabddf10302807d6aa260455503f4 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sun, 28 Nov 2010 13:56:09 -0800
+Subject: Rename 'pipe_info()' to 'get_pipe_info()'
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 71993e62a47dabddf10302807d6aa260455503f4 upstream.
+
+.. and change it to take the 'file' pointer instead of an inode, since
+that's what all users want anyway.
+
+The renaming is preparatory to exporting it to other users. The old
+'pipe_info()' name was too generic and is already used elsewhere, so
+before making the function public we need to use a more specific name.
+
+Cc: Jens Axboe <jaxboe@fusionio.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Dave Jones <davej@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/splice.c | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
+
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -1316,12 +1316,11 @@ static int splice_pipe_to_pipe(struct pi
+ * location, so checking ->i_pipe is not enough to verify that this is a
+ * pipe.
+ */
+-static inline struct pipe_inode_info *pipe_info(struct inode *inode)
++static inline struct pipe_inode_info *get_pipe_info(struct file *file)
+ {
+- if (S_ISFIFO(inode->i_mode))
+- return inode->i_pipe;
++ struct inode *i = file->f_path.dentry->d_inode;
+
+- return NULL;
++ return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
+ }
+
+ /*
+@@ -1336,8 +1335,8 @@ static long do_splice(struct file *in, l
+ loff_t offset, *off;
+ long ret;
+
+- ipipe = pipe_info(in->f_path.dentry->d_inode);
+- opipe = pipe_info(out->f_path.dentry->d_inode);
++ ipipe = get_pipe_info(in);
++ opipe = get_pipe_info(out);
+
+ if (ipipe && opipe) {
+ if (off_in || off_out)
+@@ -1555,7 +1554,7 @@ static long vmsplice_to_user(struct file
+ int error;
+ long ret;
+
+- pipe = pipe_info(file->f_path.dentry->d_inode);
++ pipe = get_pipe_info(file);
+ if (!pipe)
+ return -EBADF;
+
+@@ -1642,7 +1641,7 @@ static long vmsplice_to_pipe(struct file
+ };
+ long ret;
+
+- pipe = pipe_info(file->f_path.dentry->d_inode);
++ pipe = get_pipe_info(file);
+ if (!pipe)
+ return -EBADF;
+
+@@ -2022,8 +2021,8 @@ static int link_pipe(struct pipe_inode_i
+ static long do_tee(struct file *in, struct file *out, size_t len,
+ unsigned int flags)
+ {
+- struct pipe_inode_info *ipipe = pipe_info(in->f_path.dentry->d_inode);
+- struct pipe_inode_info *opipe = pipe_info(out->f_path.dentry->d_inode);
++ struct pipe_inode_info *ipipe = get_pipe_info(in);
++ struct pipe_inode_info *opipe = get_pipe_info(out);
+ int ret = -EINVAL;
+
+ /*
r8169-revert-handle-rxfifo-errors-on-8168-chips.patch
r8169-fix-checksum-broken.patch
nmi-fix-clock-comparator-revalidation.patch
+rename-pipe_info-to-get_pipe_info.patch
+export-get_pipe_info-to-other-users.patch
+un-inline-get_pipe_info-helper-function.patch
--- /dev/null
+From 72083646528d4887b920deb71b37e09bc7d227bb Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Sun, 28 Nov 2010 16:27:19 -0800
+Subject: Un-inline get_pipe_info() helper function
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 72083646528d4887b920deb71b37e09bc7d227bb upstream.
+
+This avoids some include-file hell, and the function isn't really
+important enough to be inlined anyway.
+
+Reported-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/pipe.c | 12 ++++++++++++
+ include/linux/pipe_fs_i.h | 13 +------------
+ 2 files changed, 13 insertions(+), 12 deletions(-)
+
+--- a/fs/pipe.c
++++ b/fs/pipe.c
+@@ -1197,6 +1197,18 @@ int pipe_proc_fn(struct ctl_table *table
+ return ret;
+ }
+
++/*
++ * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
++ * location, so checking ->i_pipe is not enough to verify that this is a
++ * pipe.
++ */
++struct pipe_inode_info *get_pipe_info(struct file *file)
++{
++ struct inode *i = file->f_path.dentry->d_inode;
++
++ return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
++}
++
+ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
+ {
+ struct pipe_inode_info *pipe;
+--- a/include/linux/pipe_fs_i.h
++++ b/include/linux/pipe_fs_i.h
+@@ -160,17 +160,6 @@ void generic_pipe_buf_release(struct pip
+
+ /* for F_SETPIPE_SZ and F_GETPIPE_SZ */
+ long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
+-
+-/*
+- * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
+- * location, so checking ->i_pipe is not enough to verify that this is a
+- * pipe.
+- */
+-static inline struct pipe_inode_info *get_pipe_info(struct file *file)
+-{
+- struct inode *i = file->f_path.dentry->d_inode;
+-
+- return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
+-}
++struct pipe_inode_info *get_pipe_info(struct file *file);
+
+ #endif