aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index e178b49eefbb..d27ba6fdd039 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -716,10 +716,11 @@ extern void __sk_stream_mem_reclaim(struct sock *sk);
716extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind); 716extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind);
717 717
718#define SK_STREAM_MEM_QUANTUM ((int)PAGE_SIZE) 718#define SK_STREAM_MEM_QUANTUM ((int)PAGE_SIZE)
719#define SK_STREAM_MEM_QUANTUM_SHIFT ilog2(SK_STREAM_MEM_QUANTUM)
719 720
720static inline int sk_stream_pages(int amt) 721static inline int sk_stream_pages(int amt)
721{ 722{
722 return DIV_ROUND_UP(amt, SK_STREAM_MEM_QUANTUM); 723 return (amt + SK_STREAM_MEM_QUANTUM - 1) >> SK_STREAM_MEM_QUANTUM_SHIFT;
723} 724}
724 725
725static inline void sk_stream_mem_reclaim(struct sock *sk) 726static inline void sk_stream_mem_reclaim(struct sock *sk)