* Allocate a devstat and initialize it */
| 83 | * Allocate a devstat and initialize it |
| 84 | */ |
| 85 | struct devstat * |
| 86 | devstat_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 |
nothing calls this directly
no test coverage detected