Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183982
b: refs/heads/master
c: 32d2e3a
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and David S. Miller committed Feb 10, 2010
1 parent 2168e5e commit ca6ff3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 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: c4146644a56b1f213c4c5567c75771883bec33c7
refs/heads/master: 32d2e3a149772441a6a146ad96cbae319e27742a
30 changes: 3 additions & 27 deletions trunk/net/x25/x25_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,40 +93,16 @@ static int x25_seq_route_show(struct seq_file *seq, void *v)
return 0;
}

static __inline__ struct sock *x25_get_socket_idx(loff_t pos)
{
struct sock *s;
struct hlist_node *node;

sk_for_each(s, node, &x25_list)
if (!pos--)
goto found;
s = NULL;
found:
return s;
}

static void *x25_seq_socket_start(struct seq_file *seq, loff_t *pos)
__acquires(x25_list_lock)
{
loff_t l = *pos;

read_lock_bh(&x25_list_lock);
return l ? x25_get_socket_idx(--l) : SEQ_START_TOKEN;
return seq_hlist_start_head(&x25_list, *pos);
}

static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *s;

++*pos;
if (v == SEQ_START_TOKEN) {
s = sk_head(&x25_list);
goto out;
}
s = sk_next(v);
out:
return s;
return seq_hlist_next(v, &x25_list, pos);
}

static void x25_seq_socket_stop(struct seq_file *seq, void *v)
Expand All @@ -148,7 +124,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v)
goto out;
}

s = v;
s = sk_entry(v);
x25 = x25_sk(s);

if (!x25->neighbour || (dev = x25->neighbour->dev) == NULL)
Expand Down

0 comments on commit ca6ff3d

Please sign in to comment.