]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.36.2/rename-pipe_info-to-get_pipe_info.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / rename-pipe_info-to-get_pipe_info.patch
CommitLineData
e6d06187
GKH
1From 71993e62a47dabddf10302807d6aa260455503f4 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Sun, 28 Nov 2010 13:56:09 -0800
4Subject: Rename 'pipe_info()' to 'get_pipe_info()'
5
6From: Linus Torvalds <torvalds@linux-foundation.org>
7
8commit 71993e62a47dabddf10302807d6aa260455503f4 upstream.
9
10.. and change it to take the 'file' pointer instead of an inode, since
11that's what all users want anyway.
12
13The renaming is preparatory to exporting it to other users. The old
14'pipe_info()' name was too generic and is already used elsewhere, so
15before making the function public we need to use a more specific name.
16
17Cc: Jens Axboe <jaxboe@fusionio.com>
18Cc: Andrew Morton <akpm@linux-foundation.org>
19Cc: Al Viro <viro@zeniv.linux.org.uk>
20Cc: Dave Jones <davej@redhat.com>
21Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23
24---
25 fs/splice.c | 19 +++++++++----------
26 1 file changed, 9 insertions(+), 10 deletions(-)
27
28--- a/fs/splice.c
29+++ b/fs/splice.c
30@@ -1316,12 +1316,11 @@ static int splice_pipe_to_pipe(struct pi
31 * location, so checking ->i_pipe is not enough to verify that this is a
32 * pipe.
33 */
34-static inline struct pipe_inode_info *pipe_info(struct inode *inode)
35+static inline struct pipe_inode_info *get_pipe_info(struct file *file)
36 {
37- if (S_ISFIFO(inode->i_mode))
38- return inode->i_pipe;
39+ struct inode *i = file->f_path.dentry->d_inode;
40
41- return NULL;
42+ return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
43 }
44
45 /*
46@@ -1336,8 +1335,8 @@ static long do_splice(struct file *in, l
47 loff_t offset, *off;
48 long ret;
49
50- ipipe = pipe_info(in->f_path.dentry->d_inode);
51- opipe = pipe_info(out->f_path.dentry->d_inode);
52+ ipipe = get_pipe_info(in);
53+ opipe = get_pipe_info(out);
54
55 if (ipipe && opipe) {
56 if (off_in || off_out)
57@@ -1555,7 +1554,7 @@ static long vmsplice_to_user(struct file
58 int error;
59 long ret;
60
61- pipe = pipe_info(file->f_path.dentry->d_inode);
62+ pipe = get_pipe_info(file);
63 if (!pipe)
64 return -EBADF;
65
66@@ -1642,7 +1641,7 @@ static long vmsplice_to_pipe(struct file
67 };
68 long ret;
69
70- pipe = pipe_info(file->f_path.dentry->d_inode);
71+ pipe = get_pipe_info(file);
72 if (!pipe)
73 return -EBADF;
74
75@@ -2022,8 +2021,8 @@ static int link_pipe(struct pipe_inode_i
76 static long do_tee(struct file *in, struct file *out, size_t len,
77 unsigned int flags)
78 {
79- struct pipe_inode_info *ipipe = pipe_info(in->f_path.dentry->d_inode);
80- struct pipe_inode_info *opipe = pipe_info(out->f_path.dentry->d_inode);
81+ struct pipe_inode_info *ipipe = get_pipe_info(in);
82+ struct pipe_inode_info *opipe = get_pipe_info(out);
83 int ret = -EINVAL;
84
85 /*