]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/un-inline-get_pipe_info-helper-function.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / un-inline-get_pipe_info-helper-function.patch
1 From 72083646528d4887b920deb71b37e09bc7d227bb Mon Sep 17 00:00:00 2001
2 From: Linus Torvalds <torvalds@linux-foundation.org>
3 Date: Sun, 28 Nov 2010 16:27:19 -0800
4 Subject: Un-inline get_pipe_info() helper function
5
6 From: Linus Torvalds <torvalds@linux-foundation.org>
7
8 commit 72083646528d4887b920deb71b37e09bc7d227bb upstream.
9
10 This avoids some include-file hell, and the function isn't really
11 important enough to be inlined anyway.
12
13 Reported-by: Ingo Molnar <mingo@elte.hu>
14 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17 ---
18 fs/pipe.c | 12 ++++++++++++
19 include/linux/pipe_fs_i.h | 13 +------------
20 2 files changed, 13 insertions(+), 12 deletions(-)
21
22 --- a/fs/pipe.c
23 +++ b/fs/pipe.c
24 @@ -1197,6 +1197,18 @@ int pipe_proc_fn(struct ctl_table *table
25 return ret;
26 }
27
28 +/*
29 + * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
30 + * location, so checking ->i_pipe is not enough to verify that this is a
31 + * pipe.
32 + */
33 +struct pipe_inode_info *get_pipe_info(struct file *file)
34 +{
35 + struct inode *i = file->f_path.dentry->d_inode;
36 +
37 + return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
38 +}
39 +
40 long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
41 {
42 struct pipe_inode_info *pipe;
43 --- a/include/linux/pipe_fs_i.h
44 +++ b/include/linux/pipe_fs_i.h
45 @@ -160,17 +160,6 @@ void generic_pipe_buf_release(struct pip
46
47 /* for F_SETPIPE_SZ and F_GETPIPE_SZ */
48 long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
49 -
50 -/*
51 - * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
52 - * location, so checking ->i_pipe is not enough to verify that this is a
53 - * pipe.
54 - */
55 -static inline struct pipe_inode_info *get_pipe_info(struct file *file)
56 -{
57 - struct inode *i = file->f_path.dentry->d_inode;
58 -
59 - return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL;
60 -}
61 +struct pipe_inode_info *get_pipe_info(struct file *file);
62
63 #endif