diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-04-26 17:33:56 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-04-26 17:33:56 +1000 |
commit | 4a911396c6fe5e9447ba726c0ac4eed3c3eac3d5 (patch) | |
tree | 3237f57ab7c2411cfb1e2440086001d06e6121e0 /net/sctp/associola.c | |
parent | fd0fcaf19bdf5643b26518c5b89867638d49588e (diff) | |
parent | a3949d83537e3aba2412276284865ed4e4a89ab3 (diff) |
Merge branch 'akpm/master'
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r-- | net/sctp/associola.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 423549a714e5..91cfd8f94a19 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -66,13 +66,6 @@ static void sctp_assoc_bh_rcv(struct work_struct *work); static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc); static void sctp_assoc_free_asconf_queue(struct sctp_association *asoc); -/* Keep track of the new idr low so that we don't re-use association id - * numbers too fast. It is protected by they idr spin lock is in the - * range of 1 - INT_MAX. - */ -static u32 idr_low = 1; - - /* 1st Level Abstractions. */ /* Initialize a new association from provided memory. */ @@ -1597,13 +1590,8 @@ int sctp_assoc_set_id(struct sctp_association *asoc, gfp_t gfp) if (preload) idr_preload(gfp); spin_lock_bh(&sctp_assocs_id_lock); - /* 0 is not a valid id, idr_low is always >= 1 */ - ret = idr_alloc(&sctp_assocs_id, asoc, idr_low, 0, GFP_NOWAIT); - if (ret >= 0) { - idr_low = ret + 1; - if (idr_low == INT_MAX) - idr_low = 1; - } + /* 0 is not a valid assoc_id, must be >= 1 */ + ret = idr_alloc_cyclic(&sctp_assocs_id, asoc, 1, 0, GFP_NOWAIT); spin_unlock_bh(&sctp_assocs_id_lock); if (preload) idr_preload_end(); |