Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78344
b: refs/heads/master
c: 1ff1cc2
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 6805b58 commit 44c5034
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 107f163428b846d7cef68cb6f436788bb2f6c2e1
refs/heads/master: 1ff1cc202e9a7dbd9f54d1bce5adb44283497185
25 changes: 17 additions & 8 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,25 @@ struct rt_hash_bucket {

static spinlock_t *rt_hash_locks;
# define rt_hash_lock_addr(slot) &rt_hash_locks[(slot) & (RT_HASH_LOCK_SZ - 1)]
# define rt_hash_lock_init() { \
int i; \
rt_hash_locks = kmalloc(sizeof(spinlock_t) * RT_HASH_LOCK_SZ, GFP_KERNEL); \
if (!rt_hash_locks) panic("IP: failed to allocate rt_hash_locks\n"); \
for (i = 0; i < RT_HASH_LOCK_SZ; i++) \
spin_lock_init(&rt_hash_locks[i]); \
}

static __init void rt_hash_lock_init(void)
{
int i;

rt_hash_locks = kmalloc(sizeof(spinlock_t) * RT_HASH_LOCK_SZ,
GFP_KERNEL);
if (!rt_hash_locks)
panic("IP: failed to allocate rt_hash_locks\n");

for (i = 0; i < RT_HASH_LOCK_SZ; i++)
spin_lock_init(&rt_hash_locks[i]);
}
#else
# define rt_hash_lock_addr(slot) NULL
# define rt_hash_lock_init()

static inline void rt_hash_lock_init(void)
{
}
#endif

static struct rt_hash_bucket *rt_hash_table;
Expand Down

0 comments on commit 44c5034

Please sign in to comment.