From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org,
xen-devel@lists.xenproject.org, wl@xen.org
Subject: Re: [PATCH v2 7/7] Mini-OS: add read and write support to 9pfsfront
Date: Fri, 10 Feb 2023 19:59:16 +0100 [thread overview]
Message-ID: <20230210185916.2qjo6yh7c3usheyp@begin> (raw)
In-Reply-To: <20230210104628.14374-8-jgross@suse.com>
Juergen Gross, le ven. 10 févr. 2023 11:46:28 +0100, a ecrit:
> + while ( len )
> + {
> + count = len;
> + if ( count > dev->msize_max - 24 )
> + count = dev->msize_max - 24;
24 should be detailed, to include e.g. sizeof(p9_header) and the sum of
sizes of the fields (I'm surprised that it's the same 24 for read and
write, notably).
> + send_9p(dev, req, "ULU", fid, offset, count);
> + rcv_9p(dev, req, "D", &count, data);
> +
> + if ( !count )
> + break;
> + if ( req->result )
> + {
> + ret = -1;
> + errno = EIO;
I'd say log req->result?
> + break;
> + }
> + ret += count;
> + offset += count;
> + data += count;
> + len -= count;
> + }
> +
> + put_free_req(dev, req);
> +
> + return ret;
> +}
> +
> +static int p9_write(struct dev_9pfs *dev, uint32_t fid, uint64_t offset,
> + const uint8_t *data, uint32_t len)
> +{
> + struct req *req = get_free_req(dev);
> + int ret = 0;
> + uint32_t count;
> +
> + if ( !req )
> + {
> + errno = EAGAIN;
> + return -1;
> + }
> + req->cmd = P9_CMD_WRITE;
> +
> + while ( len )
> + {
> + count = len;
> + if ( count > dev->msize_max - 24 )
> + count = dev->msize_max - 24;
Same here.
> + send_9p(dev, req, "ULD", fid, offset, count, data);
> + rcv_9p(dev, req, "U", &count);
> + if ( req->result )
> + {
> + ret = -1;
> + errno = EIO;
Same here.
> + break;
> + }
> + ret += count;
> + offset += count;
> + data += count;
> + len -= count;
> + }
> +
> + put_free_req(dev, req);
> +
> + return ret;
> +}
next prev parent reply other threads:[~2023-02-10 18:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 10:46 [PATCH v2 0/7] Mini-OS: add minimal 9pfs support Juergen Gross
2023-02-10 10:46 ` [PATCH v2 1/7] Mini-OS: xenbus: add support for reading node from directory Juergen Gross
2023-02-10 18:43 ` Samuel Thibault
2023-02-10 10:46 ` [PATCH v2 2/7] Mini-OS: add concept of mount points Juergen Gross
2023-02-10 18:44 ` Samuel Thibault
2023-02-10 10:46 ` [PATCH v2 3/7] Mini-OS: add support for runtime mounts Juergen Gross
2023-02-10 11:43 ` Andrew Cooper
2023-02-10 12:14 ` Juergen Gross
2023-02-10 12:44 ` Samuel Thibault
2023-02-10 18:51 ` Andrew Cooper
2023-02-10 10:46 ` [PATCH v2 4/7] Mini-OS: add 9pfs frontend Juergen Gross
2023-02-10 18:46 ` Samuel Thibault
2023-02-10 10:46 ` [PATCH v2 5/7] Mini-OS: add 9pfs transport layer Juergen Gross
2023-02-10 18:48 ` Samuel Thibault
2023-02-10 10:46 ` [PATCH v2 6/7] Mini-OS: add open and close handling to the 9pfs frontend Juergen Gross
2023-02-10 18:53 ` Samuel Thibault
2023-02-11 6:23 ` Juergen Gross
2023-02-10 10:46 ` [PATCH v2 7/7] Mini-OS: add read and write support to 9pfsfront Juergen Gross
2023-02-10 18:59 ` Samuel Thibault [this message]
2023-02-13 6:47 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230210185916.2qjo6yh7c3usheyp@begin \
--to=samuel.thibault@ens-lyon.org \
--cc=jgross@suse.com \
--cc=minios-devel@lists.xenproject.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.