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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tfsclean1.c

?? 完整的Bell實驗室的嵌入式文件系統(tǒng)TFS
?? C
?? 第 1 頁 / 共 5 頁
字號:
            errstate = 57;            goto state_error;        }        if (defragFwrite(1,sbase,(uchar *)tdp->spare,ssize) < 0) {            errstate = 58;            goto state_error;        }        if (defragEraseSpare(tdp) < 0) {            errstate = 59;            goto state_error;        }        return(SCANNING_ACTIVE_SECTOR_5);    }    /* If we got here, then we are confused, so don't do any defrag     * continuation...     */    errstate = 90;state_error:    printf("DEFRAG_STATE_ERROR: #%d.\n",errstate);    return(SECTOR_DEFRAG_INACTIVE);}/* inSector(): * We are trying to figure out if the address space that we want to copy * from is within the active sector.  If it is, then we need to adjust * our pointers so that we retrieve the at least some of data from the * spare.  * If the range specified by 'i_base' and 'i_size' overlays (in any way) * the address space used by the sector specified by 'snum',  * then return the address in the spare and the size of the overlay. */static intinSector(TDEV *tdp,int snum,uchar *i_base,int i_size,uchar **saddr,int *ovlysz){    int     s_size;    uchar   *s_base, *s_end, *i_end;    /* Retrieve information about the sector: */    if (sectortoaddr(snum,&s_size,&s_base) == -1)        return(TFSERR_MEMFAIL);    i_end = i_base + i_size;    s_end = s_base + s_size;    if ((i_end < s_base) || (i_base > s_end)) {        *ovlysz = 0;        return(0);    }    if (i_base < s_base) {        if (i_end > s_end) {            *ovlysz = s_size;        }        else {            *ovlysz = (i_size - (s_base - i_base));        }        *saddr = (uchar *)tdp->spare;    }    else {        if (i_end > s_end) {            *ovlysz = (i_size - (i_end - s_end));        }        else {            *ovlysz = i_size;        }        *saddr = (uchar *)tdp->spare + (i_base - s_base);    }    return(0);}/* struct fillinfo & FILLMODE definitions: * Structure used by the "Fill" functions below. */#define FILLMODE_FWRITE         1   /* Do the flash write */#define FILLMODE_SPAREOVERLAP   2   /* Determine if there is SPARE overlap */#define FILLMODE_CRCONLY        3   /* Calculate a 32-bit crc on the data */struct fillinfo {    struct defraghdr *dhp;  /* pointer to defrag header table */    TDEV    *tdp;           /* pointer to TFS device */    ulong   crc;            /* used in FILLMODE_CRCONLY mode */    int     crcsz;          /* size of crc calculation */    int     fhdr;           /* set if we're working on a file header */    int     asnum;          /* the active sector */    int     mode;           /* see FILLMODE_xxx definitions */};/* defragFillFlash(): * This function is called by the defragFillActiveSector() function * below.  It covers the four different cases of a file spanning over * the active sector, plus it deals with the possibility that the source * of the file data may be the same sector as the active one (meaning that * the source is taken from the spare).  It is within this function that * the active sector is actually modified and it assumes that the portion * of the active sector to be written to is already erased. *  *  * SPANTYPE_BCEC: * In this case, the file starts in a sector prior to the currently active * sector and ends in the active sector... * -----------|----------|----------|----------|---------|---------|---------- * |          |          |          |          |         |         |         | * |          |          |<-active->|          |         |         |  SPARE  | * |          |          |  sector  |          |         |         |  SECTOR | * |          |          |          |          |         |         |         | * |          |          | newfile  |          |         |         |         | * |          |          | |<-->|   |          |         |         |         | * -----------|----------|----------|----------|---------|---------|---------- * *  * SPANTYPE_BPEC: * In this case, the file starts in a sector prior to the currently active * sector and ends in the active sector... * -----------|----------|----------|----------|---------|---------|---------- * |          |          |          |          |         |         |         | * |          |          |          |<-active->|         |         |  SPARE  | * |          |          |          |  sector  |         |         |  SECTOR | * |          |          |          |          |         |         |         | * |          |      |<----newfile----->|      |         |         |         | * |          |          |          |          |         |         |         | * -----------|----------|----------|----------|---------|---------|---------- * *  * SPANTYPE_BPEL: * In this case, the file starts in some sector prior to the currently * active sector and ends in some sector after the currently active * sector... * -----------|----------|----------|----------|---------|---------|---------- * |          |          |          |          |         |         |         | * |          |          |<-active->|          |         |         |  SPARE  | * |          |          |  sector  |          |         |         |  SECTOR | * |          |          |          |          |         |         |         | * |       |<---------- newfile------------------->|     |         |         | * |          |          |          |          |         |         |         | * -----------|----------|----------|----------|---------|---------|---------- * * * SPANTYPE_BCEL: * In this case, the file starts in the active sector and ends in * a later sector. * -----------|----------|----------|----------|---------|---------|---------- * |          |          |          |          |         |         |         | * |          |<-active->|          |          |         |         |  SPARE  | * |          |  sector  |          |          |         |         |  SECTOR | * |          |          |          |          |         |         |         | * |          |      |<----newfile----->|      |         |         |         | * |          |      ****|          |          |         |         |         | * -----------|----------|----------|----------|---------|---------|---------- */static intdefragFillFlash(struct fillinfo *fip,int spantype,char **activeaddr,int verbose){    char    *hp;    TFILE   nfhdr;    struct  defraghdr *dhp;     int     ohdroffset, nhdroffset;    uchar   *ovly, *src, *activesbase;    int     ovlysz, srcsz, activessize;    src = 0;    srcsz = 0;    nhdroffset = ohdroffset = 0;    dhp = fip->dhp;    if (verbose >= 2) {        printf("   defragFillFlash %s %s\n",fip->fhdr ? "hdr" : "dat",            defragGetSpantypeStr(spantype));    }    if (spantype == SPANTYPE_BCEC) {        if (fip->fhdr) {            src = (uchar *)dhp->ohdr;            srcsz = TFSHDRSIZ;        }        else {            src = (uchar *)dhp->ohdr+TFSHDRSIZ;            srcsz = dhp->filsize;        }    }    else if (spantype == SPANTYPE_BPEC) {        if (fip->fhdr) {            /* Calculate the offset into the header at which point a             * sector boundary occurs.  Do this for both the old (before             * defrag relocation) and new (after defrag relocation)             * location of the header.             */            nhdroffset = TFSHDRSIZ - (dhp->neso - dhp->filsize);            ohdroffset = TFSHDRSIZ - (dhp->oeso - dhp->filsize);            srcsz = dhp->oeso - dhp->filsize + (ohdroffset - nhdroffset);            src = (uchar *)dhp->ohdr + nhdroffset;        }        else {            src = (uchar *)dhp->ohdr + TFSHDRSIZ + (dhp->filsize - dhp->neso);            srcsz = dhp->neso;        }    }    else if (spantype == SPANTYPE_BCEL) {        if (sectortoaddr(fip->asnum,&activessize,&activesbase) == -1)            return(TFSERR_MEMFAIL);        if (fip->fhdr) {            src = (uchar *)dhp->ohdr;        }        else {            src = (uchar *)dhp->ohdr+TFSHDRSIZ;        }        srcsz = (activesbase + activessize) - (uchar *)*activeaddr;    }    else if (spantype == SPANTYPE_BPEL) {        if (sectortoaddr(fip->asnum,&activessize,0) == -1)            return(TFSERR_MEMFAIL);        if (fip->fhdr) {            src = (uchar *)dhp->ohdr;        }        else {            src = (uchar *)dhp->ohdr+TFSHDRSIZ;        }        src += ((*activeaddr - dhp->nda) - TFSHDRSIZ);        srcsz = activessize;     }    else {        return(0);    }    /* Determine if any portion of the source was part of the sector that     * is now the active sector..  If yes (ovlysz > 0), then we must     * deal with the fact that some (or all) of the fill source is in the     * spare sector...     */    if (inSector(fip->tdp,fip->asnum,src,srcsz,&ovly,&ovlysz) < 0)        return(TFSERR_MEMFAIL);    /* If the mode is not FILLMODE_FWRITE, then we don't do any of the     * flash operations.  We are in this function only to determine     * if we need to copy the active sector to the spare prior to      * starting the modification of the active sector.     */    if (fip->mode == FILLMODE_FWRITE) {        if (fip->fhdr) {            hp = (char *)&nfhdr;            if (ovlysz) {                memcpy(hp+nhdroffset,ovly,ovlysz);                if (ovlysz != srcsz) {                    memcpy(hp+nhdroffset+ovlysz,(char *)src+ovlysz,                        srcsz-ovlysz);                }            }            else {                nfhdr = *dhp->ohdr;            }            nfhdr.next = dhp->nextfile;            if (defragFwrite(2,*activeaddr,hp+nhdroffset,srcsz) == -1)                return(TFSERR_FLASHFAILURE);        }        else {            if (ovlysz) {                if (defragFwrite(3,*activeaddr,(char *)ovly,ovlysz) == -1)                    return(TFSERR_FLASHFAILURE);                if (ovlysz != srcsz) {                    if (defragFwrite(4,*activeaddr+ovlysz,(char *)src+ovlysz,                        srcsz-ovlysz) == -1)                        return(TFSERR_FLASHFAILURE);                }            }            else {                if (defragFwrite(5,*activeaddr,(char *)src,srcsz) == -1)                    return(TFSERR_FLASHFAILURE);            }        }    }    else if (fip->mode == FILLMODE_CRCONLY) {        register uchar  *bp;        int     sz, temp;        if (fip->fhdr) {            hp = (char *)&nfhdr;            nfhdr = *dhp->ohdr;            nfhdr.next = dhp->nextfile;            bp = hp + nhdroffset;        }        else {            bp = (uchar *)src;        }        sz = srcsz;        fip->crcsz += sz;        while(sz) {            temp = (fip->crc ^ *bp++) & 0x000000FFL;            fip->crc = ((fip->crc >> 8) & 0x00FFFFFFL) ^ crc32tab[temp];            sz--;        }    }    *activeaddr += srcsz;    if ((spantype == SPANTYPE_BCEC || spantype == SPANTYPE_BPEC) &&        (!fip->fhdr) && ((ulong)*activeaddr & 0xf)) {        int     sz, temp, modfixsize;        modfixsize = (TFS_FSIZEMOD - ((ulong)*activeaddr & (TFS_FSIZEMOD-1)));        *activeaddr += modfixsize;        if (fip->mode == FILLMODE_CRCONLY) {            sz = modfixsize;            fip->crcsz += sz;            while(sz) {                temp = (fip->crc ^ 0xff) & 0x000000FFL;                fip->crc = ((fip->crc >> 8) & 0x00FFFFFFL) ^ crc32tab[temp];                sz--;            }        }    }    /* Return ovlysz so that the caller will know if this function     * needed the spare sector.  This is used in the "mode = SPARE_OVERLAP"     * pass of defragFillActiveSector().     */    return(ovlysz);}/* defragFillActiveSector(): * This and defragFillFlash() are the workhorses of the tfsclean() function. * The bulk of this function is used to determine if we need to do anything * to the active sector and if so, do we need to copy the active sector to * the spare prior to erasing it. * The first loop in this function determines whether we need to do anything * at all with this sector (it may not be touched by the defragmentation). * The second loop determines if we have to copy the active sector to the * spare prior to erasing the active sector. * The final loop in this function does the call to defragFillFlash() * to do the actual flash writes. */static intdefragFillActiveSector(TDEV *tdp, int ftot, int snum, int verbose){    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 *sdhp;/* pointer into defrag hdr table in spare */    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     noreloctot;     /* number of files spanning the active sector */                            /* that do not have to be relocated */    int     tmptot;         /* temps used for the "SPARE_OVERLAP" mode */    char    *tmpactiveaddr;    struct  defraghdr *tmpdhp;    struct  fillinfo finfo;    struct  sectorcrc   *crctbl;    int     lastsnum, tot;    int     copytospare;    int     lastfileisnotrelocated;    /* 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: */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服丝袜日韩国产| 亚洲第一电影网| 国产精品99久久久久久有的能看 | 91精品国产综合久久久久久久| 亚洲视频 欧洲视频| 在线观看一区二区精品视频| 亚洲自拍偷拍欧美| 欧美色电影在线| 五月婷婷综合在线| 欧美一级片在线| 国产电影精品久久禁18| 亚洲欧美日韩在线播放| 99久久精品国产精品久久| 亚洲精品你懂的| 日韩亚洲欧美中文三级| 国产精品91xxx| 中文字幕亚洲一区二区av在线 | 波多野洁衣一区| 91精品国产91综合久久蜜臀| 蜜桃视频第一区免费观看| 国产清纯美女被跳蛋高潮一区二区久久w| 国产高清精品在线| 福利一区在线观看| 欧美一级午夜免费电影| 国产成人精品1024| 亚洲精品国产无天堂网2021| 国产精品福利一区| 日韩视频在线永久播放| 欧美中文字幕亚洲一区二区va在线| 日韩精品午夜视频| 国产精品国产三级国产普通话蜜臀 | 久久久精品综合| 欧美偷拍一区二区| 成人午夜伦理影院| 91色九色蝌蚪| 天堂一区二区在线| 亚洲日韩欧美一区二区在线| 亚洲精品ww久久久久久p站| 一区二区三区国产精华| 欧美亚洲免费在线一区| 99re66热这里只有精品3直播| 极品少妇一区二区| 免费在线观看精品| 欧美精品123区| 欧美色区777第一页| 在线中文字幕一区二区| 一本大道久久精品懂色aⅴ| 成人久久久精品乱码一区二区三区| 欧美日韩国产小视频在线观看| 天天综合网 天天综合色| 夜夜精品视频一区二区| 亚洲综合自拍偷拍| 99在线精品一区二区三区| 波多野结衣亚洲一区| caoporn国产精品| 在线观看国产91| 91精品国产麻豆| 亚洲精品一区二区在线观看| 日韩影院在线观看| 丁香激情综合五月| 97久久精品人人爽人人爽蜜臀| 在线亚洲一区二区| 8v天堂国产在线一区二区| 日韩美一区二区三区| 国产成人免费视频一区| 日韩精品国产欧美| 国产精品久久精品日日| 亚洲综合色区另类av| 蜜臀a∨国产成人精品| 99久久精品国产麻豆演员表| 欧美综合天天夜夜久久| 久久久久国产精品人| 一区二区三区四区av| 久久99国产精品尤物| 在线免费观看日本欧美| 粉嫩欧美一区二区三区高清影视 | 国产日产亚洲精品系列| 欧美一区二区视频在线观看| 国产精品美女久久久久av爽李琼| 午夜视频在线观看一区二区 | 国产麻豆精品theporn| 欧美日韩成人高清| 国产精品久久久久影视| 在线观看亚洲成人| 欧美麻豆精品久久久久久| 亚洲欧洲日韩女同| 国产jizzjizz一区二区| 日韩精品一区二区三区中文精品| 亚洲三级小视频| 99久久综合精品| 中文字幕中文字幕一区二区| 国产伦精品一区二区三区免费迷 | 国产成人精品亚洲777人妖| 欧美日韩在线直播| 久久久.com| 国产高清亚洲一区| 中文字幕精品一区二区精品绿巨人 | 欧美电影免费提供在线观看| 丝袜诱惑亚洲看片| 宅男噜噜噜66一区二区66| 强制捆绑调教一区二区| 欧美乱妇20p| 久久精品国产亚洲高清剧情介绍| 国产福利视频一区二区三区| 精品成人一区二区三区四区| 久久99精品国产麻豆不卡| 久久久三级国产网站| 91网上在线视频| 日韩综合一区二区| 亚洲18影院在线观看| 国产色91在线| 亚洲成人一区在线| 精品女同一区二区| 99re这里只有精品视频首页| 亚洲无线码一区二区三区| 日韩精品一区二区三区中文不卡 | 欧美一区二区日韩一区二区| 国产精品国产自产拍高清av王其| 在线免费视频一区二区| 精品一二三四区| 亚洲精品中文在线观看| 久久久久综合网| 欧美精品久久一区二区三区 | 精品一区二区三区在线播放视频| 亚洲欧洲精品一区二区三区不卡| 欧美精品乱码久久久久久| 粉嫩欧美一区二区三区高清影视| 男女男精品视频| 亚洲小说春色综合另类电影| 国产精品美日韩| 国产午夜亚洲精品理论片色戒| 成人黄色av电影| 国产激情视频一区二区三区欧美 | 久久精品这里都是精品| 欧美一区二区免费| 欧美亚洲一区三区| 91在线码无精品| 精品久久人人做人人爱| 国产91丝袜在线观看| 国产乱人伦偷精品视频免下载| 水野朝阳av一区二区三区| 亚洲激情五月婷婷| 亚洲男人都懂的| 亚洲人妖av一区二区| 亚洲日本在线看| 亚洲综合色区另类av| 亚洲成a人在线观看| 午夜欧美视频在线观看| 一区二区三区日韩精品视频| 欧美综合一区二区三区| 欧美日韩精品免费| 欧美一区二区视频在线观看2020 | 国产不卡免费视频| 成人免费不卡视频| 91精彩视频在线观看| 欧美精品一二三区| 精品99一区二区三区| 亚洲男女毛片无遮挡| 日本在线不卡视频一二三区| 蜜桃av一区二区三区| 丰满少妇在线播放bd日韩电影| 成人18视频在线播放| 欧美人妇做爰xxxⅹ性高电影| 欧美成人三级在线| 综合久久给合久久狠狠狠97色 | 国产日产亚洲精品系列| 亚洲伊人色欲综合网| 国产综合色在线| 欧美日韩精品专区| 国产精品素人一区二区| 视频一区免费在线观看| 成人黄色在线看| 91精品福利在线一区二区三区| 久久精品这里都是精品| 五月天激情综合网| 成人网在线免费视频| 精品欧美一区二区三区精品久久| 中文字幕亚洲精品在线观看 | 欧美不卡一二三| 亚洲成国产人片在线观看| 成人精品免费看| 久久夜色精品一区| 麻豆精品久久精品色综合| 一本大道av伊人久久综合| 国产精品免费久久| 国产精品99久| 风间由美性色一区二区三区| 欧美性一二三区| 欧美成人欧美edvon| 美女视频一区二区| 久久精品一二三| 欧美无砖专区一中文字| 久久不见久久见中文字幕免费| 精品国产一区二区三区不卡| 99精品视频中文字幕| 亚洲美女精品一区| 欧美酷刑日本凌虐凌虐| 激情综合网av| 亚洲另类春色校园小说| 欧美在线综合视频|