diff options
Diffstat (limited to 'kernel/acct.c')
-rw-r--r-- | kernel/acct.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index dc12db8600e7..70d0d88e5554 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -118,7 +118,7 @@ static int check_free_space(struct file *file) | |||
118 | spin_unlock(&acct_globals.lock); | 118 | spin_unlock(&acct_globals.lock); |
119 | 119 | ||
120 | /* May block */ | 120 | /* May block */ |
121 | if (vfs_statfs(file->f_dentry, &sbuf)) | 121 | if (vfs_statfs(file->f_path.dentry, &sbuf)) |
122 | return res; | 122 | return res; |
123 | suspend = sbuf.f_blocks * SUSPEND; | 123 | suspend = sbuf.f_blocks * SUSPEND; |
124 | resume = sbuf.f_blocks * RESUME; | 124 | resume = sbuf.f_blocks * RESUME; |
@@ -194,7 +194,7 @@ static void acct_file_reopen(struct file *file) | |||
194 | add_timer(&acct_globals.timer); | 194 | add_timer(&acct_globals.timer); |
195 | } | 195 | } |
196 | if (old_acct) { | 196 | if (old_acct) { |
197 | mnt_unpin(old_acct->f_vfsmnt); | 197 | mnt_unpin(old_acct->f_path.mnt); |
198 | spin_unlock(&acct_globals.lock); | 198 | spin_unlock(&acct_globals.lock); |
199 | do_acct_process(old_acct); | 199 | do_acct_process(old_acct); |
200 | filp_close(old_acct, NULL); | 200 | filp_close(old_acct, NULL); |
@@ -212,7 +212,7 @@ static int acct_on(char *name) | |||
212 | if (IS_ERR(file)) | 212 | if (IS_ERR(file)) |
213 | return PTR_ERR(file); | 213 | return PTR_ERR(file); |
214 | 214 | ||
215 | if (!S_ISREG(file->f_dentry->d_inode->i_mode)) { | 215 | if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) { |
216 | filp_close(file, NULL); | 216 | filp_close(file, NULL); |
217 | return -EACCES; | 217 | return -EACCES; |
218 | } | 218 | } |
@@ -229,11 +229,11 @@ static int acct_on(char *name) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | spin_lock(&acct_globals.lock); | 231 | spin_lock(&acct_globals.lock); |
232 | mnt_pin(file->f_vfsmnt); | 232 | mnt_pin(file->f_path.mnt); |
233 | acct_file_reopen(file); | 233 | acct_file_reopen(file); |
234 | spin_unlock(&acct_globals.lock); | 234 | spin_unlock(&acct_globals.lock); |
235 | 235 | ||
236 | mntput(file->f_vfsmnt); /* it's pinned, now give up active reference */ | 236 | mntput(file->f_path.mnt); /* it's pinned, now give up active reference */ |
237 | 237 | ||
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
@@ -283,7 +283,7 @@ asmlinkage long sys_acct(const char __user *name) | |||
283 | void acct_auto_close_mnt(struct vfsmount *m) | 283 | void acct_auto_close_mnt(struct vfsmount *m) |
284 | { | 284 | { |
285 | spin_lock(&acct_globals.lock); | 285 | spin_lock(&acct_globals.lock); |
286 | if (acct_globals.file && acct_globals.file->f_vfsmnt == m) | 286 | if (acct_globals.file && acct_globals.file->f_path.mnt == m) |
287 | acct_file_reopen(NULL); | 287 | acct_file_reopen(NULL); |
288 | spin_unlock(&acct_globals.lock); | 288 | spin_unlock(&acct_globals.lock); |
289 | } | 289 | } |
@@ -299,7 +299,7 @@ void acct_auto_close(struct super_block *sb) | |||
299 | { | 299 | { |
300 | spin_lock(&acct_globals.lock); | 300 | spin_lock(&acct_globals.lock); |
301 | if (acct_globals.file && | 301 | if (acct_globals.file && |
302 | acct_globals.file->f_vfsmnt->mnt_sb == sb) { | 302 | acct_globals.file->f_path.mnt->mnt_sb == sb) { |
303 | acct_file_reopen(NULL); | 303 | acct_file_reopen(NULL); |
304 | } | 304 | } |
305 | spin_unlock(&acct_globals.lock); | 305 | spin_unlock(&acct_globals.lock); |
@@ -428,6 +428,7 @@ static void do_acct_process(struct file *file) | |||
428 | u64 elapsed; | 428 | u64 elapsed; |
429 | u64 run_time; | 429 | u64 run_time; |
430 | struct timespec uptime; | 430 | struct timespec uptime; |
431 | struct tty_struct *tty; | ||
431 | 432 | ||
432 | /* | 433 | /* |
433 | * First check to see if there is enough free_space to continue | 434 | * First check to see if there is enough free_space to continue |
@@ -484,16 +485,9 @@ static void do_acct_process(struct file *file) | |||
484 | ac.ac_ppid = current->parent->tgid; | 485 | ac.ac_ppid = current->parent->tgid; |
485 | #endif | 486 | #endif |
486 | 487 | ||
487 | mutex_lock(&tty_mutex); | ||
488 | /* FIXME: Whoever is responsible for current->signal locking needs | ||
489 | to use the same locking all over the kernel and document it */ | ||
490 | read_lock(&tasklist_lock); | ||
491 | ac.ac_tty = current->signal->tty ? | ||
492 | old_encode_dev(tty_devnum(current->signal->tty)) : 0; | ||
493 | read_unlock(&tasklist_lock); | ||
494 | mutex_unlock(&tty_mutex); | ||
495 | |||
496 | spin_lock_irq(¤t->sighand->siglock); | 488 | spin_lock_irq(¤t->sighand->siglock); |
489 | tty = current->signal->tty; | ||
490 | ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0; | ||
497 | ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime))); | 491 | ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime))); |
498 | ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime))); | 492 | ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime))); |
499 | ac.ac_flag = pacct->ac_flag; | 493 | ac.ac_flag = pacct->ac_flag; |