added some definitions for readonly features
we already support the extra isize feature, so it's now added removed unused Inode::AttributeBlockReadAt() group_descriptor_size was previously a reserved field in the super block git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39125 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -478,36 +478,6 @@ Inode::Resize(Transaction& transaction, off_t size)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
Inode::AttributeBlockReadAt(off_t pos, uint8* buffer, size_t* _length)
|
||||
{
|
||||
TRACE("Inode::%s(%Ld, , %lu)\n", __FUNCTION__, pos, *_length);
|
||||
size_t length = *_length;
|
||||
|
||||
if (!fAttributesBlock) {
|
||||
uint32 block = Node().ExtendedAttributesBlock();
|
||||
|
||||
if (block == 0)
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
|
||||
TRACE("inode %Ld attributes at block %lu\n", ID(), block);
|
||||
fAttributesBlock = (ext2_xattr_header*)block_cache_get(
|
||||
GetVolume()->BlockCache(), block);
|
||||
}
|
||||
|
||||
if (!fAttributesBlock)
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
|
||||
if (pos < 0LL || ((uint32)pos + length) > GetVolume()->BlockSize())
|
||||
return ERANGE;
|
||||
|
||||
memcpy(buffer, ((uint8 *)fAttributesBlock) + (uint32)pos, length);
|
||||
|
||||
*_length = length;
|
||||
return B_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
Inode::InitDirectory(Transaction& transaction, Inode* parent)
|
||||
{
|
||||
|
||||
@@ -87,9 +87,6 @@ public:
|
||||
|
||||
status_t Resize(Transaction& transaction, off_t size);
|
||||
|
||||
status_t AttributeBlockReadAt(off_t pos, uint8 *buffer,
|
||||
size_t *length);
|
||||
|
||||
ext2_inode& Node() { return fNode; }
|
||||
|
||||
status_t InitDirectory(Transaction& transaction, Inode* parent);
|
||||
|
||||
@@ -497,7 +497,8 @@ Volume::_UnsupportedReadOnlyFeatures(ext2_super_block& superBlock)
|
||||
{
|
||||
uint32 supportedReadOnly = EXT2_READ_ONLY_FEATURE_SPARSE_SUPER
|
||||
| EXT2_READ_ONLY_FEATURE_LARGE_FILE
|
||||
| EXT2_READ_ONLY_FEATURE_HUGE_FILE;
|
||||
| EXT2_READ_ONLY_FEATURE_HUGE_FILE
|
||||
| EXT2_READ_ONLY_FEATURE_EXTRA_ISIZE;
|
||||
// TODO actually implement EXT2_READ_ONLY_FEATURE_SPARSE_SUPER when
|
||||
// implementing superblock backup copies
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ struct ext2_super_block {
|
||||
uint32 hash_seed[4];
|
||||
uint8 default_hash_version;
|
||||
uint8 _reserved1;
|
||||
uint16 _reserved2;
|
||||
uint16 group_descriptor_size;
|
||||
uint32 default_mount_options;
|
||||
uint32 first_meta_block_group;
|
||||
uint32 fs_creation_time;
|
||||
@@ -116,6 +116,8 @@ struct ext2_super_block {
|
||||
{ return (ino_t)B_LENDIAN_TO_HOST_INT32(last_orphan); }
|
||||
uint32 HashSeed(uint8 i) const
|
||||
{ return B_LENDIAN_TO_HOST_INT32(hash_seed[i]); }
|
||||
uint16 GroupDescriptorSize() const
|
||||
{ return B_LENDIAN_TO_HOST_INT16(group_descriptor_size); }
|
||||
|
||||
void SetFreeInodes(uint32 freeInodes)
|
||||
{ free_inodes = B_HOST_TO_LENDIAN_INT32(freeInodes); }
|
||||
@@ -152,6 +154,9 @@ struct ext2_super_block {
|
||||
#define EXT2_READ_ONLY_FEATURE_LARGE_FILE 0x0002
|
||||
#define EXT2_READ_ONLY_FEATURE_BTREE_DIRECTORY 0x0004
|
||||
#define EXT2_READ_ONLY_FEATURE_HUGE_FILE 0x0008
|
||||
#define EXT2_READ_ONLY_FEATURE_GDT_CSUM 0x0010
|
||||
#define EXT2_READ_ONLY_FEATURE_DIR_NLINK 0x0020
|
||||
#define EXT2_READ_ONLY_FEATURE_EXTRA_ISIZE 0x0040
|
||||
|
||||
// incompatible features
|
||||
#define EXT2_INCOMPATIBLE_FEATURE_COMPRESSION 0x0001
|
||||
@@ -508,7 +513,7 @@ struct ext2_dir_entry {
|
||||
} _PACKED;
|
||||
|
||||
// file types
|
||||
#define EXT2_TYPE_UNKOWN 0
|
||||
#define EXT2_TYPE_UNKNOWN 0
|
||||
#define EXT2_TYPE_FILE 1
|
||||
#define EXT2_TYPE_DIRECTORY 2
|
||||
#define EXT2_TYPE_CHAR_DEVICE 3
|
||||
|
||||
Reference in New Issue
Block a user