• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/usr.sbin/mptutil/

Lines Matching defs:list

12  *    notice, this list of conditions and the following disclaimer.
14 * notice, this list of conditions and the following disclaimer in the
91 * - IOC2 : This gives us a list of volumes, and by walking the volumes we
94 * - IOC3 : This gives us a list of all online physical drives including
97 * - IOC5 : This gives us a list of all spare drives including failed
107 * drive is already present in the list. It also sorts the list as it
111 mpt_pd_insert(int fd, struct mpt_drive_list *list, U8 PhysDiskNum)
119 for (i = 0; i < list->ndrives; i++) {
120 if (list->drives[i]->PhysDiskNum == PhysDiskNum)
122 if (list->drives[i]->PhysDiskNum > PhysDiskNum)
130 for (j = list->ndrives - 1; j >= i; j--)
131 list->drives[j + 1] = list->drives[j];
132 list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL);
133 if (list->drives[i] == NULL)
135 list->ndrives++;
150 struct mpt_drive_list *list;
157 warn("Failed to fetch volume list");
165 warn("Failed to fetch drive list");
174 warn("Failed to fetch spare list");
207 listsize = sizeof(*list) + sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0) * count;
208 list = calloc(1, listsize);
213 if (mpt_pd_insert(fd, list, rdisk->PhysDiskNum) < 0) {
214 mpt_free_pd_list(list);
228 if (mpt_pd_insert(fd, list, spare->PhysDiskNum) < 0) {
229 mpt_free_pd_list(list);
238 if (mpt_pd_insert(fd, list, disk->PhysDiskNum) < 0) {
239 mpt_free_pd_list(list);
245 return (list);
249 mpt_free_pd_list(struct mpt_drive_list *list)
253 for (i = 0; i < list->ndrives; i++)
254 free(list->drives[i]);
255 free(list);
259 mpt_lookup_drive(struct mpt_drive_list *list, const char *drive,
287 for (val = 0; val < list->ndrives; val++) {
288 if (list->drives[val]->PhysDiskBus == bus &&
289 list->drives[val]->PhysDiskID == id) {
290 *PhysDiskNum = list->drives[val]->PhysDiskNum;
332 struct mpt_drive_list *list;
343 list = mpt_pd_list(fd);
344 if (list == NULL) {
349 if (mpt_lookup_drive(list, drive, &PhysDiskNum) < 0) {
355 mpt_free_pd_list(list);