提交 e59a04a7 编写于 作者: P Pavel Emelyanov 提交者: Linus Torvalds

bsdacct: make check timer accept a bsd_acct_struct argument

We're going to have many bsd_acct_struct instances, not just one, so the
timer (currently working with a global one) has to know which one to work
with.

Use a handy setup_timer macro for it (thanks to Oleg for one).
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1c552858
...@@ -97,9 +97,10 @@ static struct bsd_acct_struct acct_globals __cacheline_aligned = ...@@ -97,9 +97,10 @@ static struct bsd_acct_struct acct_globals __cacheline_aligned =
/* /*
* Called whenever the timer says to check the free space. * Called whenever the timer says to check the free space.
*/ */
static void acct_timeout(unsigned long unused) static void acct_timeout(unsigned long x)
{ {
acct_globals.needcheck = 1; struct bsd_acct_struct *acct = (struct bsd_acct_struct *)x;
acct->needcheck = 1;
} }
/* /*
...@@ -193,8 +194,8 @@ static void acct_file_reopen(struct file *file) ...@@ -193,8 +194,8 @@ static void acct_file_reopen(struct file *file)
acct_globals.needcheck = 0; acct_globals.needcheck = 0;
acct_globals.active = 1; acct_globals.active = 1;
/* It's been deleted if it was used before so this is safe */ /* It's been deleted if it was used before so this is safe */
init_timer(&acct_globals.timer); setup_timer(&acct_globals.timer, acct_timeout,
acct_globals.timer.function = acct_timeout; (unsigned long)&acct_globals);
acct_globals.timer.expires = jiffies + ACCT_TIMEOUT*HZ; acct_globals.timer.expires = jiffies + ACCT_TIMEOUT*HZ;
add_timer(&acct_globals.timer); add_timer(&acct_globals.timer);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册