#include "proxy_log.h"
#include "proxy_helpers.h"
#include "proxy_requests.h"
+#include "proxy_async.h"
/* We override the definition of the ceph_mount_info structure to contain
* internal proxy information. This is already a black box for libcephfs users,
struct ceph_mount_info {
proxy_link_t link;
proxy_link_negotiate_t neg;
+ proxy_async_t async;
uint64_t cmount;
};
}
sd = err;
- proxy_link_negotiate_init(&ceph_mount->neg, 0, PROXY_FEAT_ALL, 0, 0);
+ proxy_link_negotiate_init(&ceph_mount->neg, 0, PROXY_FEAT_ALL, 0,
+ PROXY_FEAT_ASYNC_CBK);
err = proxy_link_handshake_client(&ceph_mount->link, sd,
&ceph_mount->neg,
goto failed_link;
}
+ if ((ceph_mount->neg.v1.enabled & PROXY_FEAT_ASYNC_CBK) != 0) {
+ err = proxy_async_client(&ceph_mount->async, &ceph_mount->link,
+ sd);
+ if (err < 0) {
+ goto failed_link;
+ }
+ }
CEPH_STR_ADD(req, id, id);
#include "proxy_log.h"
#include "proxy_requests.h"
#include "proxy_mount.h"
+#include "proxy_async.h"
typedef struct _proxy_server {
proxy_link_t link;
typedef struct _proxy_client {
proxy_worker_t worker;
proxy_link_negotiate_t neg;
+ proxy_async_t async;
proxy_link_t *link;
proxy_random_t random;
void *buffer;
err = proxy_link_handshake_server(client->link, client->sd,
&client->neg,
server_negotiation_check);
- if (err >= 0) {
- serve_binary(client);
+ if (err < 0) {
+ goto done;
}
+ if ((client->neg.v1.enabled & PROXY_FEAT_ASYNC_CBK) != 0) {
+ err = proxy_async_server(&client->async, client->sd);
+ if (err < 0) {
+ goto done;
+ }
+ }
+
+ serve_binary(client);
+
+done:
close(client->sd);
}
((_type *)((uintptr_t)(_ptr) - offset_of(_type, _field)))
enum {
+ /* Mask of all features requiring the asynchronous callback handling. */
+ PROXY_FEAT_ASYNC_CBK = 0x00000001,
+
/* Mask of all supported/known features. */
- PROXY_FEAT_ALL = 0x00000000
+ PROXY_FEAT_ALL = 0x00000001
};
struct _list;