casaroli commented on code in PR #20548:
URL: https://github.com/apache/nuttx/pull/20548#discussion_r4248099020
##########
fs/v9fs/virtio_9p.c:
##########
@@ -165,26 +230,63 @@ static int virtio_9p_request(FAR struct v9fs_transport_s
*transport,
FAR struct virtio_9p_priv_s *priv =
container_of(transport, struct virtio_9p_priv_s, transport);
FAR struct virtqueue *vq = priv->vdev->vrings_info[0].vq;
- struct virtqueue_buf vb[payload->wcount + payload->rcount];
+#ifdef CONFIG_ARCH_ADDRENV
+ size_t wcount = 0;
+ size_t rcount = 0;
+ size_t n;
+#else
+ size_t wcount = payload->wcount;
+ size_t rcount = payload->rcount;
+#endif
irqstate_t flags;
size_t i;
int ret;
+#ifdef CONFIG_ARCH_ADDRENV
+ for (i = 0; i < payload->wcount; i++)
+ {
+ wcount += virtio_9p_split(payload->wiov[i].iov_base,
+ payload->wiov[i].iov_len, NULL);
+ }
+
+ for (i = 0; i < payload->rcount; i++)
+ {
+ rcount += virtio_9p_split(payload->riov[i].iov_base,
+ payload->riov[i].iov_len, NULL);
+ }
+#endif
+
+ struct virtqueue_buf vb[wcount + rcount];
+
+#ifdef CONFIG_ARCH_ADDRENV
+ n = 0;
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]