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