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

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

?? tfsclean1.c

?? 完整的Bell實驗室的嵌入式文件系統TFS
?? C
?? 第 1 頁 / 共 5 頁
字號:
    if (sectortoaddr(activesnum,&activessize,(uchar **)&activesbase) == -1)        return(TFSERR_MEMFAIL);    if (verbose)        printf(" Active sector: %3d @ 0x%lx\n",activesnum,(ulong)activesbase);    if (addrtosector((char *)tdp->end,&lastsnum,0,0) < 0)        return(TFSERR_MEMFAIL);    /* Establish a pointer to the defrag header table.     * For the case when the active sector is the last sector, the defrag     * header table will be in the spare, so we also establish a pointer     * to that space...     */    dhp = (struct defraghdr *)crctbl;    dhp -= ftot;    sdhp = (struct defraghdr *)(tdp->spare+activessize -            (tdp->sectorcount * sizeof(struct sectorcrc)));    sdhp -= ftot;    activeaddr = activesbase;    tmpactiveaddr = activesbase;    activesend = activesbase + activessize - 1;    /* FIRST LOOP:     * See if we need to do anything...     * In this state, we are simply checking to see if anything is going     * to cause the currently active sector to be written to.     * If yes, then we need to copy it to the spare and start the     * modification process; else, we just return and do nothing     * to this sector.     * For each file in the defrag header table that is destined for     * the address space occupied by the currently active sector, copy     * that file (header and data) to the active sector...     * Note that it may only be a partial copy, depending on the size     * of the file and the amount of space left in the active sector.     */    noreloctot = 0;    new_fspan = SPANTYPE_UNDEF;    lastfileisnotrelocated = 0;    for(tot=0;tot<ftot;tot++,dhp++,sdhp++) {        fullsize = TFSHDRSIZ + dhp->filsize;        new_fbase = dhp->nda;        new_fend = (new_fbase + fullsize);        /* We must figure out how the new version of the file will         * span across the active sector.         * See defragGetSpantype() for details.         */        new_fspan = defragGetSpantype(activesbase,activesend,            new_fbase,new_fend);        /* If the file we are looking at entirely spans a sector that is         * prior to the currently active sector, then we just continue         * through the list.         * If the file entirely spans a sector that is after the         * currently active sector, then we are done with this active sector.           * If the file falls within the active sector in any way, and its         * new location does not match its old location, then we         * break out of this loop and begin the modification of this         * active sector...         */        if (new_fspan == SPANTYPE_BLEL)            return(0);                if (new_fspan != SPANTYPE_BPEP) {            if (dhp->nda == (char *)dhp->ohdr) {                noreloctot++;                if (tot == ftot-1) {                    lastfileisnotrelocated = 1;                    if (verbose > 1)                        printf("  last file not relocated\n");                }            }            else                break;        }    }    /* If tot == ftot, then we got through the entire loop above without     * finding a file that needs to be relocated into this active sector.     * This means one of two things: either all the files fall into a      * sector prior to this active sector, or the files in this active     * sector do not need to be relocated.  In either case, we simply     * return without touching this sector.     * Note that we also keep track of the possibility that the last file     * may not be relocated.  If this ends up to be the case, then we are     * simply cleaning up one or more dead files after a full set of active     * files, so we should clean up the sector.     */    if ((tot == ftot) && (lastfileisnotrelocated == 0))        return(0);    /* If tot != ftot, then we must subtract noreloctot from tot so that     * we establish 'tot' as the index into the first file that must be     * copied to the active sector...     */    if (noreloctot) {        tot -= noreloctot;        dhp -= noreloctot;        sdhp -= noreloctot;    }    /* Exit immediately before cleaning up the spare... */    defragExitTestPoint(10000+activesnum);    /* Since we got here, we know that we have to do some work on the     * currently active sector.  We may not have to copy it to the spare,     * but we will erase the spare anyway because the sector erase is     * supposed to be smart enough to avoid the erase if it is already      * erased.  This should be handled by the flash driver because in     * ALL cases the erase should be avoided if possible.     */    if (defragEraseSpare(tdp) < 0)        return(TFSERR_FLASHFAILURE);    /* Exit immediately after cleaning up the spare... */    defragExitTestPoint(10001+activesnum);    /* If the active sector is the last sector (which would contain the     * defrag header table), then we reference the copy of the table that     * is in the spare...     * Also, if this is the last sector, then we HAVE to copy it to      * spare, so we can skip the 2nd loop that attempts to determine     * if we need to do it.     */    if (activesnum == lastsnum) {        dhp = sdhp;        copytospare = 1;    }    else {        /* SECOND LOOP:         * See if we need to copy the active sector to the spare...         * We do this by continuing the loop we started above.  Notice that         * we do an almost identical loop again below this.         * On this pass through the loop we are only checking to see if it is         * necessary to copy this active sector to the spare.         */        tmptot = tot;        tmpdhp = dhp;        copytospare = 0;        finfo.mode = FILLMODE_SPAREOVERLAP;        for(;tmptot<ftot;tmptot++,tmpdhp++) {            finfo.tdp = tdp;            finfo.dhp = tmpdhp;            finfo.asnum = activesnum;                fullsize = TFSHDRSIZ + tmpdhp->filsize;            new_fbase = tmpdhp->nda;            new_fend = (new_fbase + fullsize);                new_fspan = defragGetSpantype(activesbase,activesend,                new_fbase,new_fend);                if (new_fspan == SPANTYPE_BPEP)                 continue;            else if (new_fspan == SPANTYPE_BLEL)                break;                /* Now retrieve span information about header and data             * portions of the file (new and orig)...             */            new_hbase = new_fbase;            new_hend = new_hbase + TFSHDRSIZ;            new_dbase = new_hbase + TFSHDRSIZ;            new_dend = new_fend;            orig_fend = ((char *)tmpdhp->ohdr + fullsize);                new_hspan = defragGetSpantype(activesbase,activesend,                new_hbase,new_hend);            new_dspan = defragGetSpantype(activesbase,activesend,                new_dbase,new_dend);                /* If defragFillFlash() returns positive (with mode ==             * FILLMODE_SPAREOVERLAP set above), then we know that the             * spare sector must be loaded with a copy of this active             * sector, so we can break out of this loop at that point...             */            finfo.fhdr = 1;            fillstat = defragFillFlash(&finfo,new_hspan,&tmpactiveaddr,0);            if (fillstat < 0)                return(fillstat);               if (fillstat > 0) {                copytospare = 1;                break;            }            if (new_hspan == SPANTYPE_BCEL)                break;                finfo.fhdr = 0;            fillstat = defragFillFlash(&finfo,new_dspan,&tmpactiveaddr,0);            if (fillstat < 0)                return(fillstat);               if (fillstat > 0) {                copytospare = 1;                break;            }            if (new_dspan == SPANTYPE_BCEL || new_dspan == SPANTYPE_BPEL)                break;        }    }    finfo.mode = FILLMODE_FWRITE;    defragExitTestPoint(10002+activesnum);    if (copytospare) {        defragTick(verbose);#if DEFRAG_TEST_ENABLED        printf("     copying sector %d to spare\n",activesnum);#endif        if (defragFwrite(6,(uchar *)tdp->spare,activesbase,activessize) == -1) {            printf("Failed to copy active %d to spare\n",activesnum);            return(TFSERR_FLASHFAILURE);        }    }#if DEFRAG_TEST_ENABLED    else {        printf("     copy saved\n");    }#endif    defragTick(verbose);    /* We can now begin actual modification of the active sector,     * so start off by eraseing it...     */    defragExitTestPoint(10003+activesnum);    if (defragSerase(4,activesnum) < 0)        return(TFSERR_FLASHFAILURE);    defragExitTestPoint(10004+activesnum);    /* THIRD LOOP:     * Now we pass through the loop to do the real flash modifications...     */    for(;tot<ftot;tot++,dhp++) {        finfo.tdp = tdp;        finfo.dhp = dhp;        finfo.asnum = activesnum;        fullsize = TFSHDRSIZ + dhp->filsize;        new_fbase = dhp->nda;        new_fend = (new_fbase + fullsize);        new_fspan = defragGetSpantype(activesbase,activesend,            new_fbase,new_fend);        if (new_fspan == SPANTYPE_BPEP)             continue;        else if (new_fspan == SPANTYPE_BLEL)            break;        if (verbose)            printf("  File: %s\n",dhp->fname);        /* Now retrieve span information about header and data         * portions of the file (new and orig)...         */        new_hbase = new_fbase;        new_hend = new_hbase + TFSHDRSIZ;        new_dbase = new_hbase + TFSHDRSIZ;        new_dend = new_fend;        orig_fend = ((char *)dhp->ohdr + fullsize);        new_hspan = defragGetSpantype(activesbase,activesend,            new_hbase,new_hend);        new_dspan = defragGetSpantype(activesbase,activesend,            new_dbase,new_dend);        /* At this point we have all the information we need to copy         * the appropriate amount of the file from orignal space         * to new space.         * We have to break the write up into two parts, the header         * (new_hspan) and the data (new_dspan) so we have to look         * at the spantype for each to determine what part of the         * header and/or data we are going to copy.         *         * Also, we must consider the possibility that the source         * data may be in the spare sector.  This would be the case         * if the active sector is the same sector that the original         * data was in.  If the source data is in the spare sector,         * then an added complication is the fact that it may not         * all be there, we may have to copy some from the spare,         * then some from the original space.         */        finfo.fhdr = 1;        fillstat = defragFillFlash(&finfo,new_hspan,&activeaddr,verbose);        if (fillstat < 0)            return(fillstat);           if (new_hspan == SPANTYPE_BCEL)            break;        finfo.fhdr = 0;        fillstat = defragFillFlash(&finfo,new_dspan,&activeaddr,verbose);        if (fillstat < 0)            return(fillstat);           if (new_dspan == SPANTYPE_BCEL || new_dspan == SPANTYPE_BPEL)            break;        defragTick(verbose);    }    return(0);}static intdefragNewSectorCrc(TDEV *tdp, struct defraghdr *dht, int snum, ulong *newcrc){    int     firstsnum;      /* number of first TFS sector */    int     activesnum;     /* number of sector currently being written to */    int     activessize;    /* size of active sector */    char    *activeaddr;    /* offset being written to in the active sector */    char    *activesbase;   /* base address of active sector */    char    *activesend;    /* end address of active sector */    struct  defraghdr *dhp; /* pointer into defrag header table */    int     fullsize;       /* size of file and header */    char    *new_dend;      /* new end of data */    char    *new_dbase;     /* new base of data */    char    *new_hend;      /* new end of header */    char    *new_hbase;     /* new base of header */    char    *new_fend;      /* new end of file */    char    *new_fbase;     /* new base of file */    char    *orig_fend;     /* original end of file */    int     new_fspan;      /* span type for new file */    int     new_hspan;      /* span type for new header */    int     new_dspan;      /* span type for new data */    int     fillstat;       /* result of defragFillFlash() function call */    int     ftot;    char    *tmpactiveaddr;    struct  fillinfo finfo;    struct  sectorcrc   *crctbl;    int     lastsnum, tot, sz, temp;    /* Retrieve number of first TFS sector: */    if (addrtosector((char *)tdp->start,&firstsnum,0,0) < 0)        return(TFSERR_MEMFAIL);    activesnum = snum + firstsnum;    crctbl = defragCrcTable(tdp);    /* Retrieve information about active sector: */    if (sectortoaddr(activesnum,&activessize,(uchar **)&activesbase) == -1)        return(TFSERR_MEMFAIL);    if (addrtosector((char *)tdp->end,&lastsnum,0,0) < 0)        return(TFSERR_MEMFAIL);    dhp = (struct defraghdr *)crctbl - 1;    ftot = dhp->idx + 1;    dhp = dht;    activeaddr = activesbase;    tmpactiveaddr = activesbase;    activesend = activesbase + activessize - 1;    finfo.tdp = tdp;    finfo.crcsz = 0;    finfo.crc = 0xffffffff;    finfo.asnum = activesnum;    finfo.mode = FILLMODE_CRCONLY;    for(tot=0;tot<ftot;tot++,dhp++) {        finfo.dhp = dhp;        fullsize = TFSHDRSIZ + dhp->filsize;        new_fbase = dhp->nda;        new_fend = (new_fbase + fullsize);        new_fspan = defragGetSpantype(activesbase,activesend,            new_fbase,new_fend);        if (new_fspan == SPANTYPE_BPEP)             continue;        else if (new_fspan == SPANTYPE_BLEL)            break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
夜色激情一区二区| 日本伊人色综合网| 日本一二三四高清不卡| 久久久久久免费网| 久久尤物电影视频在线观看| 欧美一区二区精美| 777精品伊人久久久久大香线蕉| 日本韩国欧美国产| 色狠狠桃花综合| 91成人免费网站| 欧美体内she精高潮| 欧美视频在线一区| 欧美美女网站色| 91精品国产入口在线| 制服.丝袜.亚洲.中文.综合| 337p亚洲精品色噜噜狠狠| 91精品国产综合久久久久| 欧美精品日韩一本| 日韩亚洲欧美综合| 欧美电影免费观看高清完整版在线观看 | 日韩免费观看高清完整版| 日韩一区二区在线观看视频播放| 欧美一区二区三区爱爱| 精品国产91洋老外米糕| 久久九九影视网| 国产精品电影一区二区| 一区二区三区在线视频免费观看 | 成人黄页在线观看| 99精品欧美一区二区三区综合在线| 欧洲一区在线电影| 欧美一二三在线| 亚洲国产精品99久久久久久久久 | 亚洲一区在线播放| 日韩精品久久理论片| 国内精品国产成人国产三级粉色| 国产成人av电影| 在线看不卡av| 91精品一区二区三区在线观看| 久久久久久久久久久电影| 亚洲欧美激情一区二区| 午夜精品福利一区二区三区蜜桃| 久久精品国内一区二区三区| 成人黄色软件下载| 欧美日韩一区小说| 久久欧美中文字幕| 亚洲精品亚洲人成人网在线播放| 日韩和欧美一区二区| 成人动漫av在线| 欧美电影在线免费观看| 国产日韩av一区二区| 亚洲午夜电影网| 国产一区二区三区四区五区入口| 色综合天天综合给合国产| 欧美大片一区二区| 亚洲色图在线看| 久久精品国产亚洲a| 99久久精品免费看国产免费软件| 欧美剧情电影在线观看完整版免费励志电影| xnxx国产精品| 亚洲第一福利一区| 成人一区二区三区视频 | 亚洲综合无码一区二区| 久久99精品久久久久久动态图| 91在线精品秘密一区二区| 欧美一区二区播放| 亚洲精品国产a| 国产精品影音先锋| 制服丝袜在线91| 亚洲久本草在线中文字幕| 国产一区二区在线影院| 欧美肥妇bbw| 亚洲人精品一区| 成人午夜私人影院| 2020日本不卡一区二区视频| 亚洲国产精品视频| 91猫先生在线| 国产精品系列在线| 国产综合色视频| 欧美一卡2卡3卡4卡| 亚洲成人自拍网| 91在线观看视频| 中文字幕第一区第二区| 国内精品伊人久久久久影院对白| 欧美日韩一区在线| 亚洲一区二区三区激情| 91在线观看美女| 国产精品福利电影一区二区三区四区| 精品亚洲欧美一区| 日韩欧美一区在线观看| 三级欧美韩日大片在线看| 色视频欧美一区二区三区| 亚洲国产精品成人综合| 国产成人自拍网| 久久久综合视频| 国产精品综合av一区二区国产馆| 日韩欧美在线一区二区三区| 欧美aaaaaa午夜精品| 日韩三级高清在线| 日本不卡一区二区| 欧美一区二区三区四区久久| 亚洲成人免费看| 欧美日韩国产高清一区二区三区 | 一区二区三区 在线观看视频| 成人午夜在线免费| 国产精品视频看| 成人免费黄色大片| 国产精品国产三级国产| 成人app下载| 亚洲天堂福利av| 97精品国产露脸对白| 伊人婷婷欧美激情| 欧美亚洲一区二区在线| 亚瑟在线精品视频| 欧美一卡在线观看| 国产资源精品在线观看| 久久久久综合网| 成人污污视频在线观看| 中文字幕在线一区| 色国产综合视频| 视频一区视频二区中文| 欧美成人一区二区三区片免费| 美国一区二区三区在线播放| 久久综合成人精品亚洲另类欧美| 高清beeg欧美| 亚洲制服丝袜一区| 欧美二区在线观看| 国产精品中文字幕一区二区三区| 欧美国产日本韩| 色婷婷亚洲精品| 无吗不卡中文字幕| 2021中文字幕一区亚洲| 不卡区在线中文字幕| 一区二区三区精品视频| 欧美高清视频www夜色资源网| 美女视频一区在线观看| 国产片一区二区| 欧美三级资源在线| 久久精品国产在热久久| 国产精品成人网| 欧美日韩高清在线播放| 国产综合一区二区| 亚洲天堂a在线| 91精品国产一区二区三区蜜臀| 国产福利精品一区| 一区av在线播放| 精品国产一区二区三区av性色| 成人av网站在线观看免费| 亚洲成av人片一区二区三区| 久久综合视频网| 在线视频欧美精品| 精品在线一区二区| 日韩美女精品在线| 亚洲在线中文字幕| 欧美一区二区女人| 一本到三区不卡视频| 蜜臀av一区二区在线观看| 国产精品污网站| 欧美精选在线播放| 国产盗摄一区二区| 亚洲电影一区二区| 国产亚洲精品资源在线26u| 欧美在线你懂得| 国产suv精品一区二区三区| 亚洲大片在线观看| 国产精品黄色在线观看| 欧美高清一级片在线| 成人激情电影免费在线观看| 日本美女一区二区三区视频| 亚洲天堂av一区| 欧美精品一区二区三区很污很色的| 色域天天综合网| 国产白丝网站精品污在线入口| 婷婷国产v国产偷v亚洲高清| 国产精品国产自产拍高清av| 精品国产一区二区三区av性色| 欧美日韩日日骚| caoporn国产精品| 精品在线你懂的| 亚洲国产精品嫩草影院| 国产精品久久久久久久久快鸭| 日韩午夜小视频| 欧美视频一区二区三区四区 | 国产一区在线精品| 男男视频亚洲欧美| 亚洲综合色噜噜狠狠| 国产欧美一区二区精品性色| 91麻豆精品国产无毒不卡在线观看| 91极品视觉盛宴| 成人高清视频在线| 精品一区二区三区免费| 日本亚洲免费观看| 亚洲午夜羞羞片| 一区二区三区视频在线看| 国产精品嫩草影院av蜜臀| 久久久精品综合| 久久亚洲二区三区| 26uuu久久综合| 久久久青草青青国产亚洲免观| 日韩亚洲欧美一区| 日韩欧美电影一二三|