1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 11:55:07 +00:00
serenity/Kernel/VM/PrivateInodeVMObject.cpp
Andreas Kling 88d490566f Kernel: Rename various *VMObject::create*() => try_create()
try_*() implies that it can fail (and they all return RefPtr with
nullptr signalling failure.)
2021-07-11 17:55:29 +02:00

36 lines
795 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/VM/PrivateInodeVMObject.h>
namespace Kernel {
RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
{
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
}
RefPtr<VMObject> PrivateInodeVMObject::clone()
{
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(*this));
}
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
: InodeVMObject(inode, size)
{
}
PrivateInodeVMObject::PrivateInodeVMObject(const PrivateInodeVMObject& other)
: InodeVMObject(other)
{
}
PrivateInodeVMObject::~PrivateInodeVMObject()
{
}
}