亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tfsclean1.c

?? 完整的Bell實驗室的嵌入式文件系統TFS
?? C
?? 第 1 頁 / 共 5 頁
字號:
    ftot = dhp->idx + 1;    printf("TFS: calculating per-sector crcs... ");    for(i=0;i<tdp->sectorcount;i++) {        addrtosector(sbase,&snum,&ssize,0);        if (i == tdp->sectorcount - 1) {            ssize -=                            /* CRC table */                (tdp->sectorcount * sizeof(struct sectorcrc));            ssize -= (ftot * DEFRAGHDRSIZ);     /* DHT table */            ssize -= 4;                         /* Crc of the tables */        }        if (crc32(sbase,ssize) != crctbl[i].precrc) {            if (*first == -1)                *first = snum;            *last = snum;        }        sbase += ssize;        defragTick(0);    }    printf("done\n");    return;}/* defragPostCrcCheck(): * Return 1 if the post-crc check of the incoming sector number passes; * else 0. */intdefragPostCrcCheck(TDEV *tdp, int isnum){    uchar   *sbase;    struct  defraghdr *dhp;    struct  sectorcrc *crctbl;    int     ftot, i, snum, ssize, lastsnum, lastssize;    sbase = (uchar *)tdp->start;    crctbl = defragCrcTable(tdp);    dhp = (struct defraghdr *)crctbl - 1;    ftot = dhp->idx + 1;    addrtosector((uchar *)tdp->end,&lastsnum,&lastssize,0);    for(i=0;i<tdp->sectorcount;i++) {        addrtosector(sbase,&snum,&ssize,0);        if (snum == isnum)            break;        sbase += ssize;    }    if (isnum == lastsnum) {        ssize -= (tdp->sectorcount * sizeof(struct sectorcrc));         ssize -= (ftot * DEFRAGHDRSIZ);        ssize -= 4;    }    if (crctbl[i].postcrc == crc32(sbase,ssize))        return(1);    else        return(0);}/* defragGetStateStr(): * Return a string that corresponds to the incoming state value. */static char *defragGetStateStr(int state){    char *str;    switch(state) {    case SECTOR_DEFRAG_INACTIVE:        str = "SectorDefragInactive";        break;    case SECTOR_DEFRAG_ABORT_RESTART:        str = "DefragRestartAborted";        break;    case SCANNING_ACTIVE_SECTOR_1:        str = "ScanningActiveSector1";        break;    case SCANNING_ACTIVE_SECTOR_2:        str = "ScanningActiveSector2";        break;    case SCANNING_ACTIVE_SECTOR_3:        str = "ScanningActiveSector3";        break;    case SCANNING_ACTIVE_SECTOR_4:        str = "ScanningActiveSector4";        break;    case SCANNING_ACTIVE_SECTOR_5:        str = "ScanningActiveSector5";        break;    case SECTOR_DEFRAG_ALMOST_DONE:        str = "DefragAlmostDone";        break;    default:        str = "???";        break;    }    return(str);}/* defragRestart(): * Poll the console allowing the user to abort the auto-restart of * the defragmentation.  If a character is received on the console, * then return 0 indicating that the defrag should not be restarted; * else return 1. */intdefragRestart(int state,int snum){    printf("TFS defrag restart state: %s sector %d\n",        defragGetStateStr(state),snum);    if (pollConsole("Hit any key to abort..."))        return(0);    return(1);}/* defragGetState(): * Step through the files in the specified device and check for * sanity.  Return 1 if the conclusion is that we are in the middle * of a defragmentation; else 0. */static intdefragGetState(TDEV *tdp, int *activesnum){    TFILE   *tfp;    struct  defraghdr   *dhp;    struct  sectorcrc *crctbl;    int     snum_in_spare, firstsnum;    int     first_touched_snum, last_touched_snum;    int     break_cause, break1_cause, spare_is_erased, ftot, ftot1, errstate;    /* Establish state of spare sector:     */    spare_is_erased = flasherased((uchar *)tdp->spare,        (uchar *)tdp->spare+tdp->sparesize);    ftot = 0;    break_cause = break1_cause = 0;    for(tfp=(TFILE *)tdp->start; tfp < (TFILE *)tdp->end; tfp=tfp->next) {        /* If we are legally at the end of file storage space, then we         * will hit a header size that is ERASED16.  If we reach this         * point and the remaining space dedicated to file storage is         * erased and the spare is erased, it is safe to assume that we         * were not in the middle of a defrag.         */        if (tfp->hdrsize == ERASED16) {            /* Is space from last file to end of TFS space erased? */            if (!flasherased((uchar *)tfp,(uchar *)tdp->end)) {                break_cause = 1;                break;            }            if (!spare_is_erased) {                break_cause = 2;                break;            }#if DEFRAG_TEST_ENABLED            printf("\ndefragGetState: inactive_1\n");#endif            return(SECTOR_DEFRAG_INACTIVE);        }        /* If the crc32 of the header is corrupt, or if the next pointer         * doesn't make any sense, then we must assume that a defrag         * was in progress...         */        if (tfshdrcrc(tfp) != tfp->hdrcrc) {            break;        }        if (!(tfp->next) || (tfp->next <= (TFILE *)tdp->start) ||             (tfp->next >= (TFILE *)tdp->end)) {            break;        }        if (TFS_FILEEXISTS(tfp))            ftot++;    }    /* If we are here, then something is not "perfect" with the flash     * space used by TFS.  If break_cause is non-zero, there is a chance     * that the only problem is that a file-write was interrupted and     * we did not actually interrupt an in-progress-defrag.  An interrupted     * file write would place some incomplete data after the last file.     */    ftot1 = defragValidDSI(tdp,&crctbl);    /* If we don't have valid defrag state info (DSI), then we can assume     * that the files in TFS have not yet been touched (since if we had     * touched them, we would have already successfully created the DSI).     * This being the case, then we will not continue with any defrag,     * let TFS clean things up when the space is needed.     */    if (!ftot1) {        if (break_cause) {            /* Hmmm... Should something be done here? */        }#if DEFRAG_TEST_ENABLED        printf("\ndefragGetState: inactive_2\n");#endif        return(SECTOR_DEFRAG_INACTIVE);    }    /* If we get here, then we have a valid defrag header table, so we     * can use it and the state of each of the sectors to figure out     * where we are in the defragmentation process.  We need to determine     * which sector was being worked on at the point in time when the     * defragmentation was interrupted.  A sector is in the "touched"     * state if a crc32 on its content does not match the crc32 stored     * in the crc table above the defrag header table.     *      * Here we step through the defrag header table and see if each file     * in the header table exists in TFS.  If all files exist, then we     * must have been very close to completion of the defrag process.     */    printf("TFS: scanning DSI space... ");    dhp = (struct defraghdr *)crctbl - ftot1;    while(dhp < (struct defraghdr *)crctbl) {        tfp = (TFILE *)dhp->nda;        if (tfp->hdrcrc != dhp->ohdrcrc)            break;                if (tfshdrcrc(tfp) != tfp->hdrcrc) {            break1_cause = 1;            break;        }        if (crc32((uchar *)(tfp+1),tfp->filsize) != tfp->filcrc) {            break1_cause = 2;            break;        }        dhp++;        defragTick(0);    }    printf("done\n");    /* If we stepped through the entire table, then we've completed the     * file relocation process, but we still have to clean up...     */    if (dhp >= (struct defraghdr *)crctbl) {        if (defragRestart(SECTOR_DEFRAG_ALMOST_DONE,0)) {            return(SECTOR_DEFRAG_ALMOST_DONE);        }        else {            return(SECTOR_DEFRAG_ABORT_RESTART);        }    }        if (addrtosector((char *)tdp->start,&firstsnum,0,0) < 0) {        errstate = 50;        goto state_error;    }    defragTouchedSectors(tdp,&first_touched_snum,&last_touched_snum);    /* If there are no touched sectors, then we will not continue with     * the defrag because we didn't start relocation of any of the files     * yet.     */    if (first_touched_snum == -1) {#if DEFRAG_TEST_ENABLED        printf("\ndefragGetState: inactive_3\n");#endif        return(SECTOR_DEFRAG_INACTIVE);    }    if (spare_is_erased)        snum_in_spare = -1;    else        snum_in_spare = defragSectorInSpare(tdp,crctbl);#if DEFRAG_TEST_ENABLED    printf("\ndefragGetState info: %d %d %d\n",        first_touched_snum, last_touched_snum, snum_in_spare);#endif    /* At this point we know what sector was the last to be touched.      * What we don't know is whether or not the "touch" was completed.     * So we don't know if the active sector is last_touched_snum or     * last_touched_snum+1.     * The only useful piece of data we 'might' have is the fact that     * the spare may contain the content of the last touched sector.     */    /* If the spare is erased, it may be because defrag was just getting     * ready to start working on the next sector (meaning that the active     * sector is last_touched_snum+1) or the sector was in the process of     * being modified.  We use the post-crc in the DHT to determine what     * the active sector is...     */    if (spare_is_erased) {        if (last_touched_snum >= 0) {            if (defragPostCrcCheck(tdp,last_touched_snum)) {                *activesnum = last_touched_snum + 1;                if (defragRestart(SCANNING_ACTIVE_SECTOR_1,*activesnum))                    return(SCANNING_ACTIVE_SECTOR_1);                else                    return(SECTOR_DEFRAG_ABORT_RESTART);            }            else {                if (defragSerase(2,last_touched_snum) < 0) {                    errstate = 51;                    goto state_error;                }                *activesnum = last_touched_snum;                if (defragRestart(SCANNING_ACTIVE_SECTOR_2,*activesnum))                    return(SCANNING_ACTIVE_SECTOR_2);                else                    return(SECTOR_DEFRAG_ABORT_RESTART);            }        }        else {            errstate = 52;            goto state_error;        }    }    /* If the sector copied to spare is one greater than the last touched     * sector, then the active sector is last_touched_snum+1 and it was     * just copied to the spare.  In this case we erase the spare and     * return indicating the active sector.     */    if (snum_in_spare == last_touched_snum+1) {        if (defragEraseSpare(tdp) < 0) {            errstate = 53;            goto state_error;        }        *activesnum = snum_in_spare;        if (defragRestart(SCANNING_ACTIVE_SECTOR_3,*activesnum))            return(SCANNING_ACTIVE_SECTOR_3);        else            return(SECTOR_DEFRAG_ABORT_RESTART);    }    /* If the spare is not erased, but it does not match any of the      * sector CRCs, then we must have been in the process of copying     * the active sector to the spare, so we can erase it and return     * to the SCANNING_ACTIVE_SECTOR state.     */    if (snum_in_spare == -1) {        if (last_touched_snum >= 0) {            *activesnum = last_touched_snum + 1;            if (!defragRestart(SCANNING_ACTIVE_SECTOR_4,*activesnum))                return(SECTOR_DEFRAG_ABORT_RESTART);            if (defragEraseSpare(tdp) < 0) {                errstate = 54;                goto state_error;            }            return(SCANNING_ACTIVE_SECTOR_4);        }        else {            errstate = 55;            goto state_error;        }    }    /* If the sector copied to spare is the number of the last touched     * sector, then we were in the middle of modifying the sector, so     * we have to erase that sector, copy the spare to it and return     * to the scanning state.     */    if (snum_in_spare == last_touched_snum) {        int ssize;        uchar *sbase;        *activesnum = snum_in_spare;        if (!defragRestart(SCANNING_ACTIVE_SECTOR_5,*activesnum))            return(SECTOR_DEFRAG_ABORT_RESTART);        if (defragSerase(3,snum_in_spare) < 0) {            errstate = 56;            goto state_error;        }        if (sectortoaddr(snum_in_spare,&ssize,&sbase) < 0) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合欧美亚洲| 成人免费毛片高清视频| 久久精子c满五个校花| 91亚洲资源网| 激情六月婷婷综合| 亚洲欧美日韩综合aⅴ视频| 欧美一级专区免费大片| 成人av免费在线| 麻豆精品视频在线观看免费| 亚洲欧美成aⅴ人在线观看| 久久亚洲一区二区三区四区| 欧美日韩一区二区三区视频| 成人福利视频网站| 麻豆精品视频在线| 午夜精品福利在线| 亚洲视频在线观看三级| 久久久国产一区二区三区四区小说 | 日韩精品亚洲一区| 欧美国产日韩亚洲一区| 欧美性大战久久久久久久| av电影在线观看一区| 久久成人免费网| 日本不卡一区二区三区高清视频| 亚洲精品成人少妇| 国产精品日韩精品欧美在线 | 亚洲欧美综合另类在线卡通| 精品处破学生在线二十三| 欧美日韩亚洲综合一区| 91天堂素人约啪| 成人国产亚洲欧美成人综合网| 六月丁香婷婷久久| 日本vs亚洲vs韩国一区三区| 亚洲一区二区三区四区中文字幕 | 国产视频在线观看一区二区三区| 在线看日本不卡| 波多野结衣视频一区| 日本aⅴ亚洲精品中文乱码| 亚洲欧美偷拍卡通变态| 国产欧美精品一区二区色综合| 欧美一区二区精品| 欧美色倩网站大全免费| 精品在线播放免费| 午夜影院在线观看欧美| 亚洲精品欧美激情| 国产精品毛片大码女人| 久久综合九色综合97婷婷| 这里只有精品99re| 欧美主播一区二区三区| 91在线视频18| 99久久久国产精品免费蜜臀| 国产精品一区二区在线观看不卡| 奇米四色…亚洲| 天天色天天爱天天射综合| 中文字幕在线免费不卡| 欧美激情一区二区三区全黄| 精品日韩在线一区| 欧美一区二区观看视频| 欧美日韩中字一区| 欧美性色黄大片| 欧美日韩一区 二区 三区 久久精品 | 国产欧美日韩另类视频免费观看 | 91亚洲国产成人精品一区二区三 | 国产经典欧美精品| 国内外成人在线视频| 国内成人自拍视频| 国产黄人亚洲片| 成人综合激情网| 成人av免费在线播放| 国产99一区视频免费| 国产一区亚洲一区| 东方aⅴ免费观看久久av| 国产成人av一区二区| 国产jizzjizz一区二区| 成人av动漫在线| 91黄视频在线观看| 欧美老肥妇做.爰bbww视频| 日韩亚洲欧美在线观看| 久久中文娱乐网| 国产精品网站一区| 亚洲乱码国产乱码精品精小说| 日韩理论在线观看| 日韩av午夜在线观看| 狠狠狠色丁香婷婷综合激情| 国产成人av资源| 成人avav影音| 91国产福利在线| 日韩一区二区麻豆国产| 久久精品视频一区二区| 亚洲天堂福利av| 亚洲成人综合在线| 久久福利资源站| av在线综合网| 在线亚洲人成电影网站色www| 欧美探花视频资源| 精品国产凹凸成av人网站| 中文字幕不卡的av| 亚洲国产成人porn| 国产一区二区看久久| 成人黄色软件下载| 在线不卡的av| 久久久亚洲综合| 亚洲乱码中文字幕综合| 久久精品国产澳门| 91猫先生在线| 欧美午夜不卡视频| 中文字幕不卡的av| 日本女优在线视频一区二区| 成人美女视频在线观看| 欧美日韩视频不卡| 欧美激情在线一区二区三区| 亚洲小说春色综合另类电影| 精品在线观看视频| 欧美在线一二三| 国产欧美一区二区三区在线老狼| 亚洲成人www| 波多野结衣亚洲| 欧美视频在线一区二区三区 | 午夜一区二区三区在线观看| 国产剧情一区在线| 一本一本久久a久久精品综合麻豆| 欧美一区二区私人影院日本| 国产精品久久久久久久岛一牛影视| 午夜精品aaa| 色综合天天在线| 国产目拍亚洲精品99久久精品| 视频一区中文字幕国产| 91美女视频网站| 国产精品无码永久免费888| 精品一区二区在线播放| 911精品产国品一二三产区| 亚洲人一二三区| 国产一区二区精品久久| 欧美精品 日韩| 亚洲综合视频在线观看| 99re这里只有精品6| 久久先锋影音av| 另类人妖一区二区av| 91年精品国产| 国产精品成人在线观看| 国产精品888| 久久亚洲精华国产精华液| 日韩成人免费在线| 日本精品视频一区二区三区| 国产日韩成人精品| 国产精品一区二区久久精品爱涩| 日韩欧美国产成人一区二区| 日韩黄色小视频| 欧美久久久久久久久中文字幕| 国产精品久久久久一区二区三区共| 国产伦精品一区二区三区视频青涩| 日韩欧美电影在线| 青椒成人免费视频| 欧美日韩国产片| 日韩精品电影一区亚洲| 欧美丰满嫩嫩电影| 日本麻豆一区二区三区视频| 欧美日本视频在线| 亚洲.国产.中文慕字在线| aaa国产一区| 国产精品电影院| 成人免费av在线| 国产精品天美传媒| 97精品久久久久中文字幕 | 欧美性色黄大片| 九九精品视频在线看| 精品国产凹凸成av人导航| 精品一区二区三区久久| 欧美精品一区二区三区很污很色的| 久久精品国产精品亚洲综合| 久久嫩草精品久久久精品一| 国产成a人亚洲精| 久久精品亚洲一区二区三区浴池 | 在线观看欧美精品| 性做久久久久久免费观看| 日本韩国一区二区| 首页亚洲欧美制服丝腿| 欧美成人综合网站| 国产91露脸合集magnet| 亚洲精品亚洲人成人网在线播放| 在线精品视频免费观看| 蜜桃av一区二区在线观看| 久久综合九色综合欧美就去吻| 国产aⅴ精品一区二区三区色成熟| 国产人伦精品一区二区| 99久久精品免费精品国产| 亚洲图片欧美视频| 亚洲精品一区二区三区精华液| 国产a级毛片一区| 亚洲自拍偷拍图区| 欧美成人官网二区| 福利一区福利二区| 国产精品三级电影| 欧美午夜精品久久久| 激情欧美一区二区三区在线观看| 亚洲欧洲性图库| 欧美一区二区三区四区五区| 国产999精品久久久久久| 一区二区三区在线视频观看| 日韩三级视频在线观看| 99免费精品在线|