Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2013-02-27 | hlist: drop the node parameter from iterators | Sasha Levin | 1 | -5/+2 | |
I'm not sure why, but the hlist for each entry iterators were conceived list_for_each_entry(pos, head, member) The hlist ones were greedy and wanted an extra parameter: hlist_for_each_entry(tpos, pos, head, member) Why did they need an extra pos parameter? I'm not quite sure. Not only they don't really need it, it also prevents the iterator from looking exactly like the list iterator, which is unfortunate. Besides the semantic patch, there was some manual work required: - Fix up the actual hlist iterators in linux/list.h - Fix up the declaration of other iterators based on the hlist ones. - A very small amount of places were using the 'node' parameter, this was modified to use 'obj->member' instead. - Coccinelle didn't handle the hlist_for_each_entry_safe iterator properly, so those had to be fixed up manually. The semantic patch which is mostly the work of Peter Senna Tschudin is here: @@ iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host; type T; expression a,c,d,e; identifier b; statement S; @@ -T b; <+... when != b ( hlist_for_each_entry(a, - b, c, d) S | hlist_for_each_entry_continue(a, - b, c) S | hlist_for_each_entry_from(a, - b, c) S | hlist_for_each_entry_rcu(a, - b, c, d) S | hlist_for_each_entry_rcu_bh(a, - b, c, d) S | hlist_for_each_entry_continue_rcu_bh(a, - b, c) S | for_each_busy_worker(a, c, - b, d) S | ax25_uid_for_each(a, - b, c) S | ax25_for_each(a, - b, c) S | inet_bind_bucket_for_each(a, - b, c) S | sctp_for_each_hentry(a, - b, c) S | sk_for_each(a, - b, c) S | sk_for_each_rcu(a, - b, c) S | sk_for_each_from -(a, b) +(a) S + sk_for_each_from(a) S | sk_for_each_safe(a, - b, c, d) S | sk_for_each_bound(a, - b, c) S | hlist_for_each_entry_safe(a, - b, c, d, e) S | hlist_for_each_entry_continue_rcu(a, - b, c) S | nr_neigh_for_each(a, - b, c) S | nr_neigh_for_each_safe(a, - b, c, d) S | nr_node_for_each(a, - b, c) S | nr_node_for_each_safe(a, - b, c, d) S | - for_each_gfn_sp(a, c, d, b) S + for_each_gfn_sp(a, c, d) S | - for_each_gfn_indirect_valid_sp(a, c, d, b) S + for_each_gfn_indirect_valid_sp(a, c, d) S | for_each_host(a, - b, c) S | for_each_host_safe(a, - b, c, d) S | for_each_mesh_entry(a, - b, c, d) S ) ...+> [[email protected]: drop bogus change from net/ipv4/raw.c] [[email protected]: drop bogus hunk from net/ipv6/raw.c] [[email protected]: checkpatch fixes] [[email protected]: fix warnings] [[email protected]: redo intrusive kvm changes] Tested-by: Peter Senna Tschudin <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> | |||||
2012-10-23 | sock-diag: Report shutdown for inet and unix sockets (v2) | Pavel Emelyanov | 1 | -0/+3 | |
Make it simple -- just put new nlattr with just sk->sk_shutdown bits. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-09-10 | netlink: Rename pid to portid to avoid confusion | Eric W. Biederman | 1 | -7/+7 | |
It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-07-16 | net: make sock diag per-namespace | Andrey Vagin | 1 | -2/+7 | |
Before this patch sock_diag works for init_net only and dumps information about sockets from all namespaces. This patch expands sock_diag for all name-spaces. It creates a netlink kernel socket for each netns and filters data during dumping. v2: filter accoding with netns in all places remove an unused variable. Cc: "David S. Miller" <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: James Morris <[email protected]> Cc: Hideaki YOSHIFUJI <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: Pavel Emelyanov <[email protected]> CC: Eric Dumazet <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Andrew Vagin <[email protected]> Acked-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-06-27 | unix_diag: Do not use RTA_PUT() macros | Thomas Graf | 1 | -47/+33 | |
Also, no need to trim on nlmsg_put() failure, nothing has been added yet. We also want to use nlmsg_end(), nlmsg_new() and nlmsg_free(). Signed-off-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-06-26 | unix_diag: Move away from NLMSG_PUT(). | David S. Miller | 1 | -11/+13 | |
And use nlmsg_data() while we're here too and remove useless casts. Signed-off-by: David S. Miller <[email protected]> | |||||
2012-06-08 | af_unix: speedup /proc/net/unix | Eric Dumazet | 1 | -2/+4 | |
/proc/net/unix has quadratic behavior, and can hold unix_table_lock for a while if high number of unix sockets are alive. (90 ms for 200k sockets...) We already have a hash table, so its quite easy to use it. Problem is unbound sockets are still hashed in a single hash slot (unix_socket_table[UNIX_HASH_TABLE]) This patch also spreads unbound sockets to 256 hash slots, to speedup both /proc/net/unix and unix_diag. Time to read /proc/net/unix with 200k unix sockets : (time dd if=/proc/net/unix of=/dev/null bs=4k) before : 520 secs after : 2 secs Signed-off-by: Eric Dumazet <[email protected]> Cc: Steven Whitehouse <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-04-25 | net: sock_diag_handler structs can be const | Shan Wei | 1 | -1/+1 | |
read only, so change it to const. Signed-off-by: Shan Wei <[email protected]> Acked-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2012-03-21 | Merge branch 'for-linus' of ↵ | Linus Torvalds | 1 | -1/+1 | |
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile 1 from Al Viro: "This is _not_ all; in particular, Miklos' and Jan's stuff is not there yet." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits) ext4: initialization of ext4_li_mtx needs to be done earlier debugfs-related mode_t whack-a-mole hfsplus: add an ioctl to bless files hfsplus: change finder_info to u32 hfsplus: initialise userflags qnx4: new helper - try_extent() qnx4: get rid of qnx4_bread/qnx4_getblk take removal of PF_FORKNOEXEC to flush_old_exec() trim includes in inode.c um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it um: embed ->stub_pages[] into mmu_context gadgetfs: list_for_each_safe() misuse ocfs2: fix leaks on failure exits in module_init ecryptfs: make register_filesystem() the last potential failure exit ntfs: forgets to unregister sysctls on register_filesystem() failure logfs: missing cleanup on register_filesystem() failure jfs: mising cleanup on register_filesystem() failure make configfs_pin_fs() return root dentry on success configfs: configfs_create_dir() has parent dentry in dentry->d_parent configfs: sanitize configfs_create() ... | |||||
2012-03-20 | switch unix_sock to struct path | Al Viro | 1 | -1/+1 | |
Signed-off-by: Al Viro <[email protected]> | |||||
2012-02-26 | netlink: add netlink_dump_control structure for netlink_dump_start() | Pablo Neira Ayuso | 1 | -4/+6 | |
Davem considers that the argument list of this interface is getting out of control. This patch tries to address this issue following his proposal: struct netlink_dump_control c = { .dump = dump, .done = done, ... }; netlink_dump_start(..., &c); Suggested by David S. Miller. Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-30 | unix_diag: Fixup RQLEN extension report | Pavel Emelyanov | 1 | -1/+12 | |
While it's not too late fix the recently added RQLEN diag extension to report rqlen and wqlen in the same way as TCP does. I.e. for listening sockets the ack backlog length (which is the input queue length for socket) in rqlen and the max ack backlog length in wqlen, and what the CINQ/OUTQ ioctls do for established. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-30 | unix_diag: Add the MEMINFO extension | Pavel Emelyanov | 1 | -8/+12 | |
[ Fix indentation of sock_diag*() calls. -DaveM ] Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-26 | unix: If we happen to find peer NULL when diag dumping, write zero. | David S. Miller | 1 | -2/+1 | |
Otherwise we leave uninitialized kernel memory in there. Reported-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-26 | unix_diag: Fix incoming connections nla length | Pavel Emelyanov | 1 | -1/+2 | |
The NLA_PUT macro should accept the actual attribute length, not the amount of elements in array :( Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-20 | net: unix -- Add missing module.h inclusion | Cyrill Gorcunov | 1 | -0/+1 | |
Otherwise getting | net/unix/diag.c:312:16: error: expected declaration specifiers or ‘...’ before string constant | net/unix/diag.c:313:1: error: expected declaration specifiers or ‘...’ before string constant Signed-off-by: Cyrill Gorcunov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Receive queue lenght NLA | Pavel Emelyanov | 1 | -0/+13 | |
Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Pending connections IDs NLA | Pavel Emelyanov | 1 | -0/+39 | |
When establishing a unix connection on stream sockets the server end receives an skb with socket in its receive queue. Report who is waiting for these ends to be accepted for listening sockets via NLA. There's a lokcing issue with this -- the unix sk state lock is required to access the peer, and it is taken under the listening sk's queue lock. Strictly speaking the queue lock should be taken inside the state lock, but since in this case these two sockets are different it shouldn't lead to deadlock. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Unix peer inode NLA | Pavel Emelyanov | 1 | -0/+24 | |
Report the peer socket inode ID as NLA. With this it's finally possible to find out the other end of an interesting unix connection. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Unix inode info NLA | Pavel Emelyanov | 1 | -0/+21 | |
Actually, the socket path if it's not anonymous doesn't give a clue to which file the socket is bound to. Even if the path is absolute, it can be unlinked and then new socket can be bound to it. With this NLA it's possible to check which file a particular socket is really bound to. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Unix socket name NLA | Pavel Emelyanov | 1 | -0/+20 | |
Report the sun_path when requested as NLA. With leading '\0' if present but without the leading AF_UNIX bits. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Dumping exact socket core | Pavel Emelyanov | 1 | -1/+66 | |
The socket inode is used as a key for lookup. This is effectively the only really unique ID of a unix socket, but using this for search currently has one problem -- it is O(number of sockets) :( Does it worth fixing this lookup or inventing some other ID for unix sockets? Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Dumping all sockets core | Pavel Emelyanov | 1 | -1/+75 | |
Walk the unix sockets table and fill the core response structure, which includes type, state and inode. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> | |||||
2011-12-16 | unix_diag: Basic module skeleton | Pavel Emelyanov | 1 | -0/+57 | |
Includes basic module_init/_exit functionality, dump/get_exact stubs and declares the basic API structures for request and response. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]> |