mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
genetlink: Optimize genl_register_family()
genl_register_family() doesn't need to call genl_family_find_byid when GENL_ID_GENERATE is passed during register. Patch on net-next-2.6, compile and reboot testing only. Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0d9a40de60
commit
93860b08e3
1 changed files with 3 additions and 5 deletions
|
@ -374,11 +374,6 @@ int genl_register_family(struct genl_family *family)
|
|||
goto errout_locked;
|
||||
}
|
||||
|
||||
if (genl_family_find_byid(family->id)) {
|
||||
err = -EEXIST;
|
||||
goto errout_locked;
|
||||
}
|
||||
|
||||
if (family->id == GENL_ID_GENERATE) {
|
||||
u16 newid = genl_generate_id();
|
||||
|
||||
|
@ -388,6 +383,9 @@ int genl_register_family(struct genl_family *family)
|
|||
}
|
||||
|
||||
family->id = newid;
|
||||
} else if (genl_family_find_byid(family->id)) {
|
||||
err = -EEXIST;
|
||||
goto errout_locked;
|
||||
}
|
||||
|
||||
if (family->maxattr) {
|
||||
|
|
Loading…
Reference in a new issue