Switched from Inode::IsDirectory() to Inode::IsContainer() where necessary.
Now makes use of the changed Inode::Create() logic. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2031 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -353,7 +353,7 @@ BPlusTree::SetTo(Inode *stream)
|
|||||||
|
|
||||||
if (fHeader->data_type > BPLUSTREE_DOUBLE_TYPE
|
if (fHeader->data_type > BPLUSTREE_DOUBLE_TYPE
|
||||||
|| (stream->Mode() & S_INDEX_DIR) && toMode[fHeader->data_type] != mode
|
|| (stream->Mode() & S_INDEX_DIR) && toMode[fHeader->data_type] != mode
|
||||||
|| !stream->IsDirectory()) {
|
|| !stream->IsContainer()) {
|
||||||
D( dump_bplustree_header(fHeader);
|
D( dump_bplustree_header(fHeader);
|
||||||
dump_inode(stream->Node());
|
dump_inode(stream->Node());
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -176,15 +176,9 @@ Index::Create(Transaction *transaction,const char *name,uint32 type)
|
|||||||
RETURN_ERROR(status);
|
RETURN_ERROR(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
vnode_id id;
|
// Inode::Create() will keep the inode locked for us
|
||||||
status = Inode::Create(transaction,fVolume->IndicesNode(),name,S_INDEX_DIR | S_DIRECTORY | mode,0,type,&id);
|
return Inode::Create(transaction, fVolume->IndicesNode(), name,
|
||||||
if (status == B_OK) {
|
S_INDEX_DIR | S_DIRECTORY | mode, 0, type, NULL, &fNode);
|
||||||
// since Inode::Create() lets the created inode open if "id" is specified,
|
|
||||||
// we don't need to call Vnode::Keep() here
|
|
||||||
Vnode vnode(fVolume,id);
|
|
||||||
return vnode.Get(&fNode);
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ Volume::Mount(const char *deviceName, uint32 flags)
|
|||||||
fIndicesNode = new Inode(this, ToVnode(Indices()));
|
fIndicesNode = new Inode(this, ToVnode(Indices()));
|
||||||
if (fIndicesNode == NULL
|
if (fIndicesNode == NULL
|
||||||
|| fIndicesNode->InitCheck() < B_OK
|
|| fIndicesNode->InitCheck() < B_OK
|
||||||
|| !fIndicesNode->IsDirectory()) {
|
|| !fIndicesNode->IsContainer()) {
|
||||||
INFORM(("bfs: volume doesn't have indices!\n"));
|
INFORM(("bfs: volume doesn't have indices!\n"));
|
||||||
|
|
||||||
if (fIndicesNode) {
|
if (fIndicesNode) {
|
||||||
@@ -236,17 +236,12 @@ Volume::CreateIndicesRoot(Transaction *transaction)
|
|||||||
{
|
{
|
||||||
off_t id;
|
off_t id;
|
||||||
status_t status = Inode::Create(transaction, NULL, NULL,
|
status_t status = Inode::Create(transaction, NULL, NULL,
|
||||||
S_INDEX_DIR | S_STR_INDEX | S_DIRECTORY | 0700, 0, 0, &id);
|
S_INDEX_DIR | S_STR_INDEX | S_DIRECTORY | 0700, 0, 0, &id, &fIndicesNode);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
RETURN_ERROR(status);
|
RETURN_ERROR(status);
|
||||||
|
|
||||||
fSuperBlock.indices = ToBlockRun(id);
|
fSuperBlock.indices = ToBlockRun(id);
|
||||||
WriteSuperBlock();
|
return WriteSuperBlock();
|
||||||
|
|
||||||
// The Vnode destructor will unlock the inode, but it has already been
|
|
||||||
// locked by the Inode::Create() call.
|
|
||||||
Vnode vnode(this,id);
|
|
||||||
return vnode.Get(&fIndicesNode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user