aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 13:36:06 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:56 -0400
commit1218854afa6f659be90b748cf1bc7badee954a35 (patch)
tree78b83e3941fa7e5a03c04e2e4f6ddb1a08ea38a0 /net/unix
parent3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (diff)
[NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.
Without CONFIG_NET_NS, no namespace other than &init_net exists, no need to store net in seq_net_private. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index cb9d0cb5f270..4a4793051bcb 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2016,13 +2016,14 @@ struct unix_iter_state {
2016 struct seq_net_private p; 2016 struct seq_net_private p;
2017 int i; 2017 int i;
2018}; 2018};
2019static struct sock *unix_seq_idx(struct unix_iter_state *iter, loff_t pos) 2019static struct sock *unix_seq_idx(struct seq_file *seq, loff_t pos)
2020{ 2020{
2021 struct unix_iter_state *iter = seq->private;
2021 loff_t off = 0; 2022 loff_t off = 0;
2022 struct sock *s; 2023 struct sock *s;
2023 2024
2024 for (s = first_unix_socket(&iter->i); s; s = next_unix_socket(&iter->i, s)) { 2025 for (s = first_unix_socket(&iter->i); s; s = next_unix_socket(&iter->i, s)) {
2025 if (sock_net(s) != iter->p.net) 2026 if (sock_net(s) != seq_file_net(seq))
2026 continue; 2027 continue;
2027 if (off == pos) 2028 if (off == pos)
2028 return s; 2029 return s;
@@ -2035,9 +2036,8 @@ static struct sock *unix_seq_idx(struct unix_iter_state *iter, loff_t pos)
2035static void *unix_seq_start(struct seq_file *seq, loff_t *pos) 2036static void *unix_seq_start(struct seq_file *seq, loff_t *pos)
2036 __acquires(unix_table_lock) 2037 __acquires(unix_table_lock)
2037{ 2038{
2038 struct unix_iter_state *iter = seq->private;
2039 spin_lock(&unix_table_lock); 2039 spin_lock(&unix_table_lock);
2040 return *pos ? unix_seq_idx(iter, *pos - 1) : ((void *) 1); 2040 return *pos ? unix_seq_idx(seq, *pos - 1) : ((void *) 1);
2041} 2041}
2042 2042
2043static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos) 2043static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
@@ -2050,7 +2050,7 @@ static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2050 sk = first_unix_socket(&iter->i); 2050 sk = first_unix_socket(&iter->i);
2051 else 2051 else
2052 sk = next_unix_socket(&iter->i, sk); 2052 sk = next_unix_socket(&iter->i, sk);
2053 while (sk && (sock_net(sk) != iter->p.net)) 2053 while (sk && (sock_net(sk) != seq_file_net(seq)))
2054 sk = next_unix_socket(&iter->i, sk); 2054 sk = next_unix_socket(&iter->i, sk);
2055 return sk; 2055 return sk;
2056} 2056}