Refine module preparation return value

This commit is contained in:
LoveSy 2022-12-27 00:57:41 +08:00 committed by John Wu
parent 7871c2f595
commit 37b81ad1f6

View File

@ -117,7 +117,7 @@ public:
// Return false to indicate need to upgrade to module // Return false to indicate need to upgrade to module
bool collect_files(const char *module, int dfd); bool collect_files(const char *module, int dfd);
// Return false to indicate need to upgrade to skeleton // Return true to indicate need to upgrade to skeleton
bool prepare(); bool prepare();
// Default directory mount logic // Default directory mount logic
@ -422,14 +422,14 @@ bool dir_node::prepare() {
} }
} }
} }
if (auto dn = dyn_cast<dir_node>(it->second); dn && dn->is_dir() && !dn->prepare()) { if (auto dn = dyn_cast<dir_node>(it->second); dn && dn->is_dir() && dn->prepare()) {
// Upgrade child to tmpfs // Upgrade child to tmpfs
it = upgrade<tmpfs_node>(it); it = upgrade<tmpfs_node>(it);
} }
next_node: next_node:
++it; ++it;
} }
return !to_tmpfs; return to_tmpfs;
} }
bool dir_node::collect_files(const char *module, int dfd) { bool dir_node::collect_files(const char *module, int dfd) {