git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/LVM - Fixed bugs with reference counting and cleanup
[tpg/acess2.git]
/
KernelLand
/
Modules
/
Storage
/
LVM
/
volumes.c
diff --git
a/KernelLand/Modules/Storage/LVM/volumes.c
b/KernelLand/Modules/Storage/LVM/volumes.c
index
3505498
..
c9ce9a8
100644
(file)
--- a/
KernelLand/Modules/Storage/LVM/volumes.c
+++ b/
KernelLand/Modules/Storage/LVM/volumes.c
@@
-23,7
+23,7
@@
int LVM_AddVolumeVFS(const char *Name, int FD)
return 0;
}
return 0;
}
-int LVM_AddVolume(const tLVM_VolType *Type, const char *Name, void *Ptr, size_t BlockCount)
+int LVM_AddVolume(const tLVM_VolType *Type, const char *Name, void *Ptr, size_t Block
Size, size_t Block
Count)
{
tLVM_Vol dummy_vol;
tLVM_Vol *real_vol;
{
tLVM_Vol dummy_vol;
tLVM_Vol *real_vol;
@@
-33,13
+33,11
@@
int LVM_AddVolume(const tLVM_VolType *Type, const char *Name, void *Ptr, size_t
dummy_vol.Type = Type;
dummy_vol.Ptr = Ptr;
dummy_vol.BlockCount = BlockCount;
dummy_vol.Type = Type;
dummy_vol.Ptr = Ptr;
dummy_vol.BlockCount = BlockCount;
+ dummy_vol.BlockSize = BlockSize;
// Read the first block of the volume
// Read the first block of the volume
- LOG("Type->BlockSize = %i", Type->BlockSize);
- first_block = malloc(Type->BlockSize);
- LOG("first_block = %p", first_block);
+ first_block = malloc(BlockSize);
Type->Read(Ptr, 0, 1, first_block);
Type->Read(Ptr, 0, 1, first_block);
- LOG("first block read");
// Determine Format
// TODO: Determine format
// Determine Format
// TODO: Determine format
@@
-51,11
+49,14
@@
int LVM_AddVolume(const tLVM_VolType *Type, const char *Name, void *Ptr, size_t
// Create real volume descriptor
// TODO: If this needs to be rescanned later, having the subvolume list separate might be an idea
real_vol = malloc( sizeof(tLVM_Vol) + strlen(Name) + 1 + sizeof(tLVM_SubVolume*) * dummy_vol.nSubVolumes );
// Create real volume descriptor
// TODO: If this needs to be rescanned later, having the subvolume list separate might be an idea
real_vol = malloc( sizeof(tLVM_Vol) + strlen(Name) + 1 + sizeof(tLVM_SubVolume*) * dummy_vol.nSubVolumes );
+ real_vol->Next = NULL;
real_vol->Type = Type;
real_vol->Ptr = Ptr;
real_vol->Type = Type;
real_vol->Ptr = Ptr;
+ real_vol->BlockSize = BlockSize;
real_vol->BlockCount = BlockCount;
real_vol->nSubVolumes = dummy_vol.nSubVolumes;
real_vol->SubVolumes = (void*)( real_vol->Name + strlen(Name) + 1 );
real_vol->BlockCount = BlockCount;
real_vol->nSubVolumes = dummy_vol.nSubVolumes;
real_vol->SubVolumes = (void*)( real_vol->Name + strlen(Name) + 1 );
+ real_vol->BlockSize = BlockSize;
strcpy(real_vol->Name, Name);
memset(real_vol->SubVolumes, 0, sizeof(tLVM_SubVolume*) * real_vol->nSubVolumes);
// - VFS Nodes
strcpy(real_vol->Name, Name);
memset(real_vol->SubVolumes, 0, sizeof(tLVM_SubVolume*) * real_vol->nSubVolumes);
// - VFS Nodes
@@
-67,7
+68,7
@@
int LVM_AddVolume(const tLVM_VolType *Type, const char *Name, void *Ptr, size_t
memset(&real_vol->VolNode, 0, sizeof(tVFS_Node));
real_vol->VolNode.Type = &gLVM_VolNodeType;
real_vol->VolNode.ImplPtr = real_vol;
memset(&real_vol->VolNode, 0, sizeof(tVFS_Node));
real_vol->VolNode.Type = &gLVM_VolNodeType;
real_vol->VolNode.ImplPtr = real_vol;
- real_vol->VolNode.Size = BlockCount *
Type->
BlockSize;
+ real_vol->VolNode.Size = BlockCount * BlockSize;
// Type->PopulateSubvolumes
fmt->PopulateSubvolumes(real_vol, first_block);
// Type->PopulateSubvolumes
fmt->PopulateSubvolumes(real_vol, first_block);
@@
-113,7
+114,7
@@
void LVM_int_SetSubvolume_Anon(tLVM_Vol *Volume, int Index, Uint64 FirstBlock, U
sv->Node.ImplPtr = sv;
sv->Node.Type = &gLVM_SubVolNodeType;
sv->Node.ImplPtr = sv;
sv->Node.Type = &gLVM_SubVolNodeType;
- sv->Node.Size = BlockCount * Volume->
Type->
BlockSize;
+ sv->Node.Size = BlockCount * Volume->BlockSize;
Log_Log("LVM", "Partition %s/%s - 0x%llx+0x%llx blocks",
Volume->Name, sv->Name, FirstBlock, BlockCount);
Log_Log("LVM", "Partition %s/%s - 0x%llx+0x%llx blocks",
Volume->Name, sv->Name, FirstBlock, BlockCount);
UCC
git Repository :: git.ucc.asn.au