* Fixed warnings.
* Removed FAT support from the boot loader for now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32276 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -39,7 +39,7 @@ UsePrivateHeaders shared storage ;
|
|||||||
defines +=
|
defines +=
|
||||||
BOOT_SUPPORT_PARTITION_EFI
|
BOOT_SUPPORT_PARTITION_EFI
|
||||||
|
|
||||||
BOOT_SUPPORT_FILE_SYSTEM_FAT
|
#BOOT_SUPPORT_FILE_SYSTEM_FAT
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,14 +108,12 @@ Stream::FindBlock(off_t pos, off_t &block, off_t &offset)
|
|||||||
{
|
{
|
||||||
//TRACE(("FATFS::Stream::%s(%Ld,,)\n", __FUNCTION__, pos));
|
//TRACE(("FATFS::Stream::%s(%Ld,,)\n", __FUNCTION__, pos));
|
||||||
uint32 index = (uint32)(pos / fVolume.ClusterSize());
|
uint32 index = (uint32)(pos / fVolume.ClusterSize());
|
||||||
uint32 cluster;
|
if (pos >= fSize || index >= fClusterCount)
|
||||||
if (pos >= fSize)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
if (index >= fClusterCount)
|
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
uint32 cluster = 0;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
int i;
|
uint32 i;
|
||||||
for (i = 0; i < CLUSTER_MAP_CACHE_SIZE; i++) {
|
for (i = 0; i < CLUSTER_MAP_CACHE_SIZE; i++) {
|
||||||
if (fClusterMapCache[i].block == index) {
|
if (fClusterMapCache[i].block == index) {
|
||||||
cluster = fClusterMapCache[i].cluster;
|
cluster = fClusterMapCache[i].cluster;
|
||||||
@@ -142,7 +140,8 @@ Stream::FindBlock(off_t pos, off_t &block, off_t &offset)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!fVolume.IsValidCluster(cluster))
|
if (!fVolume.IsValidCluster(cluster))
|
||||||
return ENOENT;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
fClusterMapCache[fClusterMapCacheLast].block = index;
|
fClusterMapCache[fClusterMapCacheLast].block = index;
|
||||||
fClusterMapCache[fClusterMapCacheLast].cluster = cluster;
|
fClusterMapCache[fClusterMapCacheLast].cluster = cluster;
|
||||||
fClusterMapCacheLast++;
|
fClusterMapCacheLast++;
|
||||||
@@ -164,22 +163,21 @@ status_t
|
|||||||
Stream::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
Stream::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
||||||
{
|
{
|
||||||
TRACE(("FATFS::Stream::%s(%Ld, )\n", __FUNCTION__, pos));
|
TRACE(("FATFS::Stream::%s(%Ld, )\n", __FUNCTION__, pos));
|
||||||
status_t err;
|
|
||||||
// set/check boundaries for pos/length
|
|
||||||
|
|
||||||
|
// set/check boundaries for pos/length
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
if (pos >= fSize) {
|
if (pos >= fSize) {
|
||||||
*_length = 0;
|
*_length = 0;
|
||||||
return B_NO_ERROR;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// lazily build the cluster list
|
// lazily build the cluster list
|
||||||
if (!fClusters) {
|
if (!fClusters) {
|
||||||
err = BuildClusterList();
|
status_t status = BuildClusterList();
|
||||||
if (err < B_OK)
|
if (status != B_OK)
|
||||||
return err;
|
return status;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -197,7 +195,6 @@ Stream::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
|||||||
|
|
||||||
uint32 bytesRead = 0;
|
uint32 bytesRead = 0;
|
||||||
uint32 blockSize = fVolume.BlockSize();
|
uint32 blockSize = fVolume.BlockSize();
|
||||||
uint32 blockShift = fVolume.BlockShift();
|
|
||||||
uint8 *block;
|
uint8 *block;
|
||||||
|
|
||||||
// the first block_run we read could not be aligned to the block_size boundary
|
// the first block_run we read could not be aligned to the block_size boundary
|
||||||
@@ -251,7 +248,7 @@ Stream::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_pos(fVolume.Device(), fVolume.ToOffset(num),
|
if (read_pos(fVolume.Device(), fVolume.ToOffset(num),
|
||||||
buffer + bytesRead, fVolume.BlockSize()) < B_OK) {
|
buffer + bytesRead, fVolume.BlockSize()) < B_OK) {
|
||||||
*_length = bytesRead;
|
*_length = bytesRead;
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
@@ -272,9 +269,10 @@ Stream::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*_length = bytesRead;
|
*_length = bytesRead;
|
||||||
return B_NO_ERROR;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Stream::BuildClusterList()
|
Stream::BuildClusterList()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user