MCPcopy Create free account
hub / github.com/F-Stack/f-stack / devstat_new_entry

Function devstat_new_entry

freebsd/kern/subr_devstat.c:85–109  ·  view source on GitHub ↗

* Allocate a devstat and initialize it */

Source from the content-addressed store, hash-verified

83 * Allocate a devstat and initialize it
84 */
85struct devstat *
86devstat_new_entry(const void *dev_name,
87 int unit_number, uint32_t block_size,
88 devstat_support_flags flags,
89 devstat_type_flags device_type,
90 devstat_priority priority)
91{
92 struct devstat *ds;
93
94 mtx_assert(&devstat_mutex, MA_NOTOWNED);
95
96 ds = devstat_alloc();
97 mtx_lock(&devstat_mutex);
98 if (unit_number == -1) {
99 ds->unit_number = unit_number;
100 ds->id = dev_name;
101 binuptime(&ds->creation_time);
102 devstat_generation++;
103 } else {
104 devstat_add_entry(ds, dev_name, unit_number, block_size,
105 flags, device_type, priority);
106 }
107 mtx_unlock(&devstat_mutex);
108 return (ds);
109}
110
111/*
112 * Take a malloced and zeroed devstat structure given to us, fill it in

Callers

nothing calls this directly

Calls 6

mtx_assertFunction · 0.85
devstat_allocFunction · 0.85
binuptimeFunction · 0.85
devstat_add_entryFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected