From: Pavel Emelyanov Date: Fri, 25 Jul 2008 08:48:44 +0000 (-0700) Subject: bsdacct: make check timer accept a bsd_acct_struct argument X-Git-Tag: v2.6.27-rc1~260 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e59a04a7aa5ce2483470aee4f2eb79ba6b9afe8b;p=linux-2.6 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: Pavel Emelyanov Cc: Balbir Singh Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/acct.c b/kernel/acct.c index d9ee1838b4..05f8bc094a 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -97,9 +97,10 @@ static struct bsd_acct_struct acct_globals __cacheline_aligned = /* * 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) acct_globals.needcheck = 0; acct_globals.active = 1; /* It's been deleted if it was used before so this is safe */ - init_timer(&acct_globals.timer); - acct_globals.timer.function = acct_timeout; + setup_timer(&acct_globals.timer, acct_timeout, + (unsigned long)&acct_globals); acct_globals.timer.expires = jiffies + ACCT_TIMEOUT*HZ; add_timer(&acct_globals.timer); }