X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=include%2Fnet%2Fsock.h;h=0d7e9834d9be78dad67707301866d9568deb7942;hb=437589a74b6a590d175f86cf9f7b2efcee7765e7;hp=adb7da20b5a10b2679d59734f6f46b971acf0094;hpb=06b050eb81b877c7a4adb6be8624ad3890fee9f2;p=cascardo%2Flinux.git diff --git a/include/net/sock.h b/include/net/sock.h index adb7da20b5a1..0d7e9834d9be 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -606,6 +606,15 @@ static inline void sk_add_bind_node(struct sock *sk, #define sk_for_each_bound(__sk, node, list) \ hlist_for_each_entry(__sk, node, list, sk_bind_node) +static inline struct user_namespace *sk_user_ns(struct sock *sk) +{ + /* Careful only use this in a context where these parameters + * can not change and must all be valid, such as recvmsg from + * userspace. + */ + return sk->sk_socket->file->f_cred->user_ns; +} + /* Sock flags */ enum sock_flags { SOCK_DEAD, @@ -1486,14 +1495,6 @@ extern void *sock_kmalloc(struct sock *sk, int size, extern void sock_kfree_s(struct sock *sk, void *mem, int size); extern void sk_send_sigurg(struct sock *sk); -#ifdef CONFIG_CGROUPS -extern void sock_update_classid(struct sock *sk); -#else -static inline void sock_update_classid(struct sock *sk) -{ -} -#endif - /* * Functions to fill in entries in struct proto_ops when a protocol * does not implement a particular function. @@ -1670,7 +1671,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) write_unlock_bh(&sk->sk_callback_lock); } -extern int sock_i_uid(struct sock *sk); +extern kuid_t sock_i_uid(struct sock *sk); extern unsigned long sock_i_ino(struct sock *sk); static inline struct dst_entry *