• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/kernel/

Lines Matching defs:acct

2  *  linux/kernel/acct.c
12 * process exits, an accounting record of type "struct acct" is
13 * written to the file specified with the acct() system call. It is
48 #include <linux/acct.h>
78 static void do_acct_process(struct bsd_acct_struct *acct,
103 struct bsd_acct_struct *acct = (struct bsd_acct_struct *)x;
104 acct->needcheck = 1;
110 static int check_free_space(struct bsd_acct_struct *acct, struct file *file)
119 res = acct->active;
120 if (!file || !acct->needcheck)
141 * If some joker switched acct->file under us we'ld better be
145 if (file != acct->file) {
151 if (acct->active) {
153 acct->active = 0;
158 acct->active = 1;
163 del_timer(&acct->timer);
164 acct->needcheck = 0;
165 acct->timer.expires = jiffies + ACCT_TIMEOUT*HZ;
166 add_timer(&acct->timer);
167 res = acct->active;
179 static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file,
185 if (acct->file) {
186 old_acct = acct->file;
187 old_ns = acct->ns;
188 del_timer(&acct->timer);
189 acct->active = 0;
190 acct->needcheck = 0;
191 acct->file = NULL;
192 acct->ns = NULL;
193 list_del(&acct->list);
196 acct->file = file;
197 acct->ns = ns;
198 acct->needcheck = 0;
199 acct->active = 1;
200 list_add(&acct->list, &acct_list);
202 setup_timer(&acct->timer, acct_timeout, (unsigned long)acct);
203 acct->timer.expires = jiffies + ACCT_TIMEOUT*HZ;
204 add_timer(&acct->timer);
209 do_acct_process(acct, old_ns, old_acct);
220 struct bsd_acct_struct *acct = NULL;
239 acct = kzalloc(sizeof(struct bsd_acct_struct), GFP_KERNEL);
240 if (acct == NULL) {
248 ns->bacct = acct;
249 acct = NULL;
258 kfree(acct);
274 SYSCALL_DEFINE1(acct, const char __user *, name)
288 struct bsd_acct_struct *acct;
290 acct = task_active_pid_ns(current)->bacct;
291 if (acct == NULL)
295 acct_file_reopen(acct, NULL, NULL);
311 struct bsd_acct_struct *acct;
315 list_for_each_entry(acct, &acct_list, list)
316 if (acct->file && acct->file->f_path.mnt == m) {
317 acct_file_reopen(acct, NULL, NULL);
332 struct bsd_acct_struct *acct;
336 list_for_each_entry(acct, &acct_list, list)
337 if (acct->file && acct->file->f_path.mnt->mnt_sb == sb) {
338 acct_file_reopen(acct, NULL, NULL);
346 struct bsd_acct_struct *acct = ns->bacct;
348 if (acct == NULL)
351 del_timer_sync(&acct->timer);
353 if (acct->file != NULL)
354 acct_file_reopen(acct, NULL, NULL);
357 kfree(acct);
466 * accounting system. The struct acct is built here and then written
474 static void do_acct_process(struct bsd_acct_struct *acct,
494 if (!check_free_space(acct, file))
626 struct bsd_acct_struct *acct;
628 acct = ns->bacct;
632 if (!acct || !acct->file)
636 file = acct->file;
644 do_acct_process(acct, ns, file);