Kernel: Allow ProcRO inode fail and pass arbitrary argument to it

This commit is contained in:
2026-05-20 19:06:10 +03:00
parent 7ce68b0488
commit 4ef03eac97
3 changed files with 16 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ namespace Kernel
class ProcROInode final : public TmpInode
{
public:
static BAN::ErrorOr<BAN::RefPtr<ProcROInode>> create_new(size_t (*callback)(off_t, BAN::ByteSpan), TmpFileSystem&, mode_t, uid_t, gid_t);
static BAN::ErrorOr<BAN::RefPtr<ProcROInode>> create_new(BAN::ErrorOr<size_t> (*callback)(off_t, BAN::ByteSpan, void*), TmpFileSystem&, void*, mode_t, uid_t, gid_t);
~ProcROInode() = default;
protected:
@@ -92,10 +92,11 @@ namespace Kernel
virtual bool has_hungup_impl() const override { return false; }
private:
ProcROInode(size_t (*callback)(off_t, BAN::ByteSpan), TmpFileSystem&, const TmpInodeInfo&);
ProcROInode(BAN::ErrorOr<size_t> (*callback)(off_t, BAN::ByteSpan, void*), TmpFileSystem&, void*, const TmpInodeInfo&);
private:
size_t (*m_callback)(off_t, BAN::ByteSpan);
BAN::ErrorOr<size_t> (*m_callback)(off_t, BAN::ByteSpan, void*);
void* m_argument;
};
class ProcSymlinkInode final : public TmpInode