2020-02-28 22:20:35 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-02-28 22:20:35 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Kernel/FileSystem/Inode.h>
|
2021-08-06 11:45:34 +03:00
|
|
|
#include <Kernel/Memory/PrivateInodeVMObject.h>
|
2020-02-28 22:20:35 +03:00
|
|
|
|
2021-08-06 14:49:36 +03:00
|
|
|
namespace Kernel::Memory {
|
2020-02-28 22:20:35 +03:00
|
|
|
|
2021-07-11 18:55:29 +03:00
|
|
|
RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
|
2020-02-28 22:20:35 +03:00
|
|
|
{
|
2021-06-20 11:21:16 +03:00
|
|
|
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
|
2020-02-28 22:20:35 +03:00
|
|
|
}
|
|
|
|
|
2021-08-15 12:07:59 +03:00
|
|
|
KResultOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
|
2020-02-28 22:20:35 +03:00
|
|
|
{
|
2021-08-15 12:07:59 +03:00
|
|
|
return adopt_nonnull_ref_or_enomem<VMObject>(new (nothrow) PrivateInodeVMObject(*this));
|
2020-02-28 22:20:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
|
|
|
|
: InodeVMObject(inode, size)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-22 01:02:34 +03:00
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(PrivateInodeVMObject const& other)
|
2020-02-28 22:20:35 +03:00
|
|
|
: InodeVMObject(other)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PrivateInodeVMObject::~PrivateInodeVMObject()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|