From 67c6375f7190bea8a6afdc2dcca2c8928651f030 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 28 Sep 2001 04:27:36 +0000 Subject: 2001-09-27 Roland McGrath * nbd.c: New file. * Makefile (SRCS): Add it. * store.h (store_nbd_open, _store_nbd_create): Declare them. --- libstore/store.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libstore/store.h') diff --git a/libstore/store.h b/libstore/store.h index 8ca98b77..72600401 100644 --- a/libstore/store.h +++ b/libstore/store.h @@ -382,6 +382,18 @@ error_t _store_task_create (task_t task, int flags, size_t block_size, corresponding store in STORE. */ error_t store_task_open (const char *name, int flags, struct store **store); +/* Open the network block device NAME (parsed as "HOSTNAME:PORT[/BLOCKSIZE]"), + and return the corresponding store in STORE. This opens a socket and + initial connection handshake, which determine the size of the device, + and then uses _store_nbd_create with the open socket port. */ +error_t store_nbd_open (const char *name, int flags, struct store **store); + +/* Create a store that works by talking to an nbd server on an existing + socket port. */ +error_t _store_nbd_create (mach_port_t port, int flags, size_t block_size, + const struct store_run *runs, size_t num_runs, + struct store **store); + /* Parse multiple store names in NAME, and open each individually, returning all in the vector STORES, and the number in NUM_STORES. The syntax of NAME is a single non-alpha-numeric separator character, followed by each -- cgit v1.2.3