20 #include "Ext2Symlink.h" 21 #include "Ext2Filesystem.h" 23 #include "pedigree/kernel/Log.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/utility.h" 34 name, LITTLE_TO_HOST32(inode->i_atime),
35 LITTLE_TO_HOST32(inode->i_mtime), LITTLE_TO_HOST32(inode->i_ctime),
37 LITTLE_TO_HOST32(inode->i_size),
41 uint32_t mode = LITTLE_TO_HOST32(inode->i_mode);
52 uint64_t location, uint64_t size, uintptr_t buffer,
bool canBlock)
54 if (location >= getSize())
56 if ((location + size) >= getSize())
57 size = getSize() - location;
61 if (getSize() && Ext2Node::getInode()->i_blocks == 0)
64 reinterpret_cast<void *>(buffer),
65 adjust_pointer(m_pInode->i_block, location), size);
71 WARNING(
"Ext2: rather large symlink found, not handled yet");
75 uintptr_t block = Ext2Node::readBlock(location);
78 reinterpret_cast<void *>(buffer),
79 reinterpret_cast<void *>(block + offset), size);
85 uint64_t location, uint64_t size, uintptr_t buffer,
bool canBlock)
87 Ext2Node::extend(size);
92 WARNING(
"Ext2: rather large symlink found, not handled yet");
96 uintptr_t block = Ext2Node::readBlock(location);
99 adjust_pointer(reinterpret_cast<void *>(block), offset),
100 reinterpret_cast<void *>(buffer), size);
101 Ext2Node::writeBlock(location);
114 m_Size, m_AccessedTime, m_ModifiedTime, m_CreationTime);
116 getUid(), getGid(), permissionsToMode(getPermissions()));
void setUidOnly(size_t uid)
void setPermissionsOnly(uint32_t perms)
void updateMetadata(uint16_t uid, uint16_t gid, uint32_t perms)
Ext2Symlink(const Ext2Symlink &file)
void setGidOnly(size_t gid)
virtual uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool canBlock)
virtual uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool canBlock)
void fileAttributeChanged()