diff options
author | Paul Moore <paul.moore@hp.com> | 2007-06-07 21:37:15 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-08 16:33:09 -0400 |
commit | ba6ff9f2b5c6018b293bd21083ffaa5ad710e671 (patch) | |
tree | 7a868d3a1948ab9e1aaf7b6e64e114e0f790370d /include/net/netlabel.h | |
parent | 6363097cc4d182f93788131b5d8f72aa91d950a0 (diff) |
[NetLabel]: consolidate the struct socket/sock handling to just struct sock
The current NetLabel code has some redundant APIs which allow both
"struct socket" and "struct sock" types to be used; this may have made
sense at some point but it is wasteful now. Remove the functions that
operate on sockets and convert the callers. Not only does this make
the code smaller and more consistent but it pushes the locking burden
up to the caller which can be more intelligent about the locks. Also,
perform the same conversion (socket to sock) on the SELinux/NetLabel
glue code where it make sense.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netlabel.h')
-rw-r--r-- | include/net/netlabel.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index 83da7e1f0d3d..9b7d6f2ac9a3 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -332,17 +332,15 @@ static inline int netlbl_secattr_catmap_setrng( | |||
332 | */ | 332 | */ |
333 | 333 | ||
334 | #ifdef CONFIG_NETLABEL | 334 | #ifdef CONFIG_NETLABEL |
335 | int netlbl_socket_setattr(const struct socket *sock, | 335 | int netlbl_sock_setattr(struct sock *sk, |
336 | const struct netlbl_lsm_secattr *secattr); | 336 | const struct netlbl_lsm_secattr *secattr); |
337 | int netlbl_sock_getattr(struct sock *sk, | 337 | int netlbl_sock_getattr(struct sock *sk, |
338 | struct netlbl_lsm_secattr *secattr); | 338 | struct netlbl_lsm_secattr *secattr); |
339 | int netlbl_socket_getattr(const struct socket *sock, | ||
340 | struct netlbl_lsm_secattr *secattr); | ||
341 | int netlbl_skbuff_getattr(const struct sk_buff *skb, | 339 | int netlbl_skbuff_getattr(const struct sk_buff *skb, |
342 | struct netlbl_lsm_secattr *secattr); | 340 | struct netlbl_lsm_secattr *secattr); |
343 | void netlbl_skbuff_err(struct sk_buff *skb, int error); | 341 | void netlbl_skbuff_err(struct sk_buff *skb, int error); |
344 | #else | 342 | #else |
345 | static inline int netlbl_socket_setattr(const struct socket *sock, | 343 | static inline int netlbl_sock_setattr(struct sock *sk, |
346 | const struct netlbl_lsm_secattr *secattr) | 344 | const struct netlbl_lsm_secattr *secattr) |
347 | { | 345 | { |
348 | return -ENOSYS; | 346 | return -ENOSYS; |
@@ -354,12 +352,6 @@ static inline int netlbl_sock_getattr(struct sock *sk, | |||
354 | return -ENOSYS; | 352 | return -ENOSYS; |
355 | } | 353 | } |
356 | 354 | ||
357 | static inline int netlbl_socket_getattr(const struct socket *sock, | ||
358 | struct netlbl_lsm_secattr *secattr) | ||
359 | { | ||
360 | return -ENOSYS; | ||
361 | } | ||
362 | |||
363 | static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, | 355 | static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, |
364 | struct netlbl_lsm_secattr *secattr) | 356 | struct netlbl_lsm_secattr *secattr) |
365 | { | 357 | { |