update code in #ifdef USER, should be needed when we want to use Volume::Initialize()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16379 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -556,7 +556,6 @@ Volume::Identify(int fd, disk_super_block *superBlock)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef USER
|
#ifdef USER
|
||||||
extern "C" void kill_device_vnodes(dev_t id);
|
extern "C" void kill_device_vnodes(dev_t id);
|
||||||
// This call is only available in the userland fs_shell
|
// This call is only available in the userland fs_shell
|
||||||
@@ -610,7 +609,7 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3
|
|||||||
if (!IsValidSuperBlock())
|
if (!IsValidSuperBlock())
|
||||||
RETURN_ERROR(B_ERROR);
|
RETURN_ERROR(B_ERROR);
|
||||||
|
|
||||||
if (opener.InitCache(numBlocks) != B_OK)
|
if ((fBlockCache = opener.InitCache(NumBlocks(), fBlockSize)) == NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
fJournal = new Journal(this);
|
fJournal = new Journal(this);
|
||||||
@@ -625,7 +624,7 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3
|
|||||||
RETURN_ERROR(B_ERROR);
|
RETURN_ERROR(B_ERROR);
|
||||||
|
|
||||||
off_t id;
|
off_t id;
|
||||||
status_t status = Inode::Create(&transaction, NULL, NULL,
|
status_t status = Inode::Create(transaction, NULL, NULL,
|
||||||
S_DIRECTORY | 0755, 0, 0, &id, &fRootNode);
|
S_DIRECTORY | 0755, 0, 0, &id, &fRootNode);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
RETURN_ERROR(status);
|
RETURN_ERROR(status);
|
||||||
@@ -636,15 +635,15 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3
|
|||||||
// The indices root directory will be created automatically
|
// The indices root directory will be created automatically
|
||||||
// when the standard indices are created (or any other).
|
// when the standard indices are created (or any other).
|
||||||
Index index(this);
|
Index index(this);
|
||||||
status = index.Create(&transaction, "name", B_STRING_TYPE);
|
status = index.Create(transaction, "name", B_STRING_TYPE);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
status = index.Create(&transaction, "last_modified", B_INT64_TYPE);
|
status = index.Create(transaction, "last_modified", B_INT64_TYPE);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
status = index.Create(&transaction, "size", B_INT64_TYPE);
|
status = index.Create(transaction, "size", B_INT64_TYPE);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -660,7 +659,7 @@ Volume::Initialize(const char *device, const char *name, uint32 blockSize, uint3
|
|||||||
// This call is only available in the userland fs_shell
|
// This call is only available in the userland fs_shell
|
||||||
|
|
||||||
Sync();
|
Sync();
|
||||||
opener.RemoveCache(ALLOW_WRITES);
|
opener.RemoveCache(true);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user