On Wed, 2015-11-25 at 17:08 -0500, Aaron Conole wrote:

> > diff --git a/include/net/sock.h b/include/net/sock.h
> > index 7f89e4ba18d1..ead514332ae8 100644
> > --- a/include/net/sock.h
> > +++ b/include/net/sock.h
> > @@ -776,7 +776,7 @@ static inline int sk_memalloc_socks(void)
> >  
> >  static inline gfp_t sk_gfp_atomic(const struct sock *sk, gfp_t gfp_mask)
> >  {
> > -   return GFP_ATOMIC | (sk->sk_allocation & __GFP_MEMALLOC);
> > +   return gfp_mask | (sk->sk_allocation & __GFP_MEMALLOC);
> >  }
> >  
> 
> Sorry if I'm missing something obvious here, but with a name like
> sk_gfp_atomic, would it make sense to keep the GFP_ATOMIC mask as well?
> Otherwise, what is the _atomic is saying?

Not sure what you suggest.

Are you suggesting I remove GFP_ATOMIC from all callers ?

I am fine with this, but looks more invasive, and who knows, maybe one
caller might want to not use GFP_ATOMIC one day (like : do not attempt
to use reserves)

This sk_gfp_atomic() helper has a misleading name, since all it wanted
was to conditionally OR a caller provided flag (mostly GFP_ATOMIC one)
with __GFP_MEMALLOC for some special sockets.

Should have been sk_gfp_or_memalloc() or something...


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to