1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00

Kernel: Use KResultOr and TRY() for {Shared,Private}InodeVMObject

This commit is contained in:
Andreas Kling 2021-09-06 12:58:03 +02:00
parent e3a716ceff
commit 6e3381ac32
8 changed files with 14 additions and 31 deletions

View file

@ -9,9 +9,9 @@
namespace Kernel::Memory {
RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
KResultOr<NonnullRefPtr<PrivateInodeVMObject>> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
{
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
return adopt_nonnull_ref_or_enomem(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
}
KResultOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()