diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-04-10 04:33:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-10 04:33:47 -0400 |
commit | b715631fad3ed320b85d386a84a6fb0b3f86b0b9 (patch) | |
tree | 3f7f84419a7ab76f78516abbbba929e1c19c2f7c /include | |
parent | d9c58f30b08bfe1e689537af5bc855a76d0fae25 (diff) |
socket: sk_filter minor cleanups
Some minor style cleanups:
* Move __KERNEL__ definitions to one place in filter.h
* Use const for sk_filter_len
* Line wrapping
* Put EXPORT_SYMBOL next to function definition
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index ddfa0372a3b7..bfc5d319b946 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -37,21 +37,6 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | |||
37 | struct sock_filter __user *filter; | 37 | struct sock_filter __user *filter; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | #ifdef __KERNEL__ | ||
41 | struct sk_filter | ||
42 | { | ||
43 | atomic_t refcnt; | ||
44 | unsigned int len; /* Number of filter blocks */ | ||
45 | struct rcu_head rcu; | ||
46 | struct sock_filter insns[0]; | ||
47 | }; | ||
48 | |||
49 | static inline unsigned int sk_filter_len(struct sk_filter *fp) | ||
50 | { | ||
51 | return fp->len*sizeof(struct sock_filter) + sizeof(*fp); | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | /* | 40 | /* |
56 | * Instruction classes | 41 | * Instruction classes |
57 | */ | 42 | */ |
@@ -141,10 +126,24 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp) | |||
141 | #define SKF_LL_OFF (-0x200000) | 126 | #define SKF_LL_OFF (-0x200000) |
142 | 127 | ||
143 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
129 | struct sk_filter | ||
130 | { | ||
131 | atomic_t refcnt; | ||
132 | unsigned int len; /* Number of filter blocks */ | ||
133 | struct rcu_head rcu; | ||
134 | struct sock_filter insns[0]; | ||
135 | }; | ||
136 | |||
137 | static inline unsigned int sk_filter_len(const struct sk_filter *fp) | ||
138 | { | ||
139 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); | ||
140 | } | ||
141 | |||
144 | struct sk_buff; | 142 | struct sk_buff; |
145 | struct sock; | 143 | struct sock; |
146 | 144 | ||
147 | extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); | 145 | extern unsigned int sk_run_filter(struct sk_buff *skb, |
146 | struct sock_filter *filter, int flen); | ||
148 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 147 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
149 | extern int sk_detach_filter(struct sock *sk); | 148 | extern int sk_detach_filter(struct sock *sk); |
150 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 149 | extern int sk_chk_filter(struct sock_filter *filter, int flen); |