Lines Matching refs:acct
115 static void do_acct_process(struct bsd_acct_struct *acct);
120 static int check_free_space(struct bsd_acct_struct *acct) in check_free_space() argument
124 if (time_is_after_jiffies(acct->needcheck)) in check_free_space()
128 if (vfs_statfs(&acct->file->f_path, &sbuf)) in check_free_space()
131 if (acct->active) { in check_free_space()
135 acct->active = 0; in check_free_space()
142 acct->active = 1; in check_free_space()
147 acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; in check_free_space()
149 return acct->active; in check_free_space()
191 struct bsd_acct_struct *acct = to_acct(pin); in acct_pin_kill() local
192 mutex_lock(&acct->lock); in acct_pin_kill()
193 do_acct_process(acct); in acct_pin_kill()
194 schedule_work(&acct->work); in acct_pin_kill()
195 wait_for_completion(&acct->done); in acct_pin_kill()
196 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill()
197 mutex_unlock(&acct->lock); in acct_pin_kill()
199 acct_put(acct); in acct_pin_kill()
204 struct bsd_acct_struct *acct = container_of(work, struct bsd_acct_struct, work); in close_work() local
205 struct file *file = acct->file; in close_work()
209 complete(&acct->done); in close_work()
217 struct bsd_acct_struct *acct; in acct_on() local
221 acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL); in acct_on()
222 if (!acct) in acct_on()
228 kfree(acct); in acct_on()
233 kfree(acct); in acct_on()
239 kfree(acct); in acct_on()
245 kfree(acct); in acct_on()
252 kfree(acct); in acct_on()
259 atomic_long_set(&acct->count, 1); in acct_on()
260 init_fs_pin(&acct->pin, acct_pin_kill); in acct_on()
261 acct->file = file; in acct_on()
262 acct->needcheck = jiffies; in acct_on()
263 acct->ns = ns; in acct_on()
264 mutex_init(&acct->lock); in acct_on()
265 INIT_WORK(&acct->work, close_work); in acct_on()
266 init_completion(&acct->done); in acct_on()
267 mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */ in acct_on()
268 pin_insert(&acct->pin, mnt); in acct_on()
271 old = xchg(&ns->bacct, &acct->pin); in acct_on()
272 mutex_unlock(&acct->lock); in acct_on()
292 SYSCALL_DEFINE1(acct, const char __user *, name) in SYSCALL_DEFINE1() argument
492 static void do_acct_process(struct bsd_acct_struct *acct) in do_acct_process() argument
497 struct file *file = acct->file; in do_acct_process()
511 if (!check_free_space(acct)) in do_acct_process()
524 struct pid_namespace *ns = acct->ns; in do_acct_process()
596 struct bsd_acct_struct *acct = acct_get(ns); in slow_acct_process() local
597 if (acct) { in slow_acct_process()
598 do_acct_process(acct); in slow_acct_process()
599 mutex_unlock(&acct->lock); in slow_acct_process()
600 acct_put(acct); in slow_acct_process()