Lines Matching full:entry

65  * This structure is used to hold a SNMP table entry
86 * (a_name) to an entry in the hrFSTblEntry. We are trying to keep the same
94 struct fs_entry *entry; member
147 * Create an entry into the FS table and an entry in the map (if needed).
152 struct fs_entry *entry; in fs_entry_create() local
190 map->entry = NULL; in fs_entry_create()
198 if ((entry = malloc(sizeof(*entry))) == NULL) { in fs_entry_create()
203 if ((entry->mountPoint = strdup(name)) == NULL) { in fs_entry_create()
205 free(entry); in fs_entry_create()
209 entry->index = map->hrIndex; in fs_entry_create()
210 map->entry = entry; in fs_entry_create()
212 INSERT_OBJECT_INT(entry, &fs_tbl); in fs_entry_create()
213 return (entry); in fs_entry_create()
217 * Delete an entry in the FS table.
220 fs_entry_delete(struct fs_entry* entry) in fs_entry_delete() argument
224 assert(entry != NULL); in fs_entry_delete()
226 TAILQ_REMOVE(&fs_tbl, entry, link); in fs_entry_delete()
228 if (map->entry == entry) { in fs_entry_delete()
229 map->entry = NULL; in fs_entry_delete()
232 free(entry->mountPoint); in fs_entry_delete()
233 free(entry->remoteMountPoint); in fs_entry_delete()
234 free(entry); in fs_entry_delete()
238 * Find a table entry by its name
243 struct fs_entry *entry; in fs_find_by_name() local
245 TAILQ_FOREACH(entry, &fs_tbl, link) in fs_find_by_name()
246 if (strcmp(entry->mountPoint, name) == 0) in fs_find_by_name()
247 return (entry); in fs_find_by_name()
262 if (n1->entry != NULL) { in fini_fs_tbl()
263 TAILQ_REMOVE(&fs_tbl, n1->entry, link); in fini_fs_tbl()
264 free(n1->entry->mountPoint); in fini_fs_tbl()
265 free(n1->entry->remoteMountPoint); in fini_fs_tbl()
266 free(n1->entry); in fini_fs_tbl()
280 struct fs_entry *entry; in fs_tbl_pre_refresh() local
282 /* mark each entry as missisng */ in fs_tbl_pre_refresh()
283 TAILQ_FOREACH(entry, &fs_tbl, link) in fs_tbl_pre_refresh()
284 entry->flags &= ~HR_FS_FOUND; in fs_tbl_pre_refresh()
293 struct fs_entry *entry, *entry_tmp; in fs_tbl_post_refresh() local
298 TAILQ_FOREACH_SAFE(entry, &fs_tbl, link, entry_tmp) in fs_tbl_post_refresh()
299 if (!(entry->flags & HR_FS_FOUND)) in fs_tbl_post_refresh()
300 fs_entry_delete(entry); in fs_tbl_post_refresh()
336 * Given information returned from statfs(2) either create a new entry into
337 * the fs_tbl or refresh the entry if it is already there.
342 struct fs_entry *entry; in fs_tbl_process_statfs_entry() local
351 if ((entry = fs_find_by_name(fs_p->f_mntonname)) != NULL || in fs_tbl_process_statfs_entry()
352 (entry = fs_entry_create(fs_p->f_mntonname)) != NULL) { in fs_tbl_process_statfs_entry()
353 entry->flags |= HR_FS_FOUND; in fs_tbl_process_statfs_entry()
357 entry->remoteMountPoint = strdup(fs_p->f_mntfromname); in fs_tbl_process_statfs_entry()
361 entry->remoteMountPoint = strdup(""); in fs_tbl_process_statfs_entry()
365 entry->type = fs_get_type(fs_p); in fs_tbl_process_statfs_entry()
368 entry->access = FS_READ_ONLY; in fs_tbl_process_statfs_entry()
370 entry->access = FS_READ_WRITE; in fs_tbl_process_statfs_entry()
373 entry->bootable = TRUTH_MK((fs_p->f_flags & MNT_ROOTFS) in fs_tbl_process_statfs_entry()
376 entry->storageIndex = storage_idx; in fs_tbl_process_statfs_entry()
379 memset(entry->lastFullBackupDate, 0, in fs_tbl_process_statfs_entry()
380 sizeof(entry->lastFullBackupDate)); in fs_tbl_process_statfs_entry()
383 memset(entry->lastPartialBackupDate, 0, in fs_tbl_process_statfs_entry()
384 sizeof(entry->lastPartialBackupDate)); in fs_tbl_process_statfs_entry()
386 handle_partition_fs_index(fs_p->f_mntfromname, entry->index); in fs_tbl_process_statfs_entry()
399 struct fs_entry *entry; in op_hrFSTable() local
406 if ((entry = NEXT_OBJECT_INT(&fs_tbl, in op_hrFSTable()
410 value->var.subs[sub] = entry->index; in op_hrFSTable()
414 if ((entry = FIND_OBJECT_INT(&fs_tbl, in op_hrFSTable()
420 if ((entry = FIND_OBJECT_INT(&fs_tbl, in op_hrFSTable()
434 value->v.integer = entry->index; in op_hrFSTable()
438 return (string_get(value, entry->mountPoint, -1)); in op_hrFSTable()
441 if (entry->remoteMountPoint == NULL) in op_hrFSTable()
444 return (string_get(value, entry->remoteMountPoint, -1)); in op_hrFSTable()
448 assert(entry->type != NULL); in op_hrFSTable()
449 value->v.oid = *(entry->type); in op_hrFSTable()
453 value->v.integer = entry->access; in op_hrFSTable()
457 value->v.integer = entry->bootable; in op_hrFSTable()
461 value->v.integer = entry->storageIndex; in op_hrFSTable()
465 return (string_get(value, entry->lastFullBackupDate, 8)); in op_hrFSTable()
468 return (string_get(value, entry->lastPartialBackupDate, 8)); in op_hrFSTable()