Go to the documentation of this file.
18 #include <FreeNOS/User.h>
30 , m_inodeData(inodeData)
68 if (bytes +
sizeof(
Dirent) > size)
132 const String nameStr(name,
false);
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
char name[DIRENT_LEN]
Name of the file.
#define LINN_INODE_NUM_BLOCKS(super, inode)
Calculate the number of blocks used in an LinnInode.
#define LINN_DIRENT_NAME_LEN
Length of the name field in an directory entry.
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Read directory entries.
FileType
All possible filetypes.
Linnenbank FileSystem (LinnFS).
struct Dirent Dirent
Describes an entry inside a Directory.
Directory File functionality.
LinnDirectory(LinnFileSystem *fs, const u32 inode, LinnInode *inodeData)
Constructor function.
le32 block[LINN_INODE_BLOCKS]
Pointers to blocks.
Struct of an directory entry in LinnFS.
virtual File * lookup(const char *name)
Retrieves a File pointer for the given entry name.
Storage * getStorage()
Get the underlying Storage object.
Represents a file present on a FileSystem.
LinnFileSystem * m_fs
Filesystem pointer.
FileSystem::FileType type
Type of file.
LinnInode * getInode(u32 inodeNum)
Read an inode from the filesystem.
unsigned long long u64
Unsigned 64-bit number.
FileSystem::FileModes m_access
Access permissions.
LinnInode * m_inodeData
Inode which describes the directory.
Size m_size
Size of the file, in bytes.
Linnenbank Filesystem (LinnFS) super block.
Represents a file on a mounted LinnFS filesystem.
Abstract Input/Output buffer.
#define NULL
NULL means zero.
unsigned int u32
Unsigned 32-bit number.
Structure of an inode on the disk in the LinnFS filesystem.
unsigned int Size
Any sane size indicator cannot go negative.
Represents an directory on a LinnFS filesystem.
#define LINN_INODE_DIR_BLOCKS
Direct blocks.
bool getLinnDirectoryEntry(LinnDirectoryEntry *dent, const char *name)
Retrieve a directory entry.
le16 mode
Access permissions, as an FileMode.
#define assert(exp)
Insert program diagnostics.
Result
Result code for filesystem Actions.
le16 type
Type of file, as an FileType.
le32 blockSize
Size of each data block.
virtual FileSystem::Result read(const u64 offset, void *buffer, const Size size) const =0
Read a contiguous set of data.
FileSystem::Result write(const void *buffer, const Size size, const Size offset=ZERO)
Write bytes to the I/O buffer.
char name[LINN_DIRENT_NAME_LEN]
File name.
LinnSuperBlock * getSuperBlock()
Retrieve the superblock pointer.
virtual bool equals(const String &str) const
Alias for compareTo().
Describes an entry inside a Directory.
struct LinnDirectoryEntry LinnDirectoryEntry
Struct of an directory entry in LinnFS.
#define LINN_DIRENT_PER_BLOCK(sb)
Calculates the number of LinnDirectoryEntry's fitting in one block.