From: Peter Dinda Date: Mon, 18 Jul 2011 21:51:49 +0000 (-0500) Subject: Extended keyed stream interface to include preallocation X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e8ceccaf19d8673a4deb70d29126658e846411a;p=palacios.git Extended keyed stream interface to include preallocation --- diff --git a/palacios/include/interfaces/vmm_keyed_stream.h b/palacios/include/interfaces/vmm_keyed_stream.h index e06535d..06fafd5 100644 --- a/palacios/include/interfaces/vmm_keyed_stream.h +++ b/palacios/include/interfaces/vmm_keyed_stream.h @@ -49,6 +49,7 @@ typedef enum {V3_KS_RD_ONLY,V3_KS_WR_ONLY,V3_KS_WR_ONLY_CREATE} v3_keyed_stream_ v3_keyed_stream_t v3_keyed_stream_open(char *url, v3_keyed_stream_open_t open_type); void v3_keyed_stream_close(v3_keyed_stream_t stream); +void v3_keyed_stream_preallocate_hint_key(v3_keyed_stream_t stream, char *key, uint64_t size); v3_keyed_stream_key_t v3_keyed_stream_open_key(v3_keyed_stream_t stream, char *key); void v3_keyed_stream_close_key(v3_keyed_stream_t stream, char *key); sint64_t v3_keyed_stream_write_key(v3_keyed_stream_t stream, @@ -85,6 +86,10 @@ struct v3_keyed_stream_hooks { void (*close)(v3_keyed_stream_t stream); + void (*preallocate_hint_key)(v3_keyed_stream_t stream, + char *key, + uint64_t size); + v3_keyed_stream_key_t (*open_key)(v3_keyed_stream_t stream, char *key); diff --git a/palacios/src/interfaces/vmm_keyed_stream.c b/palacios/src/interfaces/vmm_keyed_stream.c index 4ba376b..79d69ac 100644 --- a/palacios/src/interfaces/vmm_keyed_stream.c +++ b/palacios/src/interfaces/vmm_keyed_stream.c @@ -46,6 +46,14 @@ void v3_keyed_stream_close(v3_keyed_stream_t stream) } +void v3_keyed_stream_preallocate_hint_key(v3_keyed_stream_t stream, char *key, uint64_t size) +{ + V3_ASSERT(keyed_stream_hooks != NULL); + V3_ASSERT(keyed_stream_hooks->preallocate_hint_key != NULL); + + return keyed_stream_hooks->preallocate_hint_key(stream,key,size); +} + v3_keyed_stream_key_t v3_keyed_stream_open_key(v3_keyed_stream_t stream, char *key) { V3_ASSERT(keyed_stream_hooks != NULL);