Data Structure
1 | 1019 static const struct net_proto_family inet_family_ops = { |
call trace
1 | > inet_create |
1 | 1019 static const struct net_proto_family inet_family_ops = { |
1 | > inet_create |
System call socket will do two things:
struct socket *sock.__sock_create, which alloc a struct socket *sock,creating method of net_families[family].sock to a file descriptor by sock_map_fd.1 | > socket |
Each family has a corresponding array element of struct net_proto_family,
which will be called in system call socket.
1 | 181 struct net_proto_family { |
The create is important, which is first and basic function during
system call socket.
1 | 164 static DEFINE_SPINLOCK(net_family_lock); |
I want to write blog with github page and octopress in the office
and in the home.
The github page has work well done with pc in the home.
Now setup the environment in office to write github page.
The github page repo:
https://github.com/martinbj2008/martinbj2008.github.io
the octopress is pushed to git repo as branch “source”
How to write blog and sync them to github while avoid conflict with home?
On ubuntu 13.04, create the file ~/.config/gtk-3.0/gtk.css with following lines
1 | martin@ubuntu:~$ cat ~/.config/gtk-3.0/gtk.css |
以插入一条新的路由为例。
1 | > fib_insert_node |
trie_rebalance1 | for_each_node(from current node tn to fib_trie root) |
step 1. 循环fib_trie, 直到当前节点为空或者是叶子节点时,停止。
1.a
比较当前节点的key跟待插入的key的前pos位,
如果不相等,循环结束。如果相等执行1.b
(作为改进,加上父节点已经比较了前posx位, 那么只需比较
(posx,pos)这区间的位即可。 注意posx有可能与pos相等。
1.b
记录已经比较的位数(tn->pos + tn->bits)
取当前节点的一个孩子节点,
tkey_extract_bits(key, tn->pos, tn->bits)
继续执行。
step 2. 循环结束,当前节点n有可能为空,也有可能是个叶子节点,或者中间节点(1.a).
1 | if (n == NULL) |