added large files feature support
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39120 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -129,6 +129,12 @@ Inode::WriteBack(Transaction& transaction)
|
|||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
if (Node().Size() > 0x7fffffffLL) {
|
||||||
|
status = fVolume->ActivateLargeFiles(transaction);
|
||||||
|
if (status != B_OK)
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
CachedBlock cached(fVolume);
|
CachedBlock cached(fVolume);
|
||||||
uint8* inodeBlockData = cached.SetToWritable(transaction, inodeBlock);
|
uint8* inodeBlockData = cached.SetToWritable(transaction, inodeBlock);
|
||||||
if (inodeBlockData == NULL)
|
if (inodeBlockData == NULL)
|
||||||
|
|||||||
@@ -496,6 +496,7 @@ Volume::_UnsupportedIncompatibleFeatures(ext2_super_block& superBlock)
|
|||||||
Volume::_UnsupportedReadOnlyFeatures(ext2_super_block& superBlock)
|
Volume::_UnsupportedReadOnlyFeatures(ext2_super_block& superBlock)
|
||||||
{
|
{
|
||||||
uint32 supportedReadOnly = EXT2_READ_ONLY_FEATURE_SPARSE_SUPER
|
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;
|
||||||
// TODO actually implement EXT2_READ_ONLY_FEATURE_SPARSE_SUPER when
|
// TODO actually implement EXT2_READ_ONLY_FEATURE_SPARSE_SUPER when
|
||||||
// implementing superblock backup copies
|
// implementing superblock backup copies
|
||||||
@@ -588,6 +589,20 @@ Volume::WriteBlockGroup(Transaction& transaction, int32 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
Volume::ActivateLargeFiles(Transaction& transaction)
|
||||||
|
{
|
||||||
|
if ((fSuperBlock.ReadOnlyFeatures()
|
||||||
|
& EXT2_READ_ONLY_FEATURE_LARGE_FILE) != 0)
|
||||||
|
return B_OK;
|
||||||
|
|
||||||
|
fSuperBlock.SetReadOnlyFeatures(fSuperBlock.ReadOnlyFeatures()
|
||||||
|
| EXT2_READ_ONLY_FEATURE_LARGE_FILE);
|
||||||
|
|
||||||
|
return WriteSuperBlock(transaction);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Volume::SaveOrphan(Transaction& transaction, ino_t newID, ino_t& oldID)
|
Volume::SaveOrphan(Transaction& transaction, ino_t newID, ino_t& oldID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
bool HugeFiles() const
|
bool HugeFiles() const
|
||||||
{ return (fSuperBlock.ReadOnlyFeatures()
|
{ return (fSuperBlock.ReadOnlyFeatures()
|
||||||
& EXT2_READ_ONLY_FEATURE_HUGE_FILE) != 0; }
|
& EXT2_READ_ONLY_FEATURE_HUGE_FILE) != 0; }
|
||||||
|
status_t ActivateLargeFiles(Transaction& transaction);
|
||||||
|
|
||||||
status_t SaveOrphan(Transaction& transaction,
|
status_t SaveOrphan(Transaction& transaction,
|
||||||
ino_t newID, ino_t &oldID);
|
ino_t newID, ino_t &oldID);
|
||||||
|
|||||||
@@ -123,7 +123,9 @@ struct ext2_super_block {
|
|||||||
{ free_blocks = B_HOST_TO_LENDIAN_INT32(freeBlocks); }
|
{ free_blocks = B_HOST_TO_LENDIAN_INT32(freeBlocks); }
|
||||||
void SetLastOrphan(ino_t id)
|
void SetLastOrphan(ino_t id)
|
||||||
{ last_orphan = B_HOST_TO_LENDIAN_INT32((uint32)id); }
|
{ last_orphan = B_HOST_TO_LENDIAN_INT32((uint32)id); }
|
||||||
|
void SetReadOnlyFeatures(uint32 readOnlyFeatures) const
|
||||||
|
{ readOnlyFeatures = B_HOST_TO_LENDIAN_INT32(readOnlyFeatures); }
|
||||||
|
|
||||||
bool IsValid();
|
bool IsValid();
|
||||||
// implemented in Volume.cpp
|
// implemented in Volume.cpp
|
||||||
} _PACKED;
|
} _PACKED;
|
||||||
@@ -147,7 +149,7 @@ struct ext2_super_block {
|
|||||||
|
|
||||||
// read-only compatible features
|
// read-only compatible features
|
||||||
#define EXT2_READ_ONLY_FEATURE_SPARSE_SUPER 0x0001
|
#define EXT2_READ_ONLY_FEATURE_SPARSE_SUPER 0x0001
|
||||||
#define EXT2_READ_ONLY_FEATURE_LARGE_FILE 0x0002
|
#define EXT2_READ_ONLY_FEATURE_LARGE_FILE 0x0002
|
||||||
#define EXT2_READ_ONLY_FEATURE_BTREE_DIRECTORY 0x0004
|
#define EXT2_READ_ONLY_FEATURE_BTREE_DIRECTORY 0x0004
|
||||||
#define EXT2_READ_ONLY_FEATURE_HUGE_FILE 0x0008
|
#define EXT2_READ_ONLY_FEATURE_HUGE_FILE 0x0008
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user