MCPcopy Create free account
hub / github.com/coreutils/coreutils / add_to_grand_total

Function add_to_grand_total

src/df.c:966–983  ·  view source on GitHub ↗

Add block and inode values to grand total. */

Source from the content-addressed store, hash-verified

964
965/* Add block and inode values to grand total. */
966static void
967add_to_grand_total (struct field_values_t *bv, struct field_values_t *iv)
968{
969 if (known_value (iv->total))
970 grand_fsu.fsu_files += iv->total;
971 if (known_value (iv->available))
972 grand_fsu.fsu_ffree += iv->available;
973
974 if (known_value (bv->total))
975 grand_fsu.fsu_blocks += bv->input_units * bv->total;
976 if (known_value (bv->available_to_root))
977 grand_fsu.fsu_bfree += bv->input_units * bv->available_to_root;
978 if (known_value (bv->available))
979 add_uint_with_neg_flag (&grand_fsu.fsu_bavail,
980 &grand_fsu.fsu_bavail_top_bit_set,
981 bv->input_units * bv->available,
982 bv->negate_available);
983}
984
985/* Obtain a space listing for the device with absolute file name DEVICE.
986 MOUNT_POINT names the root of the file system on DEVICE.

Callers 1

get_devFunction · 0.85

Calls 2

known_valueFunction · 0.85
add_uint_with_neg_flagFunction · 0.85

Tested by

no test coverage detected