Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+9 -10
+9 -10
fs/splice.c
··· 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 /* ··· 1335 1336 loff_t offset, *off; 1336 1337 long ret; 1337 1338 1338 - ipipe = pipe_info(in->f_path.dentry->d_inode); 1339 - opipe = pipe_info(out->f_path.dentry->d_inode); 1339 + ipipe = get_pipe_info(in); 1340 + opipe = get_pipe_info(out); 1340 1341 1341 1342 if (ipipe && opipe) { 1342 1343 if (off_in || off_out) ··· 1554 1555 int error; 1555 1556 long ret; 1556 1557 1557 - pipe = pipe_info(file->f_path.dentry->d_inode); 1558 + pipe = get_pipe_info(file); 1558 1559 if (!pipe) 1559 1560 return -EBADF; 1560 1561 ··· 1641 1642 }; 1642 1643 long ret; 1643 1644 1644 - pipe = pipe_info(file->f_path.dentry->d_inode); 1645 + pipe = get_pipe_info(file); 1645 1646 if (!pipe) 1646 1647 return -EBADF; 1647 1648 ··· 2021 2022 static long do_tee(struct file *in, struct file *out, size_t len, 2022 2023 unsigned int flags) 2023 2024 { 2024 - struct pipe_inode_info *ipipe = pipe_info(in->f_path.dentry->d_inode); 2025 - struct pipe_inode_info *opipe = pipe_info(out->f_path.dentry->d_inode); 2025 + struct pipe_inode_info *ipipe = get_pipe_info(in); 2026 + struct pipe_inode_info *opipe = get_pipe_info(out); 2026 2027 int ret = -EINVAL; 2027 2028 2028 2029 /*