Skip to content

Commit

Permalink
Un-inline get_pipe_info() helper function
Browse files Browse the repository at this point in the history
commit 7208364 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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
torvalds authored and Andi Kleen committed Dec 14, 2010
1 parent 23076bf commit 6efba84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 12 additions & 0 deletions fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,18 @@ int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf,
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;
Expand Down
13 changes: 1 addition & 12 deletions include/linux/pipe_fs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);

/* 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

0 comments on commit 6efba84

Please sign in to comment.