summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-08-26 00:09:38 +0000
committerRoland McGrath <roland@gnu.org>2001-08-26 00:09:38 +0000
commitd1999dacd5e1ae89c2b9dcdc0776c952a44bbc1f (patch)
tree29cc9dd164698f02d64644c5f229788b9a394e13
parentb381b500bc5984c67fb213c5a7417ebfc0c6f2a1 (diff)
2001-08-25 Neal H Walfield <neal@cs.uml.edu>
* part.c: New file. * std.c (store_std_classes): Add store_part_class. * store.h (store_part_create): New prototype. (store_part_open): Likewise.
-rw-r--r--libstore/std.c9
-rw-r--r--libstore/store.h16
2 files changed, 21 insertions, 4 deletions
diff --git a/libstore/std.c b/libstore/std.c
index e42e2094..d2230c9d 100644
--- a/libstore/std.c
+++ b/libstore/std.c
@@ -23,10 +23,11 @@
const struct store_class *const
store_std_classes[] =
{
- &store_device_class, &store_file_class, &store_zero_class, &store_task_class,
- &store_ileave_class, &store_concat_class, &store_remap_class,
- &store_query_class, &store_copy_class, &store_gunzip_class,
- &store_bunzip2_class, &store_typed_open_class,
+ &store_device_class, &store_part_class, &store_file_class,
+ &store_zero_class, &store_task_class, &store_ileave_class,
+ &store_concat_class, &store_remap_class, &store_query_class,
+ &store_copy_class, &store_gunzip_class, &store_bunzip2_class,
+ &store_typed_open_class,
0
};
diff --git a/libstore/store.h b/libstore/store.h
index 141b946f..8ca98b77 100644
--- a/libstore/store.h
+++ b/libstore/store.h
@@ -341,6 +341,21 @@ error_t _store_device_create (device_t device, int flags, size_t block_size,
/* Open the device NAME, and return the corresponding store in STORE. */
error_t store_device_open (const char *name, int flags, struct store **store);
+/* Return a new store in STORE which contains a remap store of partition
+ PART from the contents of SOURCE; SOURCE is consumed. */
+error_t store_part_create (struct store *source, int index, int flags,
+ struct store **store);
+
+/* Open the part NAME. NAME consists of a partition number, a ':', a another
+ store class name, a ':' and a name for to by passed to the store class.
+ E.g. "2:device:hd0" would open the second partition on a DEVICE store
+ named "hd0". FLAGS indicate how to open the store. CLASSES is used to
+ select classes specified by the type NAME; if it is 0, STORE_STD_CLASSES
+ is used. The new store is returned in *STORE. */
+error_t store_part_open (const char *name, int flags,
+ const struct store_class *const *classes,
+ struct store **store);
+
/* Return a new store in STORE referring to the file FILE. Unlike
store_create, this will always use file i/o, even it would be possible to
be more direct. This may work in more cases, for instance if the file has
@@ -478,6 +493,7 @@ error_t store_mvol_create (struct store *phys,
extern const struct store_class *const store_std_classes[];
extern const struct store_class store_device_class;
+extern const struct store_class store_part_class;
extern const struct store_class store_file_class;
extern const struct store_class store_task_class;
extern const struct store_class store_zero_class;