提交 93860b08 编写于 作者: K Krishna Kumar 提交者: David S. Miller

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: NKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0d9a40de
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册