Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295456
b: refs/heads/master
c: 8425d6a
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Jan 25, 2012
1 parent 425aeb6 commit dcb92b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: e0d045290a8454ecd7f63c78c10d412f35d6ef94
refs/heads/master: 8425d6aaf0704b98480131ed339c208ffce12e44
16 changes: 13 additions & 3 deletions trunk/fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ static void init_header(struct ctl_table_header *head,
head->parent = NULL;
}

static void erase_header(struct ctl_table_header *head)
{
list_del_init(&head->ctl_entry);
}

static void insert_header(struct ctl_table_header *header)
{
header->parent->count++;
list_add_tail(&header->ctl_entry, &header->set->list);
}

/* called under sysctl_lock */
static int use_table(struct ctl_table_header *p)
{
Expand Down Expand Up @@ -96,7 +107,7 @@ static void start_unregistering(struct ctl_table_header *p)
* do not remove from the list until nobody holds it; walking the
* list in do_sysctl() relies on that.
*/
list_del_init(&p->ctl_entry);
erase_header(p);
}

static void sysctl_head_get(struct ctl_table_header *head)
Expand Down Expand Up @@ -974,8 +985,7 @@ struct ctl_table_header *__register_sysctl_table(
}
if (sysctl_check_dups(namespaces, header, path, table))
goto fail_locked;
header->parent->count++;
list_add_tail(&header->ctl_entry, &header->set->list);
insert_header(header);
spin_unlock(&sysctl_lock);

return header;
Expand Down

0 comments on commit dcb92b0

Please sign in to comment.