summaryrefslogtreecommitdiff
path: root/storeio/dev.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-04-19 22:11:52 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-04-19 22:11:52 +0000
commit82781dd6da2b6a1eb113e20d100052509bb85a90 (patch)
tree748f7044ed4fe884d8d3b350e75906e29e01aa41 /storeio/dev.c
parent83e61d2d234ac403a6e6e91c12b1d87aca64de10 (diff)
2001-02-18 Marcus Brinkmann <marcus@gnu.org>
* dev.h (struct dev): New member nperopens. * storeio.c (open_hook): Hold device lock and check if this is the first open. If yes, activate the store. (close_hook): Hold global_lock and check if this was the last open. If yes, inactivate the store. * dev.c (dev_open): Open the store with STORE_INACTIVE (in store_parsed_open as well as in store_create).
Diffstat (limited to 'storeio/dev.c')
-rw-r--r--storeio/dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/storeio/dev.c b/storeio/dev.c
index fdfc0fbd..108e7dd3 100644
--- a/storeio/dev.c
+++ b/storeio/dev.c
@@ -145,14 +145,15 @@ dev_open (struct dev *dev)
/* This means we had no store arguments.
We are to operate on our underlying node. */
err = store_create (storeio_fsys->underlying,
- dev->readonly ? STORE_READONLY : 0,
+ STORE_INACTIVE | (dev->readonly ? STORE_READONLY : 0),
0, &dev->store);
}
else
/* Open based on the previously parsed store arguments. */
err = store_parsed_open (dev->store_name,
- dev->readonly ? STORE_READONLY : 0,
+ STORE_INACTIVE
+ | (dev->readonly ? STORE_READONLY : 0),
&dev->store);
if (err)
return err;