summaryrefslogtreecommitdiff
path: root/hurd/libstore/copy_store.mdwn
blob: 5df5d2208393f1217ba9baa03adcf9dcea1b0270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[[!meta copyright="Copyright © 2000, 2007, 2008, 2009 Free Software Foundation,
Inc."]]

[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]

[[!meta title="copy store: copy-on-write; discard changes on termination"]]

A *copy* store is meaningful only with respect to a child store.  What a *copy*
store does is to read the child store's entire contents into memory at startup
time and then use that buffer as the contents of the store thereafter.  (The
code for this is in `libstore/copy.c`.)

Because of how the interfaces are specified, reading the entire contents of a
[[*zero* store|zero store]] in fact means just `vm_allocate`ing fresh memory.
So, a *copy* store based on a [[*zero* store|zero store]] is just what you'd
get from `vm_allocate`ing some memory and passing it into
`store_buffer_create`.

See a [[ramdisk example|examples/ramdisk]].