* Replaced some PRINT with TRACE
* Rename error to status * Fix assignements in udf_read_stat * Added udf_{close_dir,free_dir_cookie} hook functions which prevented udf from mounting the partition It seems mouting an udf partition works correctly but I'm still unable to list its content. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27138 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
89264fe471
commit
e2dc263c43
|
@ -16,28 +16,27 @@
|
||||||
status_t
|
status_t
|
||||||
DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC("DirectoryIterator",
|
TRACE(("DirectoryIterator::GetNextEntry: name = %p, length = %p, id = %p\n",
|
||||||
("name: %p, length: %p, id: %p", name, length, id));
|
name, length, id));
|
||||||
|
|
||||||
if (!id || !name || !length)
|
if (!id || !name || !length)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
PRINT(("fPosition: %Ld\n", fPosition));
|
TRACE(("\tfPosition: %Ld\n", fPosition));
|
||||||
PRINT(("Parent()->Length(): %Ld\n", Parent()->Length()));
|
TRACE(("\tParent()->Length(): %Ld\n", Parent()->Length()));
|
||||||
|
|
||||||
status_t error = B_OK;
|
status_t status = B_OK;
|
||||||
if (fAtBeginning) {
|
if (fAtBeginning) {
|
||||||
sprintf(name, ".");
|
sprintf(name, ".");
|
||||||
*length = 2;
|
*length = 2;
|
||||||
*id = Parent()->Id();
|
*id = Parent()->Id();
|
||||||
fAtBeginning = false;
|
fAtBeginning = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (uint64(fPosition) >= Parent()->Length())
|
if (uint64(fPosition) >= Parent()->Length())
|
||||||
RETURN(B_ENTRY_NOT_FOUND);
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
uint8 data[kMaxFileIdSize];
|
uint8 data[kMaxFileIdSize];
|
||||||
file_id_descriptor *entry = reinterpret_cast<file_id_descriptor*>(data);
|
file_id_descriptor *entry = (file_id_descriptor *)data;
|
||||||
|
|
||||||
uint32 block = 0;
|
uint32 block = 0;
|
||||||
off_t offset = fPosition;
|
off_t offset = fPosition;
|
||||||
|
@ -46,8 +45,8 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
||||||
// First read in the static portion of the file id descriptor,
|
// First read in the static portion of the file id descriptor,
|
||||||
// then, based on the information therein, read in the variable
|
// then, based on the information therein, read in the variable
|
||||||
// length tail portion as well.
|
// length tail portion as well.
|
||||||
error = Parent()->Read(offset, entry, &entryLength, &block);
|
status = Parent()->Read(offset, entry, &entryLength, &block);
|
||||||
if (!error && entryLength >= sizeof(file_id_descriptor)
|
if (!status && entryLength >= sizeof(file_id_descriptor)
|
||||||
&& entry->tag().init_check(block) == B_OK) {
|
&& entry->tag().init_check(block) == B_OK) {
|
||||||
PDUMP(entry);
|
PDUMP(entry);
|
||||||
offset += entry->total_length();
|
offset += entry->total_length();
|
||||||
|
@ -57,7 +56,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
||||||
*length = 3;
|
*length = 3;
|
||||||
} else {
|
} else {
|
||||||
UdfString string(entry->id(), entry->id_length());
|
UdfString string(entry->id(), entry->id_length());
|
||||||
PRINT(("id == `%s'\n", string.Utf8()));
|
TRACE(("\tid == `%s'\n", string.Utf8()));
|
||||||
DUMP(entry->icb());
|
DUMP(entry->icb());
|
||||||
sprintf(name, "%s", string.Utf8());
|
sprintf(name, "%s", string.Utf8());
|
||||||
*length = string.Utf8Length();
|
*length = string.Utf8Length();
|
||||||
|
@ -65,11 +64,11 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
||||||
*id = to_vnode_id(entry->icb());
|
*id = to_vnode_id(entry->icb());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error)
|
if (!status)
|
||||||
fPosition = offset;
|
fPosition = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN(error);
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,31 +101,33 @@ Icb::Icb(Volume *volume, long_address address)
|
||||||
fFileEntry(&fData),
|
fFileEntry(&fData),
|
||||||
fExtendedEntry(&fData)
|
fExtendedEntry(&fData)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC("Icb", ("volume: %p, address(block: %ld, "
|
TRACE(("Icb::Icb: volume = %p, address(block = %ld, partition = %d, "
|
||||||
"partition: %d, length: %ld)", volume, address.block(),
|
"length = %ld)\n", volume, address.block(), address.partition(),
|
||||||
address.partition(), address.length()));
|
address.length()));
|
||||||
status_t error = volume ? B_OK : B_BAD_VALUE;
|
|
||||||
if (!error) {
|
if (volume == NULL)
|
||||||
off_t block;
|
fInitStatus = B_BAD_VALUE;
|
||||||
error = fVolume->MapBlock(address, &block);
|
|
||||||
if (!error) {
|
off_t block;
|
||||||
icb_header *header = (icb_header *)fData.SetTo(block);
|
status_t status = fVolume->MapBlock(address, &block);
|
||||||
if (header->tag().id() == TAGID_FILE_ENTRY) {
|
if (!status) {
|
||||||
file_icb_entry *entry = reinterpret_cast<file_icb_entry*>(header);
|
icb_header *header = (icb_header *)fData.SetTo(block);
|
||||||
PDUMP(entry);
|
if (header->tag().id() == TAGID_FILE_ENTRY) {
|
||||||
(void)entry; // warning death
|
file_icb_entry *entry = (file_icb_entry *)header;
|
||||||
} else if (header->tag().id() == TAGID_EXTENDED_FILE_ENTRY) {
|
PDUMP(entry);
|
||||||
extended_file_icb_entry *entry = reinterpret_cast<extended_file_icb_entry*>(header);
|
(void)entry; // warning death
|
||||||
PDUMP(entry);
|
} else if (header->tag().id() == TAGID_EXTENDED_FILE_ENTRY) {
|
||||||
(void)entry; // warning death
|
extended_file_icb_entry *entry = (extended_file_icb_entry *)header;
|
||||||
} else {
|
PDUMP(entry);
|
||||||
PDUMP(header);
|
(void)entry; // warning death
|
||||||
}
|
} else {
|
||||||
error = header->tag().init_check(address.block());
|
PDUMP(header);
|
||||||
}
|
}
|
||||||
}
|
status = header->tag().init_check(address.block());
|
||||||
fInitStatus = error;
|
}
|
||||||
PRINT(("result: 0x%lx, `%s'\n", error, strerror(error)));
|
|
||||||
|
fInitStatus = status;
|
||||||
|
TRACE(("Icb::Icb: status = 0x%lx, `%s'\n", status, strerror(status)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -171,12 +172,12 @@ Icb::ModificationTime()
|
||||||
status_t
|
status_t
|
||||||
Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC("Icb",
|
TRACE(("Icb::Read: pos = %Ld, buffer = %p, length = (%p)->%ld",
|
||||||
("pos: %Ld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
pos, buffer, length, (length ? *length : 0)));
|
||||||
|
|
||||||
if (!buffer || !length || pos < 0)
|
if (!buffer || !length || pos < 0)
|
||||||
RETURN(B_BAD_VALUE);
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (uint64(pos) >= Length()) {
|
if (uint64(pos) >= Length()) {
|
||||||
*length = 0;
|
*length = 0;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
@ -184,35 +185,36 @@ Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
||||||
|
|
||||||
switch (_IcbTag().descriptor_flags()) {
|
switch (_IcbTag().descriptor_flags()) {
|
||||||
case ICB_DESCRIPTOR_TYPE_SHORT: {
|
case ICB_DESCRIPTOR_TYPE_SHORT: {
|
||||||
PRINT(("descriptor type: short\n"));
|
TRACE(("Icb::Read: descriptor type -> short\n"));
|
||||||
AllocationDescriptorList<ShortDescriptorAccessor> list(this, ShortDescriptorAccessor(0));
|
AllocationDescriptorList<ShortDescriptorAccessor> list(this, ShortDescriptorAccessor(0));
|
||||||
RETURN(_Read(list, pos, buffer, length, block));
|
RETURN(_Read(list, pos, buffer, length, block));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ICB_DESCRIPTOR_TYPE_LONG: {
|
case ICB_DESCRIPTOR_TYPE_LONG: {
|
||||||
PRINT(("descriptor type: long\n"));
|
TRACE(("Icb::Read: descriptor type -> long\n"));
|
||||||
AllocationDescriptorList<LongDescriptorAccessor> list(this);
|
AllocationDescriptorList<LongDescriptorAccessor> list(this);
|
||||||
RETURN(_Read(list, pos, buffer, length, block));
|
RETURN(_Read(list, pos, buffer, length, block));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ICB_DESCRIPTOR_TYPE_EXTENDED: {
|
case ICB_DESCRIPTOR_TYPE_EXTENDED: {
|
||||||
PRINT(("descriptor type: extended\n"));
|
TRACE(("Icb::Read: descriptor type -> extended\n"));
|
||||||
// AllocationDescriptorList<ExtendedDescriptorAccessor> list(this, ExtendedDescriptorAccessor(0));
|
// AllocationDescriptorList<ExtendedDescriptorAccessor> list(this, ExtendedDescriptorAccessor(0));
|
||||||
// RETURN(_Read(list, pos, buffer, length, block));
|
// RETURN(_Read(list, pos, buffer, length, block));
|
||||||
RETURN(B_ERROR);
|
RETURN(B_ERROR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ICB_DESCRIPTOR_TYPE_EMBEDDED: {
|
case ICB_DESCRIPTOR_TYPE_EMBEDDED: {
|
||||||
PRINT(("descriptor type: embedded\n"));
|
TRACE(("Icb::Read: descriptor type: embedded\n"));
|
||||||
RETURN(B_ERROR);
|
RETURN(B_ERROR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PRINT(("Invalid icb descriptor flags! (flags = %d)\n", _IcbTag().descriptor_flags()));
|
TRACE(("Icb::Read: invalid icb descriptor flags! (flags = %d)\n",
|
||||||
|
_IcbTag().descriptor_flags()));
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -222,34 +224,32 @@ Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
||||||
status_t
|
status_t
|
||||||
Icb::Find(const char *filename, ino_t *id)
|
Icb::Find(const char *filename, ino_t *id)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC("Icb",
|
TRACE(("Icb::Find: filename = `%s', id = %p\n", filename, id));
|
||||||
("filename: `%s', id: %p", filename, id));
|
|
||||||
|
|
||||||
if (!filename || !id)
|
if (!filename || !id)
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
|
|
||||||
DirectoryIterator *i;
|
DirectoryIterator *i;
|
||||||
status_t error = GetDirectoryIterator(&i);
|
status_t status = GetDirectoryIterator(&i);
|
||||||
if (!error) {
|
if (status != B_OK)
|
||||||
ino_t entryId;
|
return status;
|
||||||
uint32 length = B_FILE_NAME_LENGTH;
|
|
||||||
char name[B_FILE_NAME_LENGTH];
|
ino_t entryId;
|
||||||
|
uint32 length = B_FILE_NAME_LENGTH;
|
||||||
bool foundIt = false;
|
char name[B_FILE_NAME_LENGTH];
|
||||||
while (i->GetNextEntry(name, &length, &entryId) == B_OK)
|
|
||||||
{
|
bool foundIt = false;
|
||||||
if (strcmp(filename, name) == 0) {
|
while (i->GetNextEntry(name, &length, &entryId) == B_OK) {
|
||||||
foundIt = true;
|
if (strcmp(filename, name) == 0) {
|
||||||
break;
|
foundIt = true;
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foundIt) {
|
|
||||||
*id = entryId;
|
|
||||||
} else {
|
|
||||||
error = B_ENTRY_NOT_FOUND;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN(error);
|
if (foundIt)
|
||||||
|
*id = entryId;
|
||||||
|
else
|
||||||
|
status = B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,13 +116,14 @@ static status_t
|
||||||
udf_get_vnode(fs_volume *_volume, ino_t id, fs_vnode *_node, int *_type,
|
udf_get_vnode(fs_volume *_volume, ino_t id, fs_vnode *_node, int *_type,
|
||||||
uint32 *_flags, bool reenter)
|
uint32 *_flags, bool reenter)
|
||||||
{
|
{
|
||||||
TRACE(("udf_get_vnode: id = %Ld, reenter = %s\n",
|
TRACE(("udf_get_vnode: _volume = %p, _node = %p, reenter = %s\n",
|
||||||
id, (reenter ? "true" : "false")));
|
_volume, _node, (reenter ? "true" : "false")));
|
||||||
|
|
||||||
Volume *volume = (Volume *)_volume->private_volume;
|
Volume *volume = (Volume *)_volume->private_volume;
|
||||||
|
|
||||||
// Convert the given vnode id to an address, and create
|
// Convert the given vnode id to an address, and create
|
||||||
// and return a corresponding Icb object for it.
|
// and return a corresponding Icb object for it.
|
||||||
|
TRACE(("udf_get_vnode: id = %d, blockSize = %d\n", id, volume->BlockSize()));
|
||||||
Icb *icb = new(std::nothrow) Icb(volume,
|
Icb *icb = new(std::nothrow) Icb(volume,
|
||||||
to_long_address(id, volume->BlockSize()));
|
to_long_address(id, volume->BlockSize()));
|
||||||
if (icb) {
|
if (icb) {
|
||||||
|
@ -166,17 +167,17 @@ udf_lookup(fs_volume *_volume, fs_vnode *_directory, const char *file,
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
} else {
|
} else {
|
||||||
status = dir->Find(file, vnodeID);
|
status = dir->Find(file, vnodeID);
|
||||||
if (status == B_OK) {
|
if (status != B_OK)
|
||||||
Icb *icb;
|
return status;
|
||||||
status = get_vnode(volume->FSVolume(), *vnodeID,
|
|
||||||
(void **)&icb);
|
Icb *icb;
|
||||||
if (status != B_OK)
|
status = get_vnode(volume->FSVolume(), *vnodeID, (void **)&icb);
|
||||||
return B_ENTRY_NOT_FOUND;
|
if (status != B_OK)
|
||||||
}
|
return B_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
TRACE(("udf_lookup: vnodeId = %Ld found!\n", *vnodeID));
|
TRACE(("udf_lookup: vnodeId = %Ld found!\n", *vnodeID));
|
||||||
|
|
||||||
return status;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,24 +202,26 @@ udf_put_vnode(fs_volume *volume, fs_vnode *node, bool reenter)
|
||||||
static status_t
|
static status_t
|
||||||
udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
||||||
{
|
{
|
||||||
DEBUG_INIT(NULL);
|
TRACE(("udf_read_stat: _volume = %p, node = %p\n", _volume, node));
|
||||||
|
|
||||||
if (!_volume || !node || !stat)
|
if (!_volume || !node || !stat)
|
||||||
RETURN(B_BAD_VALUE);
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
Volume *volume = (Volume *)_volume->private_volume;
|
Volume *volume = (Volume *)_volume->private_volume;
|
||||||
Icb *icb = reinterpret_cast<Icb*>(node);
|
Icb *icb = (Icb *)node->private_node;
|
||||||
|
|
||||||
//stat->st_dev = volume->Id();
|
stat->st_dev = volume->ID();
|
||||||
stat->st_ino = icb->Id();
|
stat->st_ino = icb->Id();
|
||||||
stat->st_nlink = icb->FileLinkCount();
|
stat->st_nlink = icb->FileLinkCount();
|
||||||
stat->st_blksize = volume->BlockSize();
|
stat->st_blksize = volume->BlockSize();
|
||||||
|
|
||||||
|
TRACE(("udf_read_stat: st_dev = %d, st_ino = %d, st_blksize = %d\n",
|
||||||
|
stat->st_dev, stat->st_ino, stat->st_blksize));
|
||||||
|
|
||||||
stat->st_uid = icb->Uid();
|
stat->st_uid = icb->Uid();
|
||||||
stat->st_gid = icb->Gid();
|
stat->st_gid = icb->Gid();
|
||||||
|
|
||||||
stat->st_mode = icb->Mode();
|
stat->st_mode = icb->Mode();
|
||||||
TRACE(("mode = 0x%lx\n", uint32(icb->Mode())));
|
|
||||||
stat->st_size = icb->Length();
|
stat->st_size = icb->Length();
|
||||||
|
|
||||||
// File times. For now, treat the modification time as creation
|
// File times. For now, treat the modification time as creation
|
||||||
|
@ -227,9 +230,10 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
||||||
stat->st_atime = icb->AccessTime();
|
stat->st_atime = icb->AccessTime();
|
||||||
stat->st_mtime = stat->st_ctime = stat->st_crtime = icb->ModificationTime();
|
stat->st_mtime = stat->st_ctime = stat->st_crtime = icb->ModificationTime();
|
||||||
|
|
||||||
TRACE(("stat->st_ino: %Ld\n", stat->st_ino));
|
TRACE(("udf_read_stat: mode = 0x%lx, st_ino: %Ld\n", stat->st_mode,
|
||||||
|
stat->st_ino));
|
||||||
|
|
||||||
RETURN(B_OK);
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -286,29 +290,46 @@ udf_read(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
|
||||||
static status_t
|
static status_t
|
||||||
udf_open_dir(fs_volume *volume, fs_vnode *vnode, void **cookie)
|
udf_open_dir(fs_volume *volume, fs_vnode *vnode, void **cookie)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(NULL, ("node: %p, cookie: %p", node, cookie));
|
TRACE(("udf_open_dir: volume = %p, vnode = %p\n", volume, vnode));
|
||||||
|
|
||||||
if (!volume || !vnode || !cookie)
|
if (!volume || !vnode || !cookie)
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
|
|
||||||
Icb *dir = (Icb *)vnode->private_node;
|
Icb *dir = (Icb *)vnode->private_node;
|
||||||
|
|
||||||
status_t status = B_OK;
|
if (!dir->IsDirectory()) {
|
||||||
|
TRACE_ERROR(("udf_open_dir: given Icb is not a directory (type: %d)\n",
|
||||||
if (dir->IsDirectory()) {
|
dir->Type()));
|
||||||
DirectoryIterator *iterator = NULL;
|
return B_BAD_VALUE;
|
||||||
status = dir->GetDirectoryIterator(&iterator);
|
|
||||||
if (!status) {
|
|
||||||
*cookie = reinterpret_cast<void*>(iterator);
|
|
||||||
} else {
|
|
||||||
PRINT(("Error getting directory iterator: 0x%lx, `%s'\n", status, strerror(error)));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
PRINT(("Given icb is not a directory (type: %d)\n", dir->Type()));
|
|
||||||
status = B_BAD_VALUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN(status);
|
DirectoryIterator *iterator = NULL;
|
||||||
|
status_t status = dir->GetDirectoryIterator(&iterator);
|
||||||
|
if (status != B_OK) {
|
||||||
|
TRACE_ERROR(("udf_open_dir: error getting directory iterator: 0x%lx, "
|
||||||
|
"`%s'\n", status, strerror(error)));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
*cookie = (void *)iterator;
|
||||||
|
TRACE(("udf_open_dir: *cookie = %p\n", *cookie));
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
udf_close_dir(fs_volume *_volume, fs_vnode *node, void *_cookie)
|
||||||
|
{
|
||||||
|
TRACE(("udf_close_dir: _volume = %p, node = %p\n", _volume, node));
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
udf_free_dir_cookie(fs_volume *_volume, fs_vnode *node, void *_cookie)
|
||||||
|
{
|
||||||
|
TRACE(("udf_free_dir_cookie: _volume = %p, node = %p\n", _volume, node));
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -316,19 +337,19 @@ static status_t
|
||||||
udf_read_dir(fs_volume *_volume, fs_vnode *vnode, void *cookie,
|
udf_read_dir(fs_volume *_volume, fs_vnode *vnode, void *cookie,
|
||||||
struct dirent *dirent, size_t bufferSize, uint32 *_num)
|
struct dirent *dirent, size_t bufferSize, uint32 *_num)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(NULL,
|
TRACE(("udf_read_dir: _volume = %p, vnode = %p, bufferSize = %ld\n",
|
||||||
("dir: %p, iterator: %p, bufferSize: %ld", node, cookie, bufferSize));
|
_volume, vnode, bufferSize));
|
||||||
|
|
||||||
if (!_volume || !vnode || !cookie || !_num || bufferSize < sizeof(dirent))
|
if (!_volume || !vnode || !cookie || !_num || bufferSize < sizeof(dirent))
|
||||||
RETURN(B_BAD_VALUE);
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
Volume *volume = (Volume *)_volume->private_volume;
|
Volume *volume = (Volume *)_volume->private_volume;
|
||||||
Icb *dir = (Icb *)vnode->private_node;
|
Icb *dir = (Icb *)vnode->private_node;
|
||||||
DirectoryIterator *iterator = reinterpret_cast<DirectoryIterator*>(cookie);
|
DirectoryIterator *iterator = (DirectoryIterator *)cookie;
|
||||||
|
|
||||||
if (dir != iterator->Parent()) {
|
if (dir != iterator->Parent()) {
|
||||||
PRINT(("Icb does not match parent Icb of given DirectoryIterator! (iterator->Parent = %p)\n",
|
TRACE_ERROR(("udf_read_dir: Icb does not match parent Icb of given "
|
||||||
iterator->Parent()));
|
"DirectoryIterator! (iterator->Parent = %p)\n", iterator->Parent()));
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,8 +589,8 @@ fs_vnode_ops gUDFVnodeOps = {
|
||||||
NULL, // create_dir
|
NULL, // create_dir
|
||||||
NULL, // remove_dir
|
NULL, // remove_dir
|
||||||
&udf_open_dir,
|
&udf_open_dir,
|
||||||
NULL, // close_dir
|
&udf_close_dir,
|
||||||
NULL, // free_dir_cookie
|
&udf_free_dir_cookie,
|
||||||
&udf_read_dir,
|
&udf_read_dir,
|
||||||
&udf_rewind_dir,
|
&udf_rewind_dir,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue