Kernel: Use MUST + Vector::try_append instead of Vector::append

In preparation for making Vector::append unavailable during
compilation of the Kernel.
This commit is contained in:
Brian Gianforcaro 2022-01-03 03:20:39 -08:00 committed by Andreas Kling
parent 8bcce82887
commit 24066ba5ef
Notes: sideshowbarker 2024-07-17 21:36:12 +09:00
5 changed files with 8 additions and 8 deletions

View file

@ -709,14 +709,14 @@ void Ext2FS::flush_writes()
// to not exist, we remember the fact that it doesn't exist by caching a nullptr.
// This seems like a reasonable time to uncache ideas about unknown inodes, so do that.
if (!it.value) {
unused_inodes.append(it.key);
MUST(unused_inodes.try_append(it.key));
continue;
}
if (it.value->ref_count() != 1)
continue;
if (it.value->has_watchers())
continue;
unused_inodes.append(it.key);
MUST(unused_inodes.try_append(it.key));
}
for (auto index : unused_inodes)
uncache_inode(index);