mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:02:44 +00:00 
			
		
		
		
	 4bfd6e41b9
			
		
	
	
		4bfd6e41b9
		
	
	
	
	
		
			
			This makes for nicer handling of errors compared to checking whether a RefPtr is null. Additionally, this will give way to return different types of errors in the future.
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <Kernel/FileSystem/Inode.h>
 | |
| #include <Kernel/Memory/PrivateInodeVMObject.h>
 | |
| 
 | |
| namespace Kernel::Memory {
 | |
| 
 | |
| RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
 | |
| {
 | |
|     return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
 | |
| }
 | |
| 
 | |
| KResultOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
 | |
| {
 | |
|     return adopt_nonnull_ref_or_enomem<VMObject>(new (nothrow) PrivateInodeVMObject(*this));
 | |
| }
 | |
| 
 | |
| PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
 | |
|     : InodeVMObject(inode, size)
 | |
| {
 | |
| }
 | |
| 
 | |
| PrivateInodeVMObject::PrivateInodeVMObject(PrivateInodeVMObject const& other)
 | |
|     : InodeVMObject(other)
 | |
| {
 | |
| }
 | |
| 
 | |
| PrivateInodeVMObject::~PrivateInodeVMObject()
 | |
| {
 | |
| }
 | |
| 
 | |
| }
 |