kernel/fs: Fallback in vfs_request_io if read_pages/write_pages aren't available.
Add a comment indicating why we don't call them unconditionally. Fixes #19642.
This commit is contained in:
@@ -119,11 +119,17 @@ public:
|
||||
vec.iov_base = buffer;
|
||||
vec.iov_len = *length;
|
||||
|
||||
// We need to use write_pages (if it exists) to bypass caches.
|
||||
|
||||
if (fWrite) {
|
||||
if (!HAS_FS_CALL(fVnode, write_pages))
|
||||
return FS_CALL(fVnode, write, fCookie, offset, buffer, length);
|
||||
return FS_CALL(fVnode, write_pages, fCookie, offset, &vec, 1,
|
||||
length);
|
||||
}
|
||||
|
||||
if (!HAS_FS_CALL(fVnode, read_pages))
|
||||
return FS_CALL(fVnode, read, fCookie, offset, buffer, length);
|
||||
return FS_CALL(fVnode, read_pages, fCookie, offset, &vec, 1, length);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user