本文整理汇总了C++中Volume::FSVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ Volume::FSVolume方法的具体用法?C++ Volume::FSVolume怎么用?C++ Volume::FSVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Volume
的用法示例。
在下文中一共展示了Volume::FSVolume方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static status_t
udf_lookup(fs_volume *_volume, fs_vnode *_directory, const char *file,
ino_t *vnodeID)
{
TRACE(("udf_lookup: _directory = %p, filename = %s\n", _directory, file));
Volume *volume = (Volume *)_volume->private_volume;
Icb *dir = (Icb *)_directory->private_node;
Icb *node = NULL;
status_t status = B_OK;
if (strcmp(file, ".") == 0) {
TRACE(("udf_lookup: file = ./\n"));
*vnodeID = dir->Id();
status = get_vnode(volume->FSVolume(), *vnodeID, (void **)&node);
if (status != B_OK)
return B_ENTRY_NOT_FOUND;
} else {
status = dir->Find(file, vnodeID);
if (status != B_OK)
return status;
Icb *icb;
status = get_vnode(volume->FSVolume(), *vnodeID, (void **)&icb);
if (status != B_OK)
return B_ENTRY_NOT_FOUND;
}
TRACE(("udf_lookup: vnodeId = %Ld found!\n", *vnodeID));
return B_OK;
}
示例2: htree
static status_t
ext2_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
ino_t* _vnodeID)
{
TRACE("ext2_lookup: name address: %p\n", name);
TRACE("ext2_lookup: name: %s\n", name);
Volume* volume = (Volume*)_volume->private_volume;
Inode* directory = (Inode*)_directory->private_node;
// check access permissions
status_t status = directory->CheckPermissions(X_OK);
if (status < B_OK)
return status;
HTree htree(volume, directory);
DirectoryIterator* iterator;
status = htree.Lookup(name, &iterator);
if (status != B_OK)
return status;
ObjectDeleter<DirectoryIterator> iteratorDeleter(iterator);
status = iterator->FindEntry(name, _vnodeID);
if (status != B_OK)
return status;
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
}
示例3: get_vnode
static status_t
btrfs_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
ino_t* _vnodeID)
{
TRACE("btrfs_lookup: name address: %p (%s)\n", name, name);
Volume* volume = (Volume*)_volume->private_volume;
Inode* directory = (Inode*)_directory->private_node;
// check access permissions
status_t status = directory->CheckPermissions(X_OK);
if (status < B_OK)
return status;
status = DirectoryIterator(directory).Lookup(name, strlen(name), _vnodeID);
if (status != B_OK)
return status;
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
}
示例4: transaction
static status_t
ext2_create_dir(fs_volume* _volume, fs_vnode* _directory, const char* name,
int mode)
{
TRACE("ext2_create_dir()\n");
Volume* volume = (Volume*)_volume->private_volume;
Inode* directory = (Inode*)_directory->private_node;
if (volume->IsReadOnly())
return B_READ_ONLY_DEVICE;
if (!directory->IsDirectory())
return B_BAD_TYPE;
status_t status = directory->CheckPermissions(W_OK);
if (status != B_OK)
return status;
TRACE("ext2_create_dir(): Starting transaction\n");
Transaction transaction(volume->GetJournal());
ino_t id;
status = Inode::Create(transaction, directory, name,
S_DIRECTORY | (mode & S_IUMSK), 0, EXT2_TYPE_DIRECTORY, NULL, &id);
if (status != B_OK)
return status;
put_vnode(volume->FSVolume(), id);
entry_cache_add(volume->ID(), directory->ID(), name, id);
status = transaction.Done();
if (status != B_OK) {
entry_cache_remove(volume->ID(), directory->ID(), name);
return status;
}
notify_entry_created(volume->ID(), directory->ID(), name, id);
TRACE("ext2_create_dir(): Done\n");
return B_OK;
}