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

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

?? dosfsfat.c

?? vxworks的完整的源代碼
?? 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品99久久久久久久久| aaa欧美色吧激情视频| 欧美一区2区视频在线观看| 午夜精品一区二区三区电影天堂| 欧美性大战久久久| 日韩电影一二三区| 26uuu国产电影一区二区| 久久99精品久久久| 日本一区二区三区在线观看| 91香蕉视频污| 亚洲国产精品久久艾草纯爱| 51精品久久久久久久蜜臀| 久99久精品视频免费观看| 久久蜜桃av一区精品变态类天堂 | 捆绑变态av一区二区三区| 欧美mv和日韩mv国产网站| 丰满岳乱妇一区二区三区| 亚洲另类春色国产| 欧美一区二区三区免费视频| 国产精品资源在线| 亚洲一区二区三区视频在线播放| 日韩欧美123| 不卡视频免费播放| 日韩国产在线一| 国产午夜精品久久久久久免费视 | 欧美精品 日韩| 国产乱国产乱300精品| 亚洲乱码中文字幕综合| 欧美一卡二卡三卡| 成人av在线一区二区三区| 天天操天天综合网| 国产欧美精品一区二区色综合朱莉| 色综合天天综合狠狠| 久久91精品国产91久久小草| 一区二区中文视频| 精品国精品自拍自在线| 欧美在线看片a免费观看| 国产成人免费视| 天堂成人国产精品一区| 国产精品你懂的| 精品久久久久久无| 欧美三级日韩在线| av电影天堂一区二区在线| 美美哒免费高清在线观看视频一区二区 | 日本久久电影网| 韩国三级电影一区二区| 亚洲二区视频在线| 日韩理论电影院| 欧美极品少妇xxxxⅹ高跟鞋 | 99免费精品视频| 精品一二三四在线| 日本不卡视频在线| 亚洲风情在线资源站| 亚洲免费在线观看| 国产精品丝袜91| 久久伊人中文字幕| 日韩亚洲欧美在线观看| 欧美午夜寂寞影院| 日本乱码高清不卡字幕| 99久久精品国产导航| 国产精品123区| 国内一区二区在线| 韩国三级中文字幕hd久久精品| 偷拍亚洲欧洲综合| 一卡二卡欧美日韩| 一区二区三区毛片| 亚洲品质自拍视频网站| 中文字幕一区二区三区色视频| 国产午夜精品一区二区| 久久麻豆一区二区| 欧美极品美女视频| 中文天堂在线一区| 国产精品视频线看| 中文字幕一区二区三区不卡在线 | 欧美激情中文字幕| 中文一区一区三区高中清不卡| 国产香蕉久久精品综合网| 精品少妇一区二区三区在线视频| 欧美成人精品1314www| 日韩一区二区三区四区| 精品国产免费人成在线观看| 精品国产123| 国产三级精品在线| 亚洲欧洲三级电影| 一区二区三区精品在线| 亚洲第一狼人社区| 人妖欧美一区二区| 国产综合色精品一区二区三区| 韩国一区二区在线观看| 国产ts人妖一区二区| 成人一级片在线观看| 91色porny在线视频| 欧美日韩一区二区三区高清 | 色域天天综合网| 色偷偷久久人人79超碰人人澡| 欧美亚洲动漫精品| 欧美麻豆精品久久久久久| 日韩亚洲欧美在线观看| 欧美激情自拍偷拍| 亚洲一区二区在线播放相泽| 日本系列欧美系列| 国产成人精品网址| 欧美在线你懂得| 精品国产91九色蝌蚪| 亚洲欧洲精品一区二区精品久久久 | 亚洲香肠在线观看| 麻豆成人在线观看| av网站免费线看精品| 欧美日韩精品欧美日韩精品 | aa级大片欧美| 91精品国产91久久综合桃花| 久久久久97国产精华液好用吗| 中文字幕一区二区5566日韩| 亚洲成人动漫精品| 风间由美一区二区三区在线观看 | 9l国产精品久久久久麻豆| 欧美日韩国产一级二级| 国产日韩亚洲欧美综合| 午夜精品福利一区二区三区蜜桃| 国产在线精品视频| 欧美中文字幕一区二区三区 | 国产精品毛片高清在线完整版| 亚洲一区二区三区四区在线免费观看| 日韩成人精品在线观看| 成人黄页毛片网站| 欧美大胆一级视频| 一区二区三区免费网站| 久久国产免费看| 色综合久久久网| 久久网这里都是精品| 五月婷婷综合网| 91在线视频免费91| 久久综合九色综合97婷婷| 国产成人精品三级| 欧美欧美欧美欧美首页| 中文字幕在线观看一区| 麻豆精品久久精品色综合| 色婷婷精品久久二区二区蜜臀av| 久久久久久亚洲综合| 日韩精品亚洲专区| 欧美综合色免费| 中文字幕日韩一区二区| 黄色资源网久久资源365| 欧美性大战xxxxx久久久| 经典三级视频一区| 欧美日韩三级视频| 亚洲欧美另类小说| eeuss国产一区二区三区| 久久久亚洲国产美女国产盗摄| 男女性色大片免费观看一区二区| 在线看日韩精品电影| 国产精品久久久一本精品| 国产综合色视频| 精品国产一区二区精华 | 国产一区二区三区在线观看免费视频 | 《视频一区视频二区| 国产黄色精品视频| 久久这里都是精品| 狠狠色丁香久久婷婷综合丁香| 91精品国产麻豆| 免费在线观看不卡| 欧美一激情一区二区三区| 五月婷婷久久丁香| 欧美另类久久久品| 丝袜美腿高跟呻吟高潮一区| 欧美视频在线不卡| 日韩有码一区二区三区| 这里只有精品免费| 日本亚洲免费观看| 精品国产伦一区二区三区免费| 免费欧美日韩国产三级电影| 日韩欧美一区在线观看| 久久精品99久久久| ww亚洲ww在线观看国产| 国产乱一区二区| 中文字幕高清不卡| 97se狠狠狠综合亚洲狠狠| 亚洲精品欧美激情| 欧美偷拍一区二区| 美女国产一区二区| 欧美激情一区二区三区| 91在线视频观看| 午夜欧美电影在线观看| 欧美电影免费观看完整版| 国产一区二区三区黄视频 | 精品国产人成亚洲区| 国产一区二区在线影院| 中文久久乱码一区二区| 91蜜桃在线免费视频| 亚洲韩国精品一区| 欧美大胆一级视频| 不卡影院免费观看| 91视频国产观看| 亚洲成人av福利| 精品99一区二区| 91蜜桃在线观看| 美女国产一区二区| 国产精品传媒在线| 91麻豆精品91久久久久同性| 国产一区二区三区日韩|