Commit 71993e62a47dabddf10302807d6aa260455503f4
1 parent
a9e40a2493
Exists in
master
and in
4 other branches
Rename 'pipe_info()' to 'get_pipe_info()'
.. 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>
Showing 1 changed file with 9 additions and 10 deletions Side-by-side Diff
fs/splice.c
... | ... | @@ -1316,12 +1316,11 @@ |
1316 | 1316 | * location, so checking ->i_pipe is not enough to verify that this is a |
1317 | 1317 | * pipe. |
1318 | 1318 | */ |
1319 | -static inline struct pipe_inode_info *pipe_info(struct inode *inode) | |
1319 | +static inline struct pipe_inode_info *get_pipe_info(struct file *file) | |
1320 | 1320 | { |
1321 | - if (S_ISFIFO(inode->i_mode)) | |
1322 | - return inode->i_pipe; | |
1321 | + struct inode *i = file->f_path.dentry->d_inode; | |
1323 | 1322 | |
1324 | - return NULL; | |
1323 | + return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; | |
1325 | 1324 | } |
1326 | 1325 | |
1327 | 1326 | /* |
... | ... | @@ -1336,8 +1335,8 @@ |
1336 | 1335 | loff_t offset, *off; |
1337 | 1336 | long ret; |
1338 | 1337 | |
1339 | - ipipe = pipe_info(in->f_path.dentry->d_inode); | |
1340 | - opipe = pipe_info(out->f_path.dentry->d_inode); | |
1338 | + ipipe = get_pipe_info(in); | |
1339 | + opipe = get_pipe_info(out); | |
1341 | 1340 | |
1342 | 1341 | if (ipipe && opipe) { |
1343 | 1342 | if (off_in || off_out) |
... | ... | @@ -1555,7 +1554,7 @@ |
1555 | 1554 | int error; |
1556 | 1555 | long ret; |
1557 | 1556 | |
1558 | - pipe = pipe_info(file->f_path.dentry->d_inode); | |
1557 | + pipe = get_pipe_info(file); | |
1559 | 1558 | if (!pipe) |
1560 | 1559 | return -EBADF; |
1561 | 1560 | |
... | ... | @@ -1642,7 +1641,7 @@ |
1642 | 1641 | }; |
1643 | 1642 | long ret; |
1644 | 1643 | |
1645 | - pipe = pipe_info(file->f_path.dentry->d_inode); | |
1644 | + pipe = get_pipe_info(file); | |
1646 | 1645 | if (!pipe) |
1647 | 1646 | return -EBADF; |
1648 | 1647 | |
... | ... | @@ -2022,8 +2021,8 @@ |
2022 | 2021 | static long do_tee(struct file *in, struct file *out, size_t len, |
2023 | 2022 | unsigned int flags) |
2024 | 2023 | { |
2025 | - struct pipe_inode_info *ipipe = pipe_info(in->f_path.dentry->d_inode); | |
2026 | - struct pipe_inode_info *opipe = pipe_info(out->f_path.dentry->d_inode); | |
2024 | + struct pipe_inode_info *ipipe = get_pipe_info(in); | |
2025 | + struct pipe_inode_info *opipe = get_pipe_info(out); | |
2027 | 2026 | int ret = -EINVAL; |
2028 | 2027 | |
2029 | 2028 | /* |