aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-25 04:48:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:46 -0400
commite59a04a7aa5ce2483470aee4f2eb79ba6b9afe8b (patch)
tree0cd0b592198740572b3b75c23a91d17a7f8d730b /kernel
parent1c552858ac2b1732a99d234d46b98098baef41ff (diff)
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 <xemul@openvz.org> Cc: Balbir Singh <balbir@in.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index d9ee1838b4d..05f8bc094a4 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -97,9 +97,10 @@ static struct bsd_acct_struct acct_globals __cacheline_aligned =
97/* 97/*
98 * Called whenever the timer says to check the free space. 98 * Called whenever the timer says to check the free space.
99 */ 99 */
100static void acct_timeout(unsigned long unused) 100static void acct_timeout(unsigned long x)
101{ 101{
102 acct_globals.needcheck = 1; 102 struct bsd_acct_struct *acct = (struct bsd_acct_struct *)x;
103 acct->needcheck = 1;
103} 104}
104 105
105/* 106/*
@@ -193,8 +194,8 @@ static void acct_file_reopen(struct file *file)
193 acct_globals.needcheck = 0; 194 acct_globals.needcheck = 0;
194 acct_globals.active = 1; 195 acct_globals.active = 1;
195 /* It's been deleted if it was used before so this is safe */ 196 /* It's been deleted if it was used before so this is safe */
196 init_timer(&acct_globals.timer); 197 setup_timer(&acct_globals.timer, acct_timeout,
197 acct_globals.timer.function = acct_timeout; 198 (unsigned long)&acct_globals);
198 acct_globals.timer.expires = jiffies + ACCT_TIMEOUT*HZ; 199 acct_globals.timer.expires = jiffies + ACCT_TIMEOUT*HZ;
199 add_timer(&acct_globals.timer); 200 add_timer(&acct_globals.timer);
200 } 201 }