Make internal calls to EnsureFileSize saturate at 0xFFFFFFFF rather than error
The corresponding external interface, OS_Args 6, takes a byte size in R2 which is passed on verbatim. However, when FileSwitch wants to do the same operation it rounds up to the nearest buffer size and complains the operation can't complete ("File too big") when the same operation through OS_Args would succeed. Internally FileSwitch doesn't actually use the allocated size for anything (other than to avoid unnecesary ensures, and to cache the value for read back via OS_Args 4), so the full byte range of R2 is now allowed internally as well as externally. FSEntry_Open may also pass back 0xFFFFFFFF as the allocated size on opening similarly. FSEntry_Args 7 and FSEntry_Args 4 are the corresponding low level API, these are unchanged in meaning. The FSEntry_Args 8, write 0s to file (usually triggered by extending with EXT#handle=number), is defined as always passing the file offset as a multiple of the buffer size, and the number of 0s to write as a multiple of the buffer size. To allow this to write up to 4G of 0s while not spilling over R3, FileSwitch now splits such a call into one buffer, followed by the remainder. Tested with LanManFS 2.38, checking operations are split appropriately. Version 2.79. Tagged as 'FileSwitch-2_79'
Showing
Please register or sign in to comment