Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168949
b: refs/heads/master
c: 7378396
h: refs/heads/master
i:
  168947: fe75f4b
v: v3
  • Loading branch information
Wu Fengguang authored and Patrick McHardy committed Nov 13, 2009
1 parent 039dfdc commit 6c13f26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 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: 1c622ae67bfc729891f5cd80795b15b87e6ac471
refs/heads/master: 7378396cd172cc058fa62220c6486419046c4e0c
18 changes: 5 additions & 13 deletions trunk/net/netfilter/nf_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ EXPORT_SYMBOL(nf_log_packet);

#ifdef CONFIG_PROC_FS
static void *seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
{
rcu_read_lock();
mutex_lock(&nf_log_mutex);

if (*pos >= ARRAY_SIZE(nf_loggers))
return NULL;
Expand All @@ -149,9 +148,8 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
}

static void seq_stop(struct seq_file *s, void *v)
__releases(RCU)
{
rcu_read_unlock();
mutex_unlock(&nf_log_mutex);
}

static int seq_show(struct seq_file *s, void *v)
Expand All @@ -161,7 +159,7 @@ static int seq_show(struct seq_file *s, void *v)
struct nf_logger *t;
int ret;

logger = rcu_dereference(nf_loggers[*pos]);
logger = nf_loggers[*pos];

if (!logger)
ret = seq_printf(s, "%2lld NONE (", *pos);
Expand All @@ -171,22 +169,16 @@ static int seq_show(struct seq_file *s, void *v)
if (ret < 0)
return ret;

mutex_lock(&nf_log_mutex);
list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) {
ret = seq_printf(s, "%s", t->name);
if (ret < 0) {
mutex_unlock(&nf_log_mutex);
if (ret < 0)
return ret;
}
if (&t->list[*pos] != nf_loggers_l[*pos].prev) {
ret = seq_printf(s, ",");
if (ret < 0) {
mutex_unlock(&nf_log_mutex);
if (ret < 0)
return ret;
}
}
}
mutex_unlock(&nf_log_mutex);

return seq_printf(s, ")\n");
}
Expand Down

0 comments on commit 6c13f26

Please sign in to comment.