Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183984
b: refs/heads/master
c: b7ceabd
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and David S. Miller committed Feb 10, 2010
1 parent 9068592 commit 40233da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b999748acce739675a5e9420f21e54b8cbad9d81
refs/heads/master: b7ceabd9b528417973619c5b655bc5b21857ac36
20 changes: 3 additions & 17 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,33 +2510,19 @@ static struct notifier_block packet_netdev_notifier = {
};

#ifdef CONFIG_PROC_FS
static inline struct sock *packet_seq_idx(struct net *net, loff_t off)
{
struct sock *s;
struct hlist_node *node;

sk_for_each(s, node, &net->packet.sklist) {
if (!off--)
return s;
}
return NULL;
}

static void *packet_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(seq_file_net(seq)->packet.sklist_lock)
{
struct net *net = seq_file_net(seq);
read_lock(&net->packet.sklist_lock);
return *pos ? packet_seq_idx(net, *pos - 1) : SEQ_START_TOKEN;
return seq_hlist_start_head(&net->packet.sklist, *pos);
}

static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct net *net = seq_file_net(seq);
++*pos;
return (v == SEQ_START_TOKEN)
? sk_head(&net->packet.sklist)
: sk_next((struct sock *)v) ;
return seq_hlist_next(v, &net->packet.sklist, pos);
}

static void packet_seq_stop(struct seq_file *seq, void *v)
Expand All @@ -2551,7 +2537,7 @@ static int packet_seq_show(struct seq_file *seq, void *v)
if (v == SEQ_START_TOKEN)
seq_puts(seq, "sk RefCnt Type Proto Iface R Rmem User Inode\n");
else {
struct sock *s = v;
struct sock *s = sk_entry(v);
const struct packet_sock *po = pkt_sk(s);

seq_printf(seq,
Expand Down

0 comments on commit 40233da

Please sign in to comment.