BTRFS: Implement Remove() in Inode that removes inode_item.
Signed-off-by: Augustin Cavalier <[email protected]>
This commit is contained in:
@@ -411,6 +411,24 @@ Inode::Insert(Transaction& transaction, BTree::Path* path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Remove inode_item
|
||||||
|
*/
|
||||||
|
status_t
|
||||||
|
Inode::Remove(Transaction& transaction, BTree::Path* path)
|
||||||
|
{
|
||||||
|
BTree* tree = path->Tree();
|
||||||
|
btrfs_key key;
|
||||||
|
key.SetObjectID(fID);
|
||||||
|
key.SetType(BTRFS_KEY_TYPE_INODE_ITEM);
|
||||||
|
key.SetOffset(0);
|
||||||
|
status_t status = tree->RemoveEntries(transaction, path, key, NULL, 1);
|
||||||
|
if (status != B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Insert 3 items: inode_ref, dir_item, dir_index
|
/* Insert 3 items: inode_ref, dir_item, dir_index
|
||||||
* Basically, make a link between name and its node (location)
|
* Basically, make a link between name and its node (location)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public:
|
|||||||
Inode* parent, int32 mode, uint64 size = 0,
|
Inode* parent, int32 mode, uint64 size = 0,
|
||||||
uint64 flags = 0);
|
uint64 flags = 0);
|
||||||
status_t Insert(Transaction& transaction, BTree::Path* path);
|
status_t Insert(Transaction& transaction, BTree::Path* path);
|
||||||
|
status_t Remove(Transaction& transaction, BTree::Path* path);
|
||||||
status_t MakeReference(Transaction& transaction, BTree::Path* path,
|
status_t MakeReference(Transaction& transaction, BTree::Path* path,
|
||||||
Inode* parent, const char* name, int32 mode);
|
Inode* parent, const char* name, int32 mode);
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user