currently, nuttx implements readv/writev on the top of read/write.
while it might work for the simplest cases, it's broken by design.
for example, it's impossible to make it work correctly for files
which need to preserve data boundaries without allocating a single
contiguous buffer. (udp socket, some character devices, etc)
this change is a start of the migration to a better design.
that is, implement read/write on the top of readv/writev.
to avoid a single huge change, following things will NOT be done in
this commit:
* fix actual bugs caused by the original readv-based-on-read design.
(cf. https://github.com/apache/nuttx/pull/12674)
* adapt filesystems/drivers to actually benefit from the new interface.
(except a few trivial examples)
* eventually retire the old interface.
* retire read/write syscalls. implement them in libc instead.
* pread/pwrite/preadv/pwritev (except the introduction of struct uio,
which is a preparation to back these variations with the new
interface.)
v9fs/virtio_9p.c:223:3: error: too few arguments to function 'virtio_negotiate_features'
223 | virtio_negotiate_features(vdev, 1 << VIRTIO_9P_MOUNT_TAG);
v9fs/virtio_9p.c:245:9: error: too few arguments to function 'virtio_create_virtqueues'
245 | ret = virtio_create_virtqueues(vdev, 0, 1, vqname, callback);
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Summary:
1.Add configuration to allocate memory from the specified section
2.Replace all memory operations (kmm_) in the vfs with
fs_heap_. When FS_HEAPSIZE > 0, memory is requested for the file system by specifying a configured heap location. By default (i.e. FS_HEAPSIZE=0) fs_heap_ is equivalent to kmm_
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
In the x86 environment, memory does not necessarily start at 0, so when end is 0x0, start = end + 1, and then determine the contents of start, it will cause x86 to cause a crash when accessing an illegal address.
This problem does not occur in the arm environment because arm starts at 0x0, so the content of the 0x1 address is “\0”.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
1.The relpath information is stored in the fid structure
2.The relative path information is only saved in the client. When the server changes, the relpath saved in the fid will not change.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>