diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 3eed5424e659..fb6080111461 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1653,10 +1653,10 @@ int __sk_mem_schedule(struct sock *sk, int size, int kind) | |||
1653 | { | 1653 | { |
1654 | struct proto *prot = sk->sk_prot; | 1654 | struct proto *prot = sk->sk_prot; |
1655 | int amt = sk_mem_pages(size); | 1655 | int amt = sk_mem_pages(size); |
1656 | int allocated; | 1656 | long allocated; |
1657 | 1657 | ||
1658 | sk->sk_forward_alloc += amt * SK_MEM_QUANTUM; | 1658 | sk->sk_forward_alloc += amt * SK_MEM_QUANTUM; |
1659 | allocated = atomic_add_return(amt, prot->memory_allocated); | 1659 | allocated = atomic_long_add_return(amt, prot->memory_allocated); |
1660 | 1660 | ||
1661 | /* Under limit. */ | 1661 | /* Under limit. */ |
1662 | if (allocated <= prot->sysctl_mem[0]) { | 1662 | if (allocated <= prot->sysctl_mem[0]) { |
@@ -1714,7 +1714,7 @@ suppress_allocation: | |||
1714 | 1714 | ||
1715 | /* Alas. Undo changes. */ | 1715 | /* Alas. Undo changes. */ |
1716 | sk->sk_forward_alloc -= amt * SK_MEM_QUANTUM; | 1716 | sk->sk_forward_alloc -= amt * SK_MEM_QUANTUM; |
1717 | atomic_sub(amt, prot->memory_allocated); | 1717 | atomic_long_sub(amt, prot->memory_allocated); |
1718 | return 0; | 1718 | return 0; |
1719 | } | 1719 | } |
1720 | EXPORT_SYMBOL(__sk_mem_schedule); | 1720 | EXPORT_SYMBOL(__sk_mem_schedule); |
@@ -1727,12 +1727,12 @@ void __sk_mem_reclaim(struct sock *sk) | |||
1727 | { | 1727 | { |
1728 | struct proto *prot = sk->sk_prot; | 1728 | struct proto *prot = sk->sk_prot; |
1729 | 1729 | ||
1730 | atomic_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT, | 1730 | atomic_long_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT, |
1731 | prot->memory_allocated); | 1731 | prot->memory_allocated); |
1732 | sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1; | 1732 | sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1; |
1733 | 1733 | ||
1734 | if (prot->memory_pressure && *prot->memory_pressure && | 1734 | if (prot->memory_pressure && *prot->memory_pressure && |
1735 | (atomic_read(prot->memory_allocated) < prot->sysctl_mem[0])) | 1735 | (atomic_long_read(prot->memory_allocated) < prot->sysctl_mem[0])) |
1736 | *prot->memory_pressure = 0; | 1736 | *prot->memory_pressure = 0; |
1737 | } | 1737 | } |
1738 | EXPORT_SYMBOL(__sk_mem_reclaim); | 1738 | EXPORT_SYMBOL(__sk_mem_reclaim); |
@@ -2452,12 +2452,12 @@ static char proto_method_implemented(const void *method) | |||
2452 | 2452 | ||
2453 | static void proto_seq_printf(struct seq_file *seq, struct proto *proto) | 2453 | static void proto_seq_printf(struct seq_file *seq, struct proto *proto) |
2454 | { | 2454 | { |
2455 | seq_printf(seq, "%-9s %4u %6d %6d %-3s %6u %-3s %-10s " | 2455 | seq_printf(seq, "%-9s %4u %6d %6ld %-3s %6u %-3s %-10s " |
2456 | "%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c\n", | 2456 | "%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c\n", |
2457 | proto->name, | 2457 | proto->name, |
2458 | proto->obj_size, | 2458 | proto->obj_size, |
2459 | sock_prot_inuse_get(seq_file_net(seq), proto), | 2459 | sock_prot_inuse_get(seq_file_net(seq), proto), |
2460 | proto->memory_allocated != NULL ? atomic_read(proto->memory_allocated) : -1, | 2460 | proto->memory_allocated != NULL ? atomic_long_read(proto->memory_allocated) : -1L, |
2461 | proto->memory_pressure != NULL ? *proto->memory_pressure ? "yes" : "no" : "NI", | 2461 | proto->memory_pressure != NULL ? *proto->memory_pressure ? "yes" : "no" : "NI", |
2462 | proto->max_header, | 2462 | proto->max_header, |
2463 | proto->slab == NULL ? "no" : "yes", | 2463 | proto->slab == NULL ? "no" : "yes", |