[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/12] nbd: make refcount interface public
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 04/12] nbd: make refcount interface public |
Date: |
Wed, 19 Sep 2012 15:49:48 +0200 |
After the next patch, the close callback will have to release its
reference.
Signed-off-by: Paolo Bonzini <address@hidden>
---
nbd.c | 4 ++--
nbd.h | 3 +++
2 file modificati, 5 inserzioni(+), 2 rimozioni(-)
diff --git a/nbd.c b/nbd.c
index 83200bd..4aeb80a 100644
--- a/nbd.c
+++ b/nbd.c
@@ -647,12 +647,12 @@ static ssize_t nbd_send_reply(int csock, struct nbd_reply
*reply)
#define MAX_NBD_REQUESTS 16
-static void nbd_client_get(NBDClient *client)
+void nbd_client_get(NBDClient *client)
{
client->refcount++;
}
-static void nbd_client_put(NBDClient *client)
+void nbd_client_put(NBDClient *client)
{
if (--client->refcount == 0) {
g_free(client);
diff --git a/nbd.h b/nbd.h
index 40d58d3..a9038dc 100644
--- a/nbd.h
+++ b/nbd.h
@@ -81,7 +81,10 @@ typedef struct NBDClient NBDClient;
NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset,
off_t size, uint32_t nbdflags);
void nbd_export_close(NBDExport *exp);
+
NBDClient *nbd_client_new(NBDExport *exp, int csock,
void (*close)(NBDClient *));
+void nbd_client_get(NBDClient *client);
+void nbd_client_put(NBDClient *client);
#endif
--
1.7.12
- [Qemu-devel] [PULL 00/12] NBD patches for 2012-09-22, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 01/12] nbd: add more constants, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 03/12] nbd: do not close BlockDriverState in nbd_export_close, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 02/12] nbd: pass NBDClient to nbd_send_negotiate, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 04/12] nbd: make refcount interface public,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 05/12] nbd: do not leak nbd_trip coroutines when a connection is torn down, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 06/12] nbd: add reference counting to NBDExport, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 08/12] nbd: add notification for closing an NBDExport, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 11/12] nbd: negotiate with named exports, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 07/12] nbd: track clients into NBDExport, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 09/12] qemu-nbd: rewrite termination conditions to use a state machine, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 10/12] nbd: register named exports, Paolo Bonzini, 2012/09/19
- [Qemu-devel] [PATCH 12/12] nbd: add nbd_export_get_blockdev, Paolo Bonzini, 2012/09/19
- Re: [Qemu-devel] [PULL 00/12] NBD patches for 2012-09-22, Anthony Liguori, 2012/09/25