aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-04-10 01:33:47 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-10 01:33:47 -0700
commitb715631fad3ed320b85d386a84a6fb0b3f86b0b9 (patch)
tree3f7f84419a7ab76f78516abbbba929e1c19c2f7c /include
parentd9c58f30b08bfe1e689537af5bc855a76d0fae25 (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.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ddfa0372a3b..bfc5d319b94 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -37,21 +37,6 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
struct sock_filter __user *filter;
};
-#ifdef __KERNEL__
-struct sk_filter
-{
- atomic_t refcnt;
- unsigned int len; /* Number of filter blocks */
- struct rcu_head rcu;
- struct sock_filter insns[0];
-};
-
-static inline unsigned int sk_filter_len(struct sk_filter *fp)
-{
- return fp->len*sizeof(struct sock_filter) + sizeof(*fp);
-}
-#endif
-
/*
* Instruction classes
*/
@@ -141,10 +126,24 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
#define SKF_LL_OFF (-0x200000)
#ifdef __KERNEL__
+struct sk_filter
+{
+ atomic_t refcnt;
+ unsigned int len; /* Number of filter blocks */
+ struct rcu_head rcu;
+ struct sock_filter insns[0];
+};
+
+static inline unsigned int sk_filter_len(const struct sk_filter *fp)
+{
+ return fp->len * sizeof(struct sock_filter) + sizeof(*fp);
+}
+
struct sk_buff;
struct sock;
-extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
+extern unsigned int sk_run_filter(struct sk_buff *skb,
+ struct sock_filter *filter, int flen);
extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
extern int sk_detach_filter(struct sock *sk);
extern int sk_chk_filter(struct sock_filter *filter, int flen);