* [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE
@ 2013-03-04 2:28 Cong Wang
2013-03-04 3:52 ` Neil Horman
2013-03-04 19:14 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2013-03-04 2:28 UTC (permalink / raw)
To: netdev
Cc: linux-sctp, Vlad Yasevich, Sridhar Samudrala, Neil Horman,
David S. Miller, Cong Wang
From: Cong Wang <amwang@redhat.com>
Don't definite its own MAX_KMALLOC_SIZE, use the one
defined in mm.
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
index 442ad4e..825ea94 100644
--- a/net/sctp/ssnmap.c
+++ b/net/sctp/ssnmap.c
@@ -41,8 +41,6 @@
#include <net/sctp/sctp.h>
#include <net/sctp/sm.h>
-#define MAX_KMALLOC_SIZE 131072
-
static struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *map, __u16 in,
__u16 out);
@@ -65,7 +63,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
int size;
size = sctp_ssnmap_size(in, out);
- if (size <= MAX_KMALLOC_SIZE)
+ if (size <= KMALLOC_MAX_SIZE)
retval = kmalloc(size, gfp);
else
retval = (struct sctp_ssnmap *)
@@ -82,7 +80,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
return retval;
fail_map:
- if (size <= MAX_KMALLOC_SIZE)
+ if (size <= KMALLOC_MAX_SIZE)
kfree(retval);
else
free_pages((unsigned long)retval, get_order(size));
@@ -124,7 +122,7 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map)
int size;
size = sctp_ssnmap_size(map->in.len, map->out.len);
- if (size <= MAX_KMALLOC_SIZE)
+ if (size <= KMALLOC_MAX_SIZE)
kfree(map);
else
free_pages((unsigned long)map, get_order(size));
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE
2013-03-04 2:28 [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE Cong Wang
@ 2013-03-04 3:52 ` Neil Horman
2013-03-04 19:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2013-03-04 3:52 UTC (permalink / raw)
To: Cong Wang
Cc: netdev, linux-sctp, Vlad Yasevich, Sridhar Samudrala,
David S. Miller
On Mon, Mar 04, 2013 at 10:28:27AM +0800, Cong Wang wrote:
> From: Cong Wang <amwang@redhat.com>
>
> Don't definite its own MAX_KMALLOC_SIZE, use the one
> defined in mm.
>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Sridhar Samudrala <sri@us.ibm.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
> ---
> diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
> index 442ad4e..825ea94 100644
> --- a/net/sctp/ssnmap.c
> +++ b/net/sctp/ssnmap.c
> @@ -41,8 +41,6 @@
> #include <net/sctp/sctp.h>
> #include <net/sctp/sm.h>
>
> -#define MAX_KMALLOC_SIZE 131072
> -
> static struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *map, __u16 in,
> __u16 out);
>
> @@ -65,7 +63,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
> int size;
>
> size = sctp_ssnmap_size(in, out);
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> retval = kmalloc(size, gfp);
> else
> retval = (struct sctp_ssnmap *)
> @@ -82,7 +80,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
> return retval;
>
> fail_map:
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> kfree(retval);
> else
> free_pages((unsigned long)retval, get_order(size));
> @@ -124,7 +122,7 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map)
> int size;
>
> size = sctp_ssnmap_size(map->in.len, map->out.len);
> - if (size <= MAX_KMALLOC_SIZE)
> + if (size <= KMALLOC_MAX_SIZE)
> kfree(map);
> else
> free_pages((unsigned long)map, get_order(size));
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE
2013-03-04 2:28 [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE Cong Wang
2013-03-04 3:52 ` Neil Horman
@ 2013-03-04 19:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-03-04 19:14 UTC (permalink / raw)
To: amwang; +Cc: netdev, linux-sctp, vyasevich, sri, nhorman
From: Cong Wang <amwang@redhat.com>
Date: Mon, 4 Mar 2013 10:28:27 +0800
> From: Cong Wang <amwang@redhat.com>
>
> Don't definite its own MAX_KMALLOC_SIZE, use the one
> defined in mm.
>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Sridhar Samudrala <sri@us.ibm.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-04 19:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 2:28 [Patch net] sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE Cong Wang
2013-03-04 3:52 ` Neil Horman
2013-03-04 19:14 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox