exfat: style fixes only
This commit is contained in:
@@ -108,10 +108,12 @@ DirectoryIterator::Lookup(const char* name, size_t nameLength, ino_t* _id)
|
||||
while (_GetNext((uchar*)currentName, ¤tLength, _id) == B_OK) {
|
||||
char utfName[EXFAT_FILENAME_MAX_LENGTH];
|
||||
size_t utfLength = EXFAT_FILENAME_MAX_LENGTH;
|
||||
unicode_to_utf8(currentName, currentLength, (uint8*)utfName, &utfLength);
|
||||
unicode_to_utf8(currentName, currentLength, (uint8*)utfName,
|
||||
&utfLength);
|
||||
if (nameLength == utfLength
|
||||
&& strncmp(utfName, name, nameLength) == 0) {
|
||||
TRACE("DirectoryIterator::Lookup() found ID %" B_PRIdINO "\n", *_id);
|
||||
TRACE("DirectoryIterator::Lookup() found ID %" B_PRIdINO "\n",
|
||||
*_id);
|
||||
return B_OK;
|
||||
}
|
||||
currentLength = EXFAT_FILENAME_MAX_LENGTH;
|
||||
@@ -263,5 +265,3 @@ DirectoryIterator::_NextEntry()
|
||||
|
||||
return fCurrent->type == 0 ? B_ENTRY_NOT_FOUND : B_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,6 +68,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// #pragma mark - DeviceOpener
|
||||
|
||||
|
||||
DeviceOpener::DeviceOpener(const char* device, int mode)
|
||||
:
|
||||
fBlockCache(NULL)
|
||||
@@ -196,7 +199,7 @@ DeviceOpener::GetSize(off_t* _size, uint32* _blockSize)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - LabelVisitor
|
||||
|
||||
|
||||
class LabelVisitor : public EntryVisitor {
|
||||
@@ -228,7 +231,7 @@ LabelVisitor::VisitLabel(struct exfat_entry* entry)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - exfat_super_block::IsValid()
|
||||
|
||||
|
||||
bool
|
||||
@@ -248,7 +251,7 @@ exfat_super_block::IsValid()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - Volume
|
||||
|
||||
|
||||
Volume::Volume(fs_volume* volume)
|
||||
@@ -292,7 +295,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
{
|
||||
flags |= B_MOUNT_READ_ONLY;
|
||||
// we only support read-only for now
|
||||
|
||||
|
||||
if ((flags & B_MOUNT_READ_ONLY) != 0) {
|
||||
TRACE("Volume::Mount(): Read only\n");
|
||||
} else {
|
||||
@@ -316,11 +319,11 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
ERROR("Volume::Mount(): Identify() failed\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
fBlockSize = 1 << fSuperBlock.BlockShift();
|
||||
TRACE("block size %" B_PRIu32 "\n", fBlockSize);
|
||||
fEntriesPerBlock = (fBlockSize / sizeof(struct exfat_entry));
|
||||
|
||||
|
||||
// check if the device size is large enough to hold the file system
|
||||
off_t diskSize;
|
||||
status = opener.GetSize(&diskSize);
|
||||
@@ -332,7 +335,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
fBlockCache = opener.InitCache(fSuperBlock.NumBlocks(), fBlockSize);
|
||||
if (fBlockCache == NULL)
|
||||
return B_ERROR;
|
||||
|
||||
|
||||
TRACE("Volume::Mount(): Initialized block cache: %p\n", fBlockCache);
|
||||
|
||||
ino_t rootIno;
|
||||
@@ -348,8 +351,8 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
return status;
|
||||
}
|
||||
|
||||
TRACE("Volume::Mount(): Found root node: %" B_PRIdINO " (%s)\n", fRootNode->ID(),
|
||||
strerror(fRootNode->InitCheck()));
|
||||
TRACE("Volume::Mount(): Found root node: %" B_PRIdINO " (%s)\n",
|
||||
fRootNode->ID(), strerror(fRootNode->InitCheck()));
|
||||
|
||||
// all went fine
|
||||
opener.Keep();
|
||||
@@ -512,4 +515,3 @@ Volume::Identify(int fd, exfat_super_block* superBlock)
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ public:
|
||||
Inode * FindInode(ino_t id);
|
||||
Inode * FindInode(cluster_t cluster);
|
||||
cluster_t NextCluster(cluster_t cluster);
|
||||
ino_t GetIno(cluster_t cluster, uint32 offset, ino_t parent);
|
||||
ino_t GetIno(cluster_t cluster, uint32 offset,
|
||||
ino_t parent);
|
||||
struct node_key* GetNode(ino_t ino, ino_t &parent);
|
||||
private:
|
||||
ino_t _NextID() { return fNextId++; }
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef uint64 fsblock_t; // filesystem block number
|
||||
|
||||
typedef uint32 cluster_t;
|
||||
|
||||
|
||||
#define EXFAT_SUPER_BLOCK_OFFSET 0x0
|
||||
|
||||
|
||||
@@ -74,19 +75,20 @@ struct exfat_super_block {
|
||||
|
||||
#define EXFAT_SUPER_BLOCK_MAGIC "EXFAT "
|
||||
|
||||
#define EXFAT_ENTRY_TYPE_BITMAP 0x81
|
||||
#define EXFAT_ENTRY_TYPE_UPPERCASE 0x82
|
||||
#define EXFAT_ENTRY_TYPE_LABEL 0x83
|
||||
#define EXFAT_ENTRY_TYPE_FILE 0x85
|
||||
#define EXFAT_ENTRY_TYPE_FILEINFO 0xc0
|
||||
#define EXFAT_ENTRY_TYPE_FILENAME 0xc1
|
||||
#define EXFAT_CLUSTER_END 0xffffffff
|
||||
#define EXFAT_ENTRY_ATTRIB_SUBDIR 0x10
|
||||
#define EXFAT_ENTRY_TYPE_BITMAP 0x81
|
||||
#define EXFAT_ENTRY_TYPE_UPPERCASE 0x82
|
||||
#define EXFAT_ENTRY_TYPE_LABEL 0x83
|
||||
#define EXFAT_ENTRY_TYPE_FILE 0x85
|
||||
#define EXFAT_ENTRY_TYPE_FILEINFO 0xc0
|
||||
#define EXFAT_ENTRY_TYPE_FILENAME 0xc1
|
||||
#define EXFAT_CLUSTER_END 0xffffffff
|
||||
#define EXFAT_ENTRY_ATTRIB_SUBDIR 0x10
|
||||
|
||||
#define EXFAT_ENTRY_FLAG_CONTIGUOUS 0x3
|
||||
|
||||
#define EXFAT_FILENAME_MAX_LENGTH 512
|
||||
|
||||
|
||||
struct exfat_entry {
|
||||
uint8 type;
|
||||
union {
|
||||
|
||||
@@ -101,7 +101,7 @@ exfat_scan_partition(int fd, partition_data *partition, void *_cookie)
|
||||
|
||||
|
||||
static void
|
||||
exfat_free_identify_partition_cookie(partition_data* partition, void* _cookie)
|
||||
exfat_free_identify_partition_cookie(partition_data* _partition, void* _cookie)
|
||||
{
|
||||
delete (identify_cookie*)_cookie;
|
||||
}
|
||||
@@ -262,7 +262,8 @@ exfat_read_pages(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
|
||||
|
||||
static status_t
|
||||
exfat_io(fs_volume* _volume, fs_vnode* _node, void* _cookie, io_request* request)
|
||||
exfat_io(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
io_request* request)
|
||||
{
|
||||
Volume* volume = (Volume*)_volume->private_volume;
|
||||
Inode* inode = (Inode*)_node->private_node;
|
||||
|
||||
Reference in New Issue
Block a user