]> err.no Git - linux-2.6/blobdiff - include/net/sock.h
virtio: simplify config mechanism.
[linux-2.6] / include / net / sock.h
index 786fae858e77027e5b5725ff41678893c796c95f..e3fb4c047f4c99b1bdb73471010916243e733bbf 100644 (file)
@@ -262,6 +262,8 @@ struct sock {
        __u32                   sk_sndmsg_off;
        int                     sk_write_pending;
        void                    *sk_security;
+       __u32                   sk_mark;
+       /* XXX 4 bytes hole on 64 bit */
        void                    (*sk_state_change)(struct sock *sk);
        void                    (*sk_data_ready)(struct sock *sk, int bytes);
        void                    (*sk_write_space)(struct sock *sk);
@@ -759,6 +761,14 @@ static inline void sk_mem_reclaim(struct sock *sk)
                __sk_mem_reclaim(sk);
 }
 
+static inline void sk_mem_reclaim_partial(struct sock *sk)
+{
+       if (!sk_has_account(sk))
+               return;
+       if (sk->sk_forward_alloc > SK_MEM_QUANTUM)
+               __sk_mem_reclaim(sk);
+}
+
 static inline void sk_mem_charge(struct sock *sk, int size)
 {
        if (!sk_has_account(sk))