aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-10-14 13:33:05 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-02 09:28:55 +0100
commit315f78abfce1f12bca259e8d8a41a42efbf970d1 (patch)
treeaa3e27e746febdcf16dd6153a0e09bb5d575b048
parentb626b51a6721e53817155af720243f59072e424f (diff)
nbd: Rename NBDRequest to NBDRequestData
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> Message-Id: <1476469998-28592-4-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--nbd/server.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 38a0fef4d9..09d949f0c1 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;
@@ -760,21 +760,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;
@@ -976,7 +976,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;
@@ -1012,7 +1012,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;
@@ -1106,7 +1106,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;