Lines Matching +full:1 +full:ac
20 * Plugged two leaks. 1) It didn't return acct_file into the free_filps if
75 #define SUSPEND (acct_parm[1]) /* <foo% free space - suspend */
142 acct->active = 1; in check_free_space()
259 atomic_long_set(&acct->count, 1); in acct_on()
267 mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */ in acct_on()
332 #define MAXFRACT ((1 << MANTSIZE) - 1) /* Maximum fractional value. */
340 rnd = value & (1 << (EXPSIZE - 1)); /* Round up? */ in encode_comp_t()
363 #if ACCT_VERSION == 1 || ACCT_VERSION == 2
375 #define MAXFRACT2 ((1ul << MANTSIZE2) - 1) /* Maximum fractional value. */
376 #define MAXEXP2 ((1 << EXPSIZE2) - 1) /* Maximum exponent. */
382 exp = (value > (MAXFRACT2>>1)); in encode_comp2_t()
385 rnd = value & 1; in encode_comp2_t()
386 value >>= 1; in encode_comp2_t()
394 value >>= 1; in encode_comp2_t()
400 return (1ul << (MANTSIZE2+EXPSIZE2-1)) - 1; in encode_comp2_t()
402 return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1)); in encode_comp2_t()
417 value <<= 1; in encode_float()
434 static void fill_ac(acct_t *ac) in fill_ac() argument
445 memset(ac, 0, sizeof(acct_t)); in fill_ac()
447 ac->ac_version = ACCT_VERSION | ACCT_BYTEORDER; in fill_ac()
448 strscpy(ac->ac_comm, current->comm, sizeof(ac->ac_comm)); in fill_ac()
456 ac->ac_etime = encode_float(elapsed); in fill_ac()
458 ac->ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ? in fill_ac()
459 (unsigned long) elapsed : (unsigned long) -1l); in fill_ac()
461 #if ACCT_VERSION == 1 || ACCT_VERSION == 2 in fill_ac()
466 ac->ac_etime_hi = etime >> 16; in fill_ac()
467 ac->ac_etime_lo = (u16) etime; in fill_ac()
472 ac->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX); in fill_ac()
474 ac->ac_ahz = AHZ; in fill_ac()
479 ac->ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0; in fill_ac()
480 ac->ac_utime = encode_comp_t(nsec_to_AHZ(pacct->ac_utime)); in fill_ac()
481 ac->ac_stime = encode_comp_t(nsec_to_AHZ(pacct->ac_stime)); in fill_ac()
482 ac->ac_flag = pacct->ac_flag; in fill_ac()
483 ac->ac_mem = encode_comp_t(pacct->ac_mem); in fill_ac()
484 ac->ac_minflt = encode_comp_t(pacct->ac_minflt); in fill_ac()
485 ac->ac_majflt = encode_comp_t(pacct->ac_majflt); in fill_ac()
486 ac->ac_exitcode = pacct->ac_exitcode; in fill_ac()
494 acct_t ac; in do_acct_process() local
514 fill_ac(&ac); in do_acct_process()
516 ac.ac_uid = from_kuid_munged(file->f_cred->user_ns, orig_cred->uid); in do_acct_process()
517 ac.ac_gid = from_kgid_munged(file->f_cred->user_ns, orig_cred->gid); in do_acct_process()
518 #if ACCT_VERSION == 1 || ACCT_VERSION == 2 in do_acct_process()
520 ac.ac_uid16 = ac.ac_uid; in do_acct_process()
521 ac.ac_gid16 = ac.ac_gid; in do_acct_process()
526 ac.ac_pid = task_tgid_nr_ns(current, ns); in do_acct_process()
528 ac.ac_ppid = task_tgid_nr_ns(rcu_dereference(current->real_parent), in do_acct_process()
540 __kernel_write(file, &ac, sizeof(acct_t), &pos); in do_acct_process()