Exemplo n.º 1
0
void FilePrune(FileContainer *ffc) {
    File *file;

    for (file = ffc->head; file != NULL; file = file->next) {
        FilePruneFile(file);
    }
}
Exemplo n.º 2
0
void FilePrune(FileContainer *ffc)
{
    File *file = ffc->head;

    while (file) {
        if (FilePruneFile(file) == 0)
            break;

        BUG_ON(file != ffc->head);

        File *file_next = file->next;

        /* update head and tail */
        ffc->head = file_next;
        if (file == ffc->tail)
            ffc->tail = NULL;

        FileFree(file);
        file = file_next;
    }
}