[f2fs] Change the VnodeF2fs recycle methods
This change is based on f16722e263c5 in main fuchsia.
Test: fx test fs-tests
Failed tests: RwFullDiskTest.PartialWriteSucceedsForFullDisk/F2fs
Prerequisite: jiri update
Change-Id: Iaa2ca0818c1b52180bc6da798c4e5287327ac611
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/f2fs/+/536744
Reviewed-by: Brett Wilson <brettw@google.com>
diff --git a/vnode.cc b/vnode.cc
index 5761d16..226637b 100644
--- a/vnode.cc
+++ b/vnode.cc
@@ -142,7 +142,10 @@
return ZX_OK;
}
-void VnodeF2fs::fbl_recycle() {
+void VnodeF2fs::RecycleNode() {
+ // TODO:
+ // implement the desired caching behavior
+ // currently, it remove its entry from vnode table and delete
fs_->EraseVnodeFromTable(this);
delete this;
}
diff --git a/vnode.h b/vnode.h
index e9c40cd..6932f69 100644
--- a/vnode.h
+++ b/vnode.h
@@ -37,7 +37,7 @@
zx_status_t QueryFilesystem(fuchsia_io::wire::FilesystemInfo *info) final;
- void fbl_recycle() override;
+ void fbl_recycle() { RecycleNode(); };
bool IsDirectory();
@@ -142,6 +142,9 @@
InodeInfo fi_;
+ protected:
+ void RecycleNode() override;
+
private:
F2fs *fs_;
ino_t ino_{};