Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:

	drivers/net/wireless/p54/p54common.c
This commit is contained in:
David S. Miller
2008-10-31 00:17:34 -07:00
493 changed files with 6724 additions and 4019 deletions

View File

@ -324,6 +324,38 @@ void unregister_pernet_subsys(struct pernet_operations *module)
}
EXPORT_SYMBOL_GPL(unregister_pernet_subsys);
int register_pernet_gen_subsys(int *id, struct pernet_operations *ops)
{
int rv;
mutex_lock(&net_mutex);
again:
rv = ida_get_new_above(&net_generic_ids, 1, id);
if (rv < 0) {
if (rv == -EAGAIN) {
ida_pre_get(&net_generic_ids, GFP_KERNEL);
goto again;
}
goto out;
}
rv = register_pernet_operations(first_device, ops);
if (rv < 0)
ida_remove(&net_generic_ids, *id);
mutex_unlock(&net_mutex);
out:
return rv;
}
EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);
void unregister_pernet_gen_subsys(int id, struct pernet_operations *ops)
{
mutex_lock(&net_mutex);
unregister_pernet_operations(ops);
ida_remove(&net_generic_ids, id);
mutex_unlock(&net_mutex);
}
EXPORT_SYMBOL_GPL(unregister_pernet_gen_subsys);
/**
* register_pernet_device - register a network namespace device
* @ops: pernet operations structure for the subsystem