summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-11-28 13:56:09 -0800
committerAndi Kleen <ak@linux.intel.com>2010-12-14 23:40:18 +0100
commit1e6aa82072d3c8267011461d17fbb25c247a3214 (patch)
tree721767570282570ec66527ba1e02be05ee1ec71d
parent22d2fae507439362ff0efe22fe3196bb9b6e4ce4 (diff)
Rename 'pipe_info()' to 'get_pipe_info()'
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> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--fs/splice.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/splice.c b/fs/splice.c
index efdbfece9932..8be9d4bf8036 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1328,12 +1328,11 @@ static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
* 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;
}
/*
@@ -1348,8 +1347,8 @@ static long do_splice(struct file *in, loff_t __user *off_in,
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)
@@ -1567,7 +1566,7 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *iov,
int error;
long ret;
- pipe = pipe_info(file->f_path.dentry->d_inode);
+ pipe = get_pipe_info(file);
if (!pipe)
return -EBADF;
@@ -1654,7 +1653,7 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
};
long ret;
- pipe = pipe_info(file->f_path.dentry->d_inode);
+ pipe = get_pipe_info(file);
if (!pipe)
return -EBADF;
@@ -2034,8 +2033,8 @@ static int link_pipe(struct pipe_inode_info *ipipe,
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;
/*