Lines Matching refs:acct
93 static void do_acct_process(struct bsd_acct_struct *acct);
98 static int check_free_space(struct bsd_acct_struct *acct) in check_free_space() argument
102 if (time_is_before_jiffies(acct->needcheck)) in check_free_space()
106 if (vfs_statfs(&acct->file->f_path, &sbuf)) in check_free_space()
109 if (acct->active) { in check_free_space()
113 acct->active = 0; in check_free_space()
120 acct->active = 1; in check_free_space()
125 acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; in check_free_space()
127 return acct->active; in check_free_space()
169 struct bsd_acct_struct *acct = to_acct(pin); in acct_pin_kill() local
170 mutex_lock(&acct->lock); in acct_pin_kill()
171 do_acct_process(acct); in acct_pin_kill()
172 schedule_work(&acct->work); in acct_pin_kill()
173 wait_for_completion(&acct->done); in acct_pin_kill()
174 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill()
175 mutex_unlock(&acct->lock); in acct_pin_kill()
177 acct_put(acct); in acct_pin_kill()
182 struct bsd_acct_struct *acct = container_of(work, struct bsd_acct_struct, work); in close_work() local
183 struct file *file = acct->file; in close_work()
187 complete(&acct->done); in close_work()
195 struct bsd_acct_struct *acct; in acct_on() local
199 acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL); in acct_on()
200 if (!acct) in acct_on()
206 kfree(acct); in acct_on()
211 kfree(acct); in acct_on()
217 kfree(acct); in acct_on()
223 kfree(acct); in acct_on()
230 kfree(acct); in acct_on()
237 atomic_long_set(&acct->count, 1); in acct_on()
238 init_fs_pin(&acct->pin, acct_pin_kill); in acct_on()
239 acct->file = file; in acct_on()
240 acct->needcheck = jiffies; in acct_on()
241 acct->ns = ns; in acct_on()
242 mutex_init(&acct->lock); in acct_on()
243 INIT_WORK(&acct->work, close_work); in acct_on()
244 init_completion(&acct->done); in acct_on()
245 mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */ in acct_on()
246 pin_insert(&acct->pin, mnt); in acct_on()
249 old = xchg(&ns->bacct, &acct->pin); in acct_on()
250 mutex_unlock(&acct->lock); in acct_on()
270 SYSCALL_DEFINE1(acct, const char __user *, name) in SYSCALL_DEFINE1() argument
468 static void do_acct_process(struct bsd_acct_struct *acct) in do_acct_process() argument
473 struct file *file = acct->file; in do_acct_process()
487 if (!check_free_space(acct)) in do_acct_process()
501 struct pid_namespace *ns = acct->ns; in do_acct_process()
573 struct bsd_acct_struct *acct = acct_get(ns); in slow_acct_process() local
574 if (acct) { in slow_acct_process()
575 do_acct_process(acct); in slow_acct_process()
576 mutex_unlock(&acct->lock); in slow_acct_process()
577 acct_put(acct); in slow_acct_process()