userlandfs: Ensure room for requests in port
* Add a parameter to RequestAllocator::AllocateAddress and ::AllocateData that allows the client to specify a minimum amount of free space that must remain in the port buffer. * Make use of the new parameter in some operations that can fail without it. The Port buffer can be used to store data associated with a Request. For some file system operations, further requests must be sent through the port (by calling AllocateRequest) after reserving port buffer space for data. Unlike AllocateAddress and AllocateData, which can use an area if the data is larger than the port buffer capacity, AllocateRequest can only allocate space in the port buffer. If data previously allocated in the port buffer happens to be large enough to fill it, then these further AllocateRequest calls will fail. Change-Id: If03e0afdfbd9fbc36f0e1a04b5d0a20031932b91 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8866 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
@@ -37,10 +37,10 @@ public:
|
||||
|
||||
status_t AllocateAddress(Address& address, int32 size,
|
||||
int32 align, void** data,
|
||||
bool deferredInit = false);
|
||||
bool deferredInit = false, int32 reserveForNextRequests = 0);
|
||||
status_t AllocateData(Address& address, const void* data,
|
||||
int32 size, int32 align,
|
||||
bool deferredInit = false);
|
||||
bool deferredInit = false, int32 reserveForNextRequests = 0);
|
||||
status_t AllocateString(Address& address,
|
||||
const char* data,
|
||||
bool deferredInit = false);
|
||||
|
||||
Reference in New Issue
Block a user