-/** The columns of the id table. */
-enum user_table_columns {
- /** The numer of the directory. */
- UT_DIR_NUM,
- /** The number of bytes of all regular files in this dir owned by this id. */
- UT_BYTES,
- /** The number of files in this dir owned by this id. */
- UT_FILES,
- /** Number of columns in this table. */
- NUM_UT_COLUMNS
-};
-
-static struct osl_column_description user_table_cols[] = {
- [UT_DIR_NUM] = {
- .storage_type = OSL_MAPPED_STORAGE,
- .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE | OSL_UNIQUE,
- .name = "dir_num",
- .compare_function = uint64_compare,
- .data_size = sizeof(uint64_t)
- },
- [UT_BYTES] = {
- .storage_type = OSL_MAPPED_STORAGE,
- .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE,
- .compare_function = size_compare,
- .name = "num_bytes",
- .data_size = sizeof(uint64_t)
- },
- [UT_FILES] = {
- .storage_type = OSL_MAPPED_STORAGE,
- .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE,
- .compare_function = size_compare,
- .name = "num_files",
- .data_size = sizeof(uint64_t)
- },
-};
-
-static struct osl_table *dir_table;
-
-static int add_directory(char *dirname, uint64_t dir_num, uint64_t *dir_size,
- uint64_t *dir_files)
-{
- struct osl_object dir_objects[NUM_DT_COLUMNS];
-
- INFO_LOG("adding #%llu: %s\n", (long long unsigned)dir_num, dirname);
- dir_objects[DT_NAME].data = dirname;
- dir_objects[DT_NAME].size = strlen(dirname) + 1;
- dir_objects[DT_NUM].data = &dir_num;
- dir_objects[DT_NUM].size = sizeof(dir_num);
- dir_objects[DT_BYTES].data = dir_size;
- dir_objects[DT_BYTES].size = sizeof(*dir_size);
- dir_objects[DT_FILES].data = dir_files;
- dir_objects[DT_FILES].size = sizeof(*dir_files);
-
- return osl_add_row(dir_table, dir_objects);
-}
-
-static uint32_t num_uids;
-
-static int open_user_table(struct user_info *ui, int create)