Now return useful inode numbers. The BFS inode numbers match the ones from
the real kernel file system (as there is no amiga_ffs add-on yet). The file systems now also return the module name of their kernel counterparts. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7995 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
50ef9ecfb6
commit
0e3f14ee1d
@ -134,7 +134,7 @@ Directory::GetNextNode(void *cookie, Node **_node)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
Directory::Rewind(void *cookie)
|
||||
{
|
||||
HashIterator *iterator = (HashIterator *)cookie;
|
||||
@ -144,7 +144,7 @@ Directory::Rewind(void *cookie)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
bool
|
||||
Directory::IsEmpty()
|
||||
{
|
||||
int32 index;
|
||||
@ -152,10 +152,17 @@ Directory::IsEmpty()
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
Directory::GetName(char *name, size_t size) const
|
||||
{
|
||||
return fNode.GetName(name, size);
|
||||
}
|
||||
|
||||
|
||||
ino_t
|
||||
Directory::Inode() const
|
||||
{
|
||||
return fNode.HeaderKey();
|
||||
}
|
||||
|
||||
} // namespace FFS
|
||||
|
@ -35,6 +35,7 @@ class Directory : public ::Directory {
|
||||
virtual bool IsEmpty();
|
||||
|
||||
virtual status_t GetName(char *name, size_t size) const;
|
||||
virtual ino_t Inode() const;
|
||||
|
||||
private:
|
||||
Volume &fVolume;
|
||||
|
@ -247,4 +247,11 @@ File::Size() const
|
||||
return fNode.Size();
|
||||
}
|
||||
|
||||
|
||||
ino_t
|
||||
File::Inode() const
|
||||
{
|
||||
return fNode.HeaderKey();
|
||||
}
|
||||
|
||||
} // namespace FFS
|
||||
|
@ -29,6 +29,7 @@ class File : public Node {
|
||||
virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
|
||||
virtual int32 Type() const;
|
||||
virtual off_t Size() const;
|
||||
virtual ino_t Inode() const;
|
||||
|
||||
private:
|
||||
Volume &fVolume;
|
||||
|
@ -118,6 +118,7 @@ amiga_ffs_get_file_system(boot::Partition *partition, ::Directory **_root)
|
||||
|
||||
|
||||
file_system_module_info gAmigaFFSFileSystemModule = {
|
||||
"file_systems/amiga_ffs/v1",
|
||||
kPartitionTypeAmigaFFS,
|
||||
amiga_ffs_get_file_system
|
||||
};
|
||||
|
@ -179,7 +179,7 @@ Directory::IsEmpty()
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
Directory::GetName(char *name, size_t size) const
|
||||
{
|
||||
if (fStream.inode_num == fStream.GetVolume().Root()) {
|
||||
@ -190,4 +190,11 @@ Directory::GetName(char *name, size_t size) const
|
||||
return fStream.GetName(name, size);
|
||||
}
|
||||
|
||||
|
||||
ino_t
|
||||
Directory::Inode() const
|
||||
{
|
||||
return fStream.ID();
|
||||
}
|
||||
|
||||
} // namespace BFS
|
||||
|
@ -35,6 +35,7 @@ class Directory : public ::Directory {
|
||||
virtual bool IsEmpty();
|
||||
|
||||
virtual status_t GetName(char *name, size_t size) const;
|
||||
virtual ino_t Inode() const;
|
||||
|
||||
private:
|
||||
Stream fStream;
|
||||
|
@ -62,24 +62,31 @@ File::WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
status_t
|
||||
File::GetName(char *nameBuffer, size_t bufferSize) const
|
||||
{
|
||||
return fStream.GetName(nameBuffer, bufferSize);
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
int32
|
||||
File::Type() const
|
||||
{
|
||||
return S_IFREG;
|
||||
}
|
||||
|
||||
|
||||
off_t
|
||||
off_t
|
||||
File::Size() const
|
||||
{
|
||||
return fStream.Size();
|
||||
}
|
||||
|
||||
|
||||
ino_t
|
||||
File::Inode() const
|
||||
{
|
||||
return fStream.ID();
|
||||
}
|
||||
|
||||
} // namespace BFS
|
||||
|
@ -29,6 +29,7 @@ class File : public Node {
|
||||
virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
|
||||
virtual int32 Type() const;
|
||||
virtual off_t Size() const;
|
||||
virtual ino_t Inode() const;
|
||||
|
||||
protected:
|
||||
Stream fStream;
|
||||
|
@ -150,6 +150,7 @@ bfs_get_file_system(boot::Partition *partition, ::Directory **_root)
|
||||
|
||||
|
||||
file_system_module_info gBFSFileSystemModule = {
|
||||
"file_systems/bfs/v1",
|
||||
kPartitionTypeBFS,
|
||||
bfs_get_file_system
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user