From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, pbonzini@redhat.com, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH v6 03/15] nbd: Rename NBDRequest to NBDRequestData
Date: Thu, 13 Oct 2016 15:58:43 -0500 [thread overview]
Message-ID: <1476392335-9256-4-git-send-email-eblake@redhat.com> (raw)
In-Reply-To: <1476392335-9256-1-git-send-email-eblake@redhat.com>
We have both 'struct NBDRequest' and 'struct nbd_request'; making
it confusing to see which does what. Furthermore, we want to
rename nbd_request to align with our normal CamelCase naming
conventions. So, rename the struct which is used to associate
the data received during request callbacks, while leaving the
shorter name for the description of the request sent over the
wire in the NBD protocol.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v6: new patch
---
nbd/server.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/nbd/server.c b/nbd/server.c
index 2e84d51..78c0419 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -47,10 +47,10 @@ static int system_errno_to_nbd_errno(int err)
/* Definitions for opaque data types */
-typedef struct NBDRequest NBDRequest;
+typedef struct NBDRequestData NBDRequestData;
-struct NBDRequest {
- QSIMPLEQ_ENTRY(NBDRequest) entry;
+struct NBDRequestData {
+ QSIMPLEQ_ENTRY(NBDRequestData) entry;
NBDClient *client;
uint8_t *data;
bool complete;
@@ -759,21 +759,21 @@ static void client_close(NBDClient *client)
}
}
-static NBDRequest *nbd_request_get(NBDClient *client)
+static NBDRequestData *nbd_request_get(NBDClient *client)
{
- NBDRequest *req;
+ NBDRequestData *req;
assert(client->nb_requests <= MAX_NBD_REQUESTS - 1);
client->nb_requests++;
nbd_update_can_read(client);
- req = g_new0(NBDRequest, 1);
+ req = g_new0(NBDRequestData, 1);
nbd_client_get(client);
req->client = client;
return req;
}
-static void nbd_request_put(NBDRequest *req)
+static void nbd_request_put(NBDRequestData *req)
{
NBDClient *client = req->client;
@@ -975,7 +975,7 @@ void nbd_export_close_all(void)
}
}
-static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,
+static ssize_t nbd_co_send_reply(NBDRequestData *req, struct nbd_reply *reply,
int len)
{
NBDClient *client = req->client;
@@ -1011,7 +1011,7 @@ static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,
* and any other negative value to report an error to the client
* (although the caller may still need to disconnect after reporting
* the error). */
-static ssize_t nbd_co_receive_request(NBDRequest *req,
+static ssize_t nbd_co_receive_request(NBDRequestData *req,
struct nbd_request *request)
{
NBDClient *client = req->client;
@@ -1105,7 +1105,7 @@ static void nbd_trip(void *opaque)
{
NBDClient *client = opaque;
NBDExport *exp = client->exp;
- NBDRequest *req;
+ NBDRequestData *req;
struct nbd_request request;
struct nbd_reply reply;
ssize_t ret;
--
2.7.4
next prev parent reply other threads:[~2016-10-13 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 20:58 [Qemu-devel] [PATCH v6 00/15] nbd: efficient write zeroes Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 01/15] nbd: Add qemu-nbd -D for human-readable description Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 02/15] nbd: Treat flags vs. command type as separate fields Eric Blake
2016-10-13 20:58 ` Eric Blake [this message]
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 04/15] nbd: Rename NbdClientSession to NBDClientSession Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 05/15] nbd: Rename struct nbd_request and nbd_reply Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 06/15] nbd: Share common reply-sending code in server Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 07/15] nbd: Send message along with server NBD_REP_ERR errors Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 08/15] nbd: Share common option-sending code in client Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 09/15] nbd: Let server know when client gives up negotiation Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 10/15] nbd: Let client skip portions of server reply Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 11/15] nbd: Less allocation during NBD_OPT_LIST Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 12/15] nbd: Support shorter handshake Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 13/15] nbd: Improve server handling of shutdown requests Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 14/15] nbd: Implement NBD_CMD_WRITE_ZEROES on server Eric Blake
2016-10-13 20:58 ` [Qemu-devel] [PATCH v6 15/15] nbd: Implement NBD_CMD_WRITE_ZEROES on client Eric Blake
2016-10-14 0:00 ` [Qemu-devel] [PATCH v6 00/15] nbd: efficient write zeroes no-reply
2016-10-14 2:06 ` Eric Blake
2016-10-14 4:59 ` no-reply
2016-10-14 14:19 ` Eric Blake
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=1476392335-9256-4-git-send-email-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).