Lines Matching refs:acct
95 static void do_acct_process(struct bsd_acct_struct *acct);
100 static int check_free_space(struct bsd_acct_struct *acct) in check_free_space() argument
104 if (time_is_after_jiffies(acct->needcheck)) in check_free_space()
108 if (vfs_statfs(&acct->file->f_path, &sbuf)) in check_free_space()
111 if (acct->active) { in check_free_space()
115 acct->active = 0; in check_free_space()
122 acct->active = 1; in check_free_space()
127 acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; in check_free_space()
129 return acct->active; in check_free_space()
171 struct bsd_acct_struct *acct = to_acct(pin); in acct_pin_kill() local
172 mutex_lock(&acct->lock); in acct_pin_kill()
173 do_acct_process(acct); in acct_pin_kill()
174 schedule_work(&acct->work); in acct_pin_kill()
175 wait_for_completion(&acct->done); in acct_pin_kill()
176 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill()
177 mutex_unlock(&acct->lock); in acct_pin_kill()
179 acct_put(acct); in acct_pin_kill()
184 struct bsd_acct_struct *acct = container_of(work, struct bsd_acct_struct, work); in close_work() local
185 struct file *file = acct->file; in close_work()
189 complete(&acct->done); in close_work()
197 struct bsd_acct_struct *acct; in acct_on() local
201 acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL); in acct_on()
202 if (!acct) in acct_on()
208 kfree(acct); in acct_on()
213 kfree(acct); in acct_on()
219 kfree(acct); in acct_on()
225 kfree(acct); in acct_on()
232 kfree(acct); in acct_on()
239 atomic_long_set(&acct->count, 1); in acct_on()
240 init_fs_pin(&acct->pin, acct_pin_kill); in acct_on()
241 acct->file = file; in acct_on()
242 acct->needcheck = jiffies; in acct_on()
243 acct->ns = ns; in acct_on()
244 mutex_init(&acct->lock); in acct_on()
245 INIT_WORK(&acct->work, close_work); in acct_on()
246 init_completion(&acct->done); in acct_on()
247 mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */ in acct_on()
248 pin_insert(&acct->pin, mnt); in acct_on()
251 old = xchg(&ns->bacct, &acct->pin); in acct_on()
252 mutex_unlock(&acct->lock); in acct_on()
272 SYSCALL_DEFINE1(acct, const char __user *, name) in SYSCALL_DEFINE1() argument
470 static void do_acct_process(struct bsd_acct_struct *acct) in do_acct_process() argument
475 struct file *file = acct->file; in do_acct_process()
489 if (!check_free_space(acct)) in do_acct_process()
502 struct pid_namespace *ns = acct->ns; in do_acct_process()
575 struct bsd_acct_struct *acct = acct_get(ns); in slow_acct_process() local
576 if (acct) { in slow_acct_process()
577 do_acct_process(acct); in slow_acct_process()
578 mutex_unlock(&acct->lock); in slow_acct_process()
579 acct_put(acct); in slow_acct_process()