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

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

?? dosfsfat.c

?? vxworks操作系統(tǒng)的文件系統(tǒng)部分原代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
        }    if ( (startClust < pFileHdl->contigEndPlus1) &&          (startClust >= pFileHdl->startClust) )        {	/* in contiguous area */        cluster = startClust + numClusts;	/* lastClust + 1 */		/* numClusts can be avoided in the function calls and changed 		 * to pFatDesc->fatGroupSize inside the function 		 */        if (cluster >= pFileHdl->contigEndPlus1)            {            cluster = pFileHdl->contigEndPlus1;	/* lastClust + 1 */            nextClust = pFatDesc->dos_fat_eof;            }        else            nextClust = cluster;        DBG_MSG (2, "Get from contiguous area.\n", 1,2,3,4,5,6);        }    else        {	/* out of contiguous area */        /* Count number of contiguous clusters starting from <startClust> */        maxClust = startClust + numClusts;        if (maxClust > pFatDesc->nFatEnts)            maxClust = pFatDesc->nFatEnts;        cluster = startClust;			/* initialize cluster number */        while (cluster < maxClust)            {            nextClust = ENTRY_READ (pFd, pFatDesc->dosFatDesc.activeCopyNum,                                    cluster);	/* follow chain */            if (nextClust != ++cluster)                break;				/* end of contiguous area */            }        if (pFatHdl->errCode == FAT_CBIO_ERR)            return ERROR;        }#ifdef	__unused    assert ( ((nextClust >= DOS_MIN_CLUST)&&              (nextClust < pFatDesc->nFatEnts)) ||             ((nextClust > pFatDesc->dos_fat_bad) &&               (nextClust <= pFatDesc->dos_fat_eof)) );#endif    /* Store contents of last entry in contiguous section */    pFatHdl->nextClust = nextClust;    pFatHdl->lastClust = cluster - 1;    pFd->curSec = CLUST_TO_SEC (pVolDesc, startClust);    pFd->nSec   = (cluster - startClust) * pVolDesc->secPerClust;    DBG_MSG (2, "Get %ld clusters starting from cluster %ld\n",              cluster - startClust, startClust,3,4,5,6);    return OK;    } /* fat16ContigGet *//********************************************************************************* fat16MarkAlloc - allocate a contiguous set of clusters*** RETURNS: ERROR if was unable to allocate requested amount of space*/LOCAL STATUS fat16MarkAlloc    (    FAST DOS_FILE_DESC_ID	pFd,		/* pointer to file descriptor */    FAST uint32_t		firstClust,	/* initial cluster to search */    FAST uint32_t		numClusts	/* number of clusters needed */    )    {    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pFd->pVolDesc->pFatDesc;						/* pointer to FAT descriptor */    FAST uint32_t		curClust;	/* current cluster number */    assert ((firstClust >= DOS_MIN_CLUST) &&             (firstClust < pFatDesc->nFatEnts));    assert (numClusts <= (pFatDesc->nFatEnts - DOS_MIN_CLUST));    /* Build cluster chain in FAT */    for (curClust = firstClust;          curClust < (firstClust + numClusts - 1);          curClust++)        {        /* Each entry = next clust. num. */        if (ENTRY_WRITE (pFd, pFatDesc->dosFatDesc.activeCopyNum,                         curClust, curClust + 1) != OK)            return ERROR;	/* disk access error */        /* Update free clusters counter */        pFatDesc->fatEntFreeCnt--;        }    /* Mark last entry as end of file cluster chain */    if (ENTRY_WRITE (pFd, pFatDesc->dosFatDesc.activeCopyNum, curClust,                     pFatDesc->dos_fat_eof) != OK)        return ERROR;		/* disk access error */    pFatDesc->fatEntFreeCnt--;    return OK;    } /* fat16MarkAlloc *//********************************************************************************* fat16GetNext - get/allocate next cluster for file** This routine searches the File Allocation Table (FAT) for a sequence* of contiguous free clusters, and allocates clusters to extend the* current chain if requested to do so.** RETURNS: resulting chain of sectors in the File Descriptor structure.*/LOCAL STATUS fat16GetNext    (    FAST DOS_FILE_DESC_ID pFd,		/* pointer to file descriptor */    FAST uint_t		  allocPolicy	/* allocation policy */    )    {    FAST DOS_FILE_HDL_ID	pFileHdl = pFd->pFileHdl;						/* pointer to file handle */    FAST DOS_FAT_HDL_ID		pFatHdl = &pFd->fatHdl;						/* pointer to FAT handle */    FAST DOS_VOLUME_DESC_ID	pVolDesc = pFd->pVolDesc;					/* pointer to volume descriptor */    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pVolDesc->pFatDesc;						/* pointer to FAT descriptor */    FAST uint32_t		startClust;	/*  */    FAST uint32_t		numClusts;	/*  */    FAST uint32_t		prevClust;	/*  */    FAST uint32_t		firstClust;	/*  */    FAST uint32_t		contigCount;	/* count of fit clusters */    FAST uint32_t		curClust;	/* current cluster number */    FAST uint32_t		fatEntry;	/* FAT entry */    FAST uint32_t		maxClust;	/* maximum cluster number */    FAST uint32_t		pass;		/*  */    /* Try to follow file chain */    if (fat16ContigGet (pFd, pFatDesc->fatGroupSize) == OK)        return OK;    if (pFatHdl->errCode == FAT_CBIO_ERR)        return ERROR;    /* Can't follow file chain */    if ((allocPolicy & FAT_ALLOC) == 0)		/* not alloc */        return ERROR;    firstClust = pFatHdl->nextClust;    prevClust  = pFatHdl->lastClust;    startClust = 0;    /* Set number of clusters to allocate.     */    if (pFatDesc->groupAllocStart == 0)	/* no free groups in prev. alloc. */        allocPolicy = FAT_ALLOC_ONE;    numClusts = (allocPolicy == (uint_t)FAT_ALLOC_ONE) ? 					1 : pFatDesc->fatGroupSize;    /* Set initial cluster number to try allocation from.     */    if (firstClust > pFatDesc->dos_fat_bad)		/* end of file chain */        startClust = prevClust;    else if ((firstClust == 0) && (prevClust == 0))	/* it is a new file */        startClust = (allocPolicy == (uint_t)FAT_ALLOC_ONE) ?                     pFatDesc->clustAllocStart : pFatDesc->groupAllocStart;    if (startClust == 0)        {        errnoSet (S_dosFsLib_ILLEGAL_CLUSTER_NUMBER);        return ERROR;        }    /* Try finding a set of clusters starting at or after the initial one.     *   Continue searching upwards until end of FAT.     */    maxClust    = pFatDesc->nFatEnts - 1;    curClust    = startClust;		/* start from initial cluster number */    firstClust  = 0;    contigCount = 0;    semTake (pFatDesc->allocSem, WAIT_FOREVER);    for (pass = 0; pass < 2; pass++)        {        while (curClust <= maxClust)            {            fatEntry = ENTRY_READ (pFd, pFatDesc->dosFatDesc.activeCopyNum,                                   curClust);            if ((fatEntry == FAT_CBIO_ERR)&&(pFatHdl->errCode == FAT_CBIO_ERR))                goto group_alloc_error;            if (fatEntry == pFatDesc->dos_fat_avail)                {	/* free space */                if (contigCount == 0)                    firstClust = curClust;/* this one will be new start */                if (++contigCount == numClusts)	/* one more found */                    goto group_alloc;		/* quit if enough found */                }            else	/* allocated space */                {                contigCount = 0;                }            curClust++;            } /* while */        /* 	 * Try finding a contiguous area starting before the current cluster         * Note that the new contiguous area could include the initial cluster         */        maxClust    = startClust - 1;        curClust    = DOS_MIN_CLUST;	/* start from lowest cluster number */        contigCount = 0;        } /* for */    if (firstClust == 0)        {        errnoSet (S_dosFsLib_DISK_FULL);        ERR_MSG (1, "!!! DISK FULL !!!\n", 1,2,3,4,5,6);        goto group_alloc_error;	/* could not find space */        }    pFatDesc->groupAllocStart = 0;    numClusts = 1;group_alloc:	/* Allocate the found chain */    if (fat16MarkAlloc (pFd, firstClust, numClusts) != OK)        goto group_alloc_error;    semGive (pFatDesc->allocSem);    DBG_MSG (1, "Allocated %ld clusters starting from cluster %ld\n",              contigCount, firstClust,3,4,5,6);    /*  */    if (startClust == prevClust)        {        /* Add just allocated contiguous section to the file chain */        if (ENTRY_WRITE (pFd, pFatDesc->dosFatDesc.activeCopyNum,                        prevClust, firstClust) != OK)            return ERROR;        if (firstClust == pFileHdl->contigEndPlus1)            pFileHdl->contigEndPlus1 = firstClust + numClusts;        DBG_MSG (1, " ----- Old end %ld -----\n", prevClust,2,3,4,5,6);        }    else        {        /* Advance start allocation cluster number */        if (allocPolicy == (uint_t)FAT_ALLOC_ONE)            pFatDesc->clustAllocStart = firstClust + 1;        else            if (pFatDesc->groupAllocStart != 0)                pFatDesc->groupAllocStart = firstClust + numClusts;        DBG_MSG (1, " ----- Old start %ld -----\n", startClust,2,3,4,5,6);        DBG_MSG (1, " ----- New start %ld -----\n", firstClust,2,3,4,5,6);        pFileHdl->startClust = firstClust;        pFileHdl->contigEndPlus1  = firstClust + numClusts;        }    pFatHdl->nextClust = pFatDesc->dos_fat_eof;    pFatHdl->lastClust = firstClust + numClusts - 1;    pFd->curSec = CLUST_TO_SEC (pVolDesc, firstClust);    pFd->nSec   = numClusts * pVolDesc->secPerClust;    return OK;group_alloc_error:    semGive (pFatDesc->allocSem);    return ERROR;    } /* fat16GetNext *//********************************************************************************* fat16Truncate - truncate chain starting from cluster** This routine is used when removing files and directories as well as* when truncating files. It will follow* a chain of cluster entries in the file allocation table (FAT), freeing each* as it goes.** RETURNS: OK or ERROR if invalid cluster encountered in chain*/LOCAL STATUS fat16Truncate    (    FAST DOS_FILE_DESC_ID	pFd,	/* pointer to file descriptor */    FAST uint32_t		sector,		/* sector to truncate from */    FAST uint32_t		flag		/* FH_INCLUDE or FH_EXCLUDE */    )    {    FAST DOS_FILE_HDL_ID	pFileHdl = pFd->pFileHdl;					/* pointer to file handle */    FAST DOS_VOLUME_DESC_ID	pVolDesc = pFd->pVolDesc;					/* pointer to volume descriptor */    FAST MS_FAT_DESC_ID	pFatDesc = (void *) pVolDesc->pFatDesc;						/* pointer to FAT descriptor */    FAST uint32_t		curClust;	/* current cluster */    FAST uint32_t		nextClust;	/* next cluster in chain */    FAST uint32_t		cluster;	/* cluster to truncate from */    if (sector == FH_FILE_START)        {        cluster = pFileHdl->startClust;        pFileHdl->contigEndPlus1 = 0;        if (cluster < DOS_MIN_CLUST)            {            errnoSet (S_dosFsLib_INVALID_PARAMETER);	/* ??? */            return ERROR;            }        }    else        {        if (sector < pVolDesc->dataStartSec)            {            errnoSet (S_dosFsLib_INVALID_PARAMETER);            return ERROR;            }        cluster = SEC_TO_CLUST (pVolDesc, sector);        }    if (cluster >= pFatDesc->nFatEnts)        {        errnoSet (S_dosFsLib_INVALID_PARAMETER);	/* ??? */        return ERROR;        }    switch (flag )        {        case FH_INCLUDE:            if ((sector == FH_FILE_START) ||                (((sector - pVolDesc->dataStartSec) %                     pVolDesc->secPerClust) == 0))                {                curClust = cluster;                break;                }        case FH_EXCLUDE:            /* Read cluster to truncate from, including this one */                curClust = ENTRY_READ (pFd, pFatDesc->dosFatDesc.activeCopyNum,                                   cluster);                if (curClust > pFatDesc->dos_fat_bad)                return OK;	/* end of file */            if ((curClust < DOS_MIN_CLUST) || (curClust >= pFatDesc->nFatEnts))                return ERROR;	/*  */                /* Mark passed cluster as end of file */                if (ENTRY_WRITE (pFd, pFatDesc->dosFatDesc.activeCopyNum,                             cluster, pFatDesc->dos_fat_eof) != OK)                return ERROR;	/* disk access error */            break;        default:            {            errnoSet (S_dosFsLib_INVALID_PARAMETER);            return ERROR;            }        }    if ( (curClust < pFileHdl->contigEndPlus1) &&          (curClust >= pFileHdl->startClust) )        pFileHdl->contigEndPlus1 = curClust;    if (pFatDesc->groupAllocStart == 0)        pFatDesc->groupAllocStart = curClust;   /* Adjust single cluster allocation start point to start of the disk */    if (pFatDesc->clustAllocStart > curClust)        pFatDesc->clustAllocStart = curClust;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人在线综合网站| 91精品视频网| 欧美日韩激情一区| 国产日韩v精品一区二区| 亚洲国产日产av| 风流少妇一区二区| 日韩一级片网址| 同产精品九九九| 色哟哟国产精品| 国产精品久久久久7777按摩| 精品一区精品二区高清| 欧美精品丝袜中出| 亚洲综合一区二区| 91麻豆精东视频| 国产精品视频观看| 国产精品一级在线| 久久综合狠狠综合久久激情 | 成人免费毛片嘿嘿连载视频| 538prom精品视频线放| 亚洲黄一区二区三区| 成人a区在线观看| 国产香蕉久久精品综合网| 日韩电影在线看| 这里只有精品免费| 丝袜亚洲另类欧美| 91精品麻豆日日躁夜夜躁| 天使萌一区二区三区免费观看| 91美女精品福利| 亚洲日本va午夜在线影院| 99re在线视频这里只有精品| 成人欧美一区二区三区1314| 成人免费观看视频| 国产精品美女一区二区在线观看| 国产91丝袜在线播放0| 久久久精品tv| 东方欧美亚洲色图在线| 国产精品欧美一区二区三区| 成人一区二区三区视频| 国产精品久久久久婷婷| 白白色 亚洲乱淫| 亚洲欧美日韩久久| 欧美三级资源在线| 全国精品久久少妇| 久久综合国产精品| 国产一区二区不卡| 国产精品久久久久久久久久免费看 | 国产一区二区在线看| 久久一留热品黄| 国产999精品久久| 自拍偷自拍亚洲精品播放| 色94色欧美sute亚洲13| 午夜精品久久久久久久 | 国产精品毛片a∨一区二区三区| 国产69精品久久久久毛片 | 美女视频一区在线观看| 久久综合给合久久狠狠狠97色69| 国产白丝精品91爽爽久久 | 国产精品欧美精品| 欧美在线一二三四区| 久久黄色级2电影| 国产精品视频看| 在线播放91灌醉迷j高跟美女| 久久精品国产77777蜜臀| 中文字幕第一区二区| 欧美视频三区在线播放| 国产福利一区二区三区视频在线 | 日本不卡在线视频| 国产精品视频线看| 欧美一区二区三区小说| 99久久精品免费看| 久久99九九99精品| 亚洲精品一卡二卡| 久久品道一品道久久精品| 色国产综合视频| 国产在线精品一区二区三区不卡 | 欧美日韩一区二区三区视频| 国产毛片精品国产一区二区三区| 一区二区三区小说| 国产网红主播福利一区二区| 欧美性淫爽ww久久久久无| 国产成人激情av| 另类欧美日韩国产在线| 亚洲日穴在线视频| 久久综合网色—综合色88| 欧美三级视频在线观看| 成人a区在线观看| 韩国在线一区二区| 日本午夜精品一区二区三区电影| 亚洲欧美成人一区二区三区| 国产亚洲1区2区3区| 制服丝袜中文字幕亚洲| 色综合中文字幕国产 | kk眼镜猥琐国模调教系列一区二区| 日韩制服丝袜av| 亚洲综合久久久久| 国产精品国产三级国产a| 精品国产伦一区二区三区免费| 欧美喷潮久久久xxxxx| 色综合欧美在线| av中文字幕在线不卡| 国产成人高清视频| 国产成人一级电影| 国产一区二区三区不卡在线观看| 午夜精品久久久久久不卡8050| 亚洲女人****多毛耸耸8| 国产精品视频在线看| 亚洲国产高清在线| 国产女人aaa级久久久级| 久久亚洲影视婷婷| 精品成人a区在线观看| 精品国产一区二区精华| 欧美一卡在线观看| 欧美一二区视频| 欧美三级一区二区| 777午夜精品视频在线播放| 欧美理论在线播放| 91精品国产一区二区三区| 欧美久久久久久久久| 欧美日韩精品二区第二页| 777久久久精品| 日韩欧美成人一区| 欧美成人一区二区三区片免费| 日韩欧美精品三级| www激情久久| 亚洲国产精品t66y| 亚洲精品视频在线观看网站| 综合av第一页| 午夜视频在线观看一区二区| 丝袜亚洲另类欧美| 国内精品国产三级国产a久久 | 免费黄网站欧美| 捆绑变态av一区二区三区| 国产精品一二二区| 99久久国产综合精品女不卡| 在线观看av一区二区| 91麻豆精品久久久久蜜臀| 精品国产免费久久| 一区免费观看视频| 婷婷综合另类小说色区| 国产伦精品一区二区三区视频青涩 | 欧美国产综合色视频| 一区二区三区四区乱视频| 蜜臂av日日欢夜夜爽一区| 福利一区在线观看| 欧美日韩一区三区四区| 久久嫩草精品久久久久| 亚洲免费观看高清| 免费在线观看一区| av中文字幕一区| 日韩一级大片在线| 成人免费在线播放视频| 日本成人超碰在线观看| 99久久精品免费| 精品久久国产字幕高潮| 亚洲猫色日本管| 久久99国产精品久久99| 91免费观看在线| 欧美成人精精品一区二区频| 亚洲男女一区二区三区| 国产中文字幕一区| 欧美综合色免费| 国产人伦精品一区二区| 青青草原综合久久大伊人精品优势| 粉嫩13p一区二区三区| 欧美一区二区视频在线观看2020| 亚洲国产激情av| 精品一二三四区| 欧美日韩在线三区| 国产精品久久夜| 国产综合色在线视频区| 欧美写真视频网站| 欧美国产激情二区三区 | 欧美精品一区二区不卡| 亚洲国产精品嫩草影院| 不卡区在线中文字幕| 日韩一区二区三区观看| 一区二区三区精品在线观看| 国产a级毛片一区| 欧美一级视频精品观看| 亚洲成av人影院| 在线一区二区视频| 中文字幕一区不卡| 粗大黑人巨茎大战欧美成人| 日韩你懂的在线播放| 日本欧美一区二区| 欧美精品久久久久久久久老牛影院| 亚洲欧美在线视频观看| 成人黄色网址在线观看| 国产欧美视频在线观看| 国产美女娇喘av呻吟久久| 精品剧情v国产在线观看在线| 视频一区视频二区中文字幕| 欧美日韩一区二区三区免费看 | 日韩理论片网站| 成人听书哪个软件好| 国产亚洲精品资源在线26u| 久久99国产精品免费网站| 精品99999| 国产suv精品一区二区三区| 国产日韩欧美亚洲|