Skip to content

Commit

Permalink
bsdacct: fix and add comments around acct_process()
Browse files Browse the repository at this point in the history
Fix the one describing what this function is and add one more - about
locking absence around pid namespaces loop.

Signed-off-by: Pavel Emelyanov <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
xemul authored and torvalds committed Jul 25, 2008
1 parent 7d1e135 commit 0c18d7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kernel/acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,20 @@ static void acct_process_in_ns(struct pid_namespace *ns)
}

/**
* acct_process - now just a wrapper around do_acct_process
* acct_process - now just a wrapper around acct_process_in_ns,
* which in turn is a wrapper around do_acct_process.
*
* handles process accounting for an exiting task
*/
void acct_process(void)
{
struct pid_namespace *ns;

/*
* This loop is safe lockless, since current is still
* alive and holds its namespace, which in turn holds
* its parent.
*/
for (ns = task_active_pid_ns(current); ns != NULL; ns = ns->parent)
acct_process_in_ns(ns);
}

0 comments on commit 0c18d7a

Please sign in to comment.