lkml.org 
[lkml]   [2009]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT]: Networking
David Miller a écrit :
> From: Linus Torvalds <torvalds@linux-foundation.org>
> Date: Tue, 16 Jun 2009 11:59:34 -0700 (PDT)
>
>> At the very least, add a helper function for "do I actually have
>> outstanding allocations" or something like that. IOW, do a
>>
>> /*
>> * Comment here about that magical "1"
>> */
>> static inline int sk_has_allocations(struct sock *sk)
>> {
>> return atomic_read(&sk->sk_wmem_alloc) > 1 ||
>> atomic_read(&sk->sk_rmem_alloc);
>> }
>>
>> and then make the various network protocols use that, rather than
>> open-coding some random internal implementation magic.
>
> I agree, this should be handled with a helper function
> abstraction rather than putting "1" checks all over the place.

Fair enough, I'll submit an updated patch in following hour.

Thank you
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-06-16 21:41    [W:0.093 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site