Lines Matching refs:list

10  *    notice, this list of conditions and the following disclaimer.
12 * notice, this list of conditions and the following disclaimer in the
89 * - IOC2 : This gives us a list of volumes, and by walking the volumes we
92 * - IOC3 : This gives us a list of all online physical drives including
95 * - IOC5 : This gives us a list of all spare drives including failed
105 * drive is already present in the list. It also sorts the list as it
109 mpt_pd_insert(int fd, struct mpt_drive_list *list, U8 PhysDiskNum)
117 for (i = 0; i < list->ndrives; i++) {
118 if (list->drives[i]->PhysDiskNum == PhysDiskNum)
120 if (list->drives[i]->PhysDiskNum > PhysDiskNum)
128 for (j = list->ndrives - 1; j >= i; j--)
129 list->drives[j + 1] = list->drives[j];
130 list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL);
131 if (list->drives[i] == NULL)
133 list->ndrives++;
148 struct mpt_drive_list *list;
154 warn("Failed to fetch volume list");
162 warn("Failed to fetch drive list");
171 warn("Failed to fetch spare list");
200 list = malloc(sizeof(*list) + sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0) *
202 list->ndrives = 0;
207 if (mpt_pd_insert(fd, list, rdisk->PhysDiskNum) < 0)
216 if (mpt_pd_insert(fd, list, spare->PhysDiskNum) < 0)
222 if (mpt_pd_insert(fd, list, disk->PhysDiskNum) < 0)
226 return (list);
230 mpt_free_pd_list(struct mpt_drive_list *list)
234 for (i = 0; i < list->ndrives; i++)
235 free(list->drives[i]);
236 free(list);
240 mpt_lookup_drive(struct mpt_drive_list *list, const char *drive,
268 for (val = 0; val < list->ndrives; val++) {
269 if (list->drives[val]->PhysDiskBus == bus &&
270 list->drives[val]->PhysDiskID == id) {
271 *PhysDiskNum = list->drives[val]->PhysDiskNum;
313 struct mpt_drive_list *list;
324 list = mpt_pd_list(fd);
325 if (list == NULL)
328 if (mpt_lookup_drive(list, drive, &PhysDiskNum) < 0) {
333 mpt_free_pd_list(list);