InodeVMObject.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Bitmap.h>
  8. #include <Kernel/Memory/VMObject.h>
  9. #include <Kernel/UnixTypes.h>
  10. namespace Kernel::Memory {
  11. class InodeVMObject : public VMObject {
  12. public:
  13. virtual ~InodeVMObject() override;
  14. Inode& inode() { return *m_inode; }
  15. Inode const& inode() const { return *m_inode; }
  16. size_t amount_dirty() const;
  17. size_t amount_clean() const;
  18. int release_all_clean_pages();
  19. u32 writable_mappings() const;
  20. u32 executable_mappings() const;
  21. protected:
  22. explicit InodeVMObject(Inode&, FixedArray<RefPtr<PhysicalPage>>&&);
  23. explicit InodeVMObject(InodeVMObject const&, FixedArray<RefPtr<PhysicalPage>>&&);
  24. InodeVMObject& operator=(InodeVMObject const&) = delete;
  25. InodeVMObject& operator=(InodeVMObject&&) = delete;
  26. InodeVMObject(InodeVMObject&&) = delete;
  27. virtual bool is_inode() const final { return true; }
  28. NonnullRefPtr<Inode> m_inode;
  29. Bitmap m_dirty_pages;
  30. };
  31. }