2020-02-28 19:20:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-02-28 19:20:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-08-06 08:45:34 +00:00
|
|
|
#include <Kernel/Memory/InodeVMObject.h>
|
2020-02-28 19:20:35 +00:00
|
|
|
#include <Kernel/UnixTypes.h>
|
|
|
|
|
2021-08-06 11:49:36 +00:00
|
|
|
namespace Kernel::Memory {
|
2020-02-28 19:20:35 +00:00
|
|
|
|
|
|
|
class PrivateInodeVMObject final : public InodeVMObject {
|
|
|
|
AK_MAKE_NONMOVABLE(PrivateInodeVMObject);
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~PrivateInodeVMObject() override;
|
|
|
|
|
2022-08-19 18:53:40 +00:00
|
|
|
static ErrorOr<NonnullLockRefPtr<PrivateInodeVMObject>> try_create_with_inode(Inode&);
|
2022-08-06 18:05:48 +00:00
|
|
|
static ErrorOr<NonnullLockRefPtr<PrivateInodeVMObject>> try_create_with_inode_and_range(Inode&, u64 offset, size_t range_size);
|
2022-08-19 18:53:40 +00:00
|
|
|
virtual ErrorOr<NonnullLockRefPtr<VMObject>> try_clone() override;
|
2020-02-28 19:20:35 +00:00
|
|
|
|
|
|
|
private:
|
2020-03-01 10:08:28 +00:00
|
|
|
virtual bool is_private_inode() const override { return true; }
|
|
|
|
|
2022-08-24 13:56:26 +00:00
|
|
|
explicit PrivateInodeVMObject(Inode&, FixedArray<RefPtr<PhysicalPage>>&&, Bitmap dirty_pages);
|
|
|
|
explicit PrivateInodeVMObject(PrivateInodeVMObject const&, FixedArray<RefPtr<PhysicalPage>>&&, Bitmap dirty_pages);
|
2020-02-28 19:20:35 +00:00
|
|
|
|
2021-07-11 15:57:52 +00:00
|
|
|
virtual StringView class_name() const override { return "PrivateInodeVMObject"sv; }
|
2020-02-28 19:58:57 +00:00
|
|
|
|
2021-07-21 22:02:34 +00:00
|
|
|
PrivateInodeVMObject& operator=(PrivateInodeVMObject const&) = delete;
|
2020-02-28 19:20:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|