Lines Matching refs:acct
96 static void do_acct_process(struct bsd_acct_struct *acct);
101 static int check_free_space(struct bsd_acct_struct *acct) in check_free_space() argument
105 if (time_is_after_jiffies(acct->needcheck)) in check_free_space()
109 if (vfs_statfs(&acct->file->f_path, &sbuf)) in check_free_space()
112 if (acct->active) { in check_free_space()
116 acct->active = 0; in check_free_space()
123 acct->active = 1; in check_free_space()
128 acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; in check_free_space()
130 return acct->active; in check_free_space()
172 struct bsd_acct_struct *acct = to_acct(pin); in acct_pin_kill() local
173 mutex_lock(&acct->lock); in acct_pin_kill()
174 do_acct_process(acct); in acct_pin_kill()
175 schedule_work(&acct->work); in acct_pin_kill()
176 wait_for_completion(&acct->done); in acct_pin_kill()
177 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill()
178 mutex_unlock(&acct->lock); in acct_pin_kill()
180 acct_put(acct); in acct_pin_kill()
185 struct bsd_acct_struct *acct = container_of(work, struct bsd_acct_struct, work); in close_work() local
186 struct file *file = acct->file; in close_work()
190 complete(&acct->done); in close_work()
198 struct bsd_acct_struct *acct; in acct_on() local
202 acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL); in acct_on()
203 if (!acct) in acct_on()
209 kfree(acct); in acct_on()
214 kfree(acct); in acct_on()
220 kfree(acct); in acct_on()
226 kfree(acct); in acct_on()
233 kfree(acct); in acct_on()
240 atomic_long_set(&acct->count, 1); in acct_on()
241 init_fs_pin(&acct->pin, acct_pin_kill); in acct_on()
242 acct->file = file; in acct_on()
243 acct->needcheck = jiffies; in acct_on()
244 acct->ns = ns; in acct_on()
245 mutex_init(&acct->lock); in acct_on()
246 INIT_WORK(&acct->work, close_work); in acct_on()
247 init_completion(&acct->done); in acct_on()
248 mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */ in acct_on()
249 pin_insert(&acct->pin, mnt); in acct_on()
252 old = xchg(&ns->bacct, &acct->pin); in acct_on()
253 mutex_unlock(&acct->lock); in acct_on()
273 SYSCALL_DEFINE1(acct, const char __user *, name) in SYSCALL_DEFINE1() argument
471 static void do_acct_process(struct bsd_acct_struct *acct) in do_acct_process() argument
476 struct file *file = acct->file; in do_acct_process()
490 if (!check_free_space(acct)) in do_acct_process()
504 struct pid_namespace *ns = acct->ns; in do_acct_process()
577 struct bsd_acct_struct *acct = acct_get(ns); in slow_acct_process() local
578 if (acct) { in slow_acct_process()
579 do_acct_process(acct); in slow_acct_process()
580 mutex_unlock(&acct->lock); in slow_acct_process()
581 acct_put(acct); in slow_acct_process()