2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-08-07 19:06:17 +03:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-16 03:27:42 +03:00
|
|
|
#include <AK/Bitmap.h>
|
2019-08-07 19:06:17 +03:00
|
|
|
#include <Kernel/UnixTypes.h>
|
2020-02-28 22:20:35 +03:00
|
|
|
#include <Kernel/VM/InodeVMObject.h>
|
2019-08-07 19:06:17 +03:00
|
|
|
|
2020-02-16 03:27:42 +03:00
|
|
|
namespace Kernel {
|
|
|
|
|
2020-02-28 22:20:35 +03:00
|
|
|
class SharedInodeVMObject final : public InodeVMObject {
|
|
|
|
AK_MAKE_NONMOVABLE(SharedInodeVMObject);
|
|
|
|
|
2019-08-07 19:06:17 +03:00
|
|
|
public:
|
2021-07-11 18:52:07 +03:00
|
|
|
static RefPtr<SharedInodeVMObject> try_create_with_inode(Inode&);
|
2021-07-11 20:07:00 +03:00
|
|
|
virtual RefPtr<VMObject> try_clone() override;
|
2019-08-07 19:06:17 +03:00
|
|
|
|
|
|
|
private:
|
2020-03-01 13:08:28 +03:00
|
|
|
virtual bool is_shared_inode() const override { return true; }
|
|
|
|
|
2020-02-28 22:07:51 +03:00
|
|
|
explicit SharedInodeVMObject(Inode&, size_t);
|
2021-07-22 01:02:34 +03:00
|
|
|
explicit SharedInodeVMObject(SharedInodeVMObject const&);
|
2019-08-07 19:06:17 +03:00
|
|
|
|
2021-07-11 18:57:52 +03:00
|
|
|
virtual StringView class_name() const override { return "SharedInodeVMObject"sv; }
|
2020-02-28 22:58:57 +03:00
|
|
|
|
2021-07-22 01:02:34 +03:00
|
|
|
SharedInodeVMObject& operator=(SharedInodeVMObject const&) = delete;
|
2019-08-07 19:06:17 +03:00
|
|
|
};
|
2020-02-16 03:27:42 +03:00
|
|
|
|
|
|
|
}
|