#15 directory cluster pre-allocation problem

open
nobody
None
5
2007-08-30
2007-08-30
Anonymous
No

When directory cluster preallocation is enabled (CLUSTER_PREALLOC_DIRECTORY > 0), the first allocated sector does not get cleared. In the dir_addCluster() function, the preincrement for logicalc should be changed to a postincrement, as logicalc initially points to the first allocated cluster.

if(CLUSTER_PREALLOC_DIRECTORY){
if(fat_allocClusterChain(fs,&cache,CLUSTER_PREALLOC_DIRECTORY)){
return(-1);
}
logicalc = fat_DiscToLogicCluster(fs,firstCluster,lastc);
while(!fat_LogicToDiscCluster(fs,&cache,logicalc++)){ //Fix for cluster pre-allocation problem
fs_clearCluster(fs,cache.DiscCluster);
}
}else{
fs_clearCluster(fs,lastc);
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks