Inode::Create() now prints out a reason if new_vnode() failed.
If the parent is NULL, Inode::Create() will now set node::parent to the node itself, like BFS is doing it (for root and indices nodes only). Added a temporary hack in Volume::Initialize() to get the inodes freed. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6320 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1965,6 +1965,11 @@ Inode::Create(Transaction *transaction, Inode *parent, const char *name, int32 m
|
||||
|
||||
bfs_inode *node = inode->Node();
|
||||
|
||||
if (parent == NULL) {
|
||||
// we set the parent to itself in this case
|
||||
// (only happens for the root and indices node)
|
||||
node->parent = run;
|
||||
} else
|
||||
node->parent = parentRun;
|
||||
|
||||
node->uid = HOST_ENDIAN_TO_BFS_INT32(geteuid());
|
||||
@@ -2035,8 +2040,9 @@ Inode::Create(Transaction *transaction, Inode *parent, const char *name, int32 m
|
||||
index.InsertLastModified(transaction, inode);
|
||||
}
|
||||
|
||||
if (new_vnode(volume->ID(), inode->ID(), inode) != B_OK) {
|
||||
if ((status = new_vnode(volume->ID(), inode->ID(), inode)) != B_OK) {
|
||||
// this is a really fatal error, and we can't recover from that
|
||||
FATAL(("new_vnode() failed with: %s\n", strerror(status)));
|
||||
DIE(("new_vnode() failed for inode!"));
|
||||
}
|
||||
|
||||
|
||||
@@ -576,6 +576,11 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3
|
||||
if (fIndicesNode != NULL)
|
||||
put_vnode(ID(), fIndicesNode->ID());
|
||||
|
||||
delete fIndicesNode;
|
||||
delete fRootNode;
|
||||
// ToDo: this is a temporary hack until new_vnode()/put_vnode() is working
|
||||
// correctly in the mkbfs command
|
||||
|
||||
Sync();
|
||||
opener.RemoveCache(ALLOW_WRITES);
|
||||
return B_OK;
|
||||
|
||||
Reference in New Issue
Block a user