mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:57:46 +00:00
Kernel: Rename various *VMObject::create*() => try_create()
try_*() implies that it can fail (and they all return RefPtr with nullptr signalling failure.)
This commit is contained in:
parent
af8c74a328
commit
88d490566f
19 changed files with 35 additions and 35 deletions
|
@ -28,7 +28,7 @@ KResultOr<FlatPtr> Process::sys$anon_create(size_t size, int options)
|
|||
if (new_fd < 0)
|
||||
return new_fd;
|
||||
|
||||
auto vmobject = AnonymousVMObject::create_with_size(size, AllocationStrategy::Reserve);
|
||||
auto vmobject = AnonymousVMObject::try_create_with_size(size, AllocationStrategy::Reserve);
|
||||
if (!vmobject)
|
||||
return ENOMEM;
|
||||
|
||||
|
|
|
@ -542,7 +542,7 @@ KResultOr<FlatPtr> Process::sys$mremap(Userspace<const Syscall::SC_mremap_params
|
|||
auto old_offset = old_region->offset_in_vmobject();
|
||||
NonnullRefPtr inode = static_cast<SharedInodeVMObject&>(old_region->vmobject()).inode();
|
||||
|
||||
auto new_vmobject = PrivateInodeVMObject::create_with_inode(inode);
|
||||
auto new_vmobject = PrivateInodeVMObject::try_create_with_inode(inode);
|
||||
if (!new_vmobject)
|
||||
return ENOMEM;
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ KResult Process::poke_user_data(Userspace<u32*> address, u32 data)
|
|||
// If the region is shared, we change its vmobject to a PrivateInodeVMObject
|
||||
// to prevent the write operation from changing any shared inode data
|
||||
VERIFY(region->vmobject().is_shared_inode());
|
||||
auto vmobject = PrivateInodeVMObject::create_with_inode(static_cast<SharedInodeVMObject&>(region->vmobject()).inode());
|
||||
auto vmobject = PrivateInodeVMObject::try_create_with_inode(static_cast<SharedInodeVMObject&>(region->vmobject()).inode());
|
||||
if (!vmobject)
|
||||
return ENOMEM;
|
||||
region->set_vmobject(vmobject.release_nonnull());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue