diff options
author | Roland McGrath <roland@gnu.org> | 1999-01-27 20:46:47 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-01-27 20:46:47 +0000 |
commit | 8e8f1f026b493aeea075d4f1cbc05bbf0dd6cec6 (patch) | |
tree | fe387c55550994e63545bb880b143bc6e2f4661d /storeio/dev.h | |
parent | 917384c096a24625c84ab8901901a45e2f2f055f (diff) |
1999-01-27 Roland McGrath <roland@baalperazim.frob.com>
* storeio.c (options): New option -c/--no-cache.
(inhibit_cache): New variable.
(parse_opt): Make -c set it.
(trivfs_append_args): Report --no-cache if set.
(check_open_hook): Pass inhibit_cache flag to dev_open.
* dev.h (struct dev): New member `inhibit_cache'.
(dev_open): Update decl.
* dev.c (dev_open): Take new arg inhibit_cache, store in new dev.
If set, don't initialize buf_offs, io_lock, pager, pager_lock.
(dev_read, dev_write): If DEV->inhibit_cache is set, allow only
whole-block i/o: EINVAL for non-whole-block attempts.
* pager.c (dev_get_memory_object): If DEV->inhibit_cache is set, don't
make our own pager; if store_map returns EOPNOTSUPP, so do we.
Diffstat (limited to 'storeio/dev.h')
-rw-r--r-- | storeio/dev.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/storeio/dev.h b/storeio/dev.h index 7927f80d..a4321399 100644 --- a/storeio/dev.h +++ b/storeio/dev.h @@ -1,6 +1,6 @@ /* store `device' I/O - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -32,6 +32,20 @@ struct dev /* The device to which we're doing io. */ struct store *store; + /* The current owner of the open device. For terminals, this affects + controlling terminal behavior (see term_become_ctty). For all objects + this affects old-style async IO. Negative values represent pgrps. This + has nothing to do with the owner of a file (as returned by io_stat, and + as used for various permission checks by filesystems). An owner of 0 + indicates that there is no owner. */ + pid_t owner; + + /* Nonzero iff the --no-cache flag was given. + If this is set, the remaining members are not used at all + and don't need to be initialized or cleaned up. */ + int inhibit_cache; + + /* A bitmask corresponding to the part of an offset that lies within a device block. */ unsigned block_mask; @@ -50,21 +64,14 @@ struct dev struct pager *pager; struct mutex pager_lock; - - /* The current owner of the open device. For terminals, this affects - controlling terminal behavior (see term_become_ctty). For all objects - this affects old-style async IO. Negative values represent pgrps. This - has nothing to do with the owner of a file (as returned by io_stat, and - as used for various permission checks by filesystems). An owner of 0 - indicates that there is no owner. */ - pid_t owner; }; /* Returns a pointer to a new device structure in DEV for the device NAME, with the given FLAGS. If BLOCK_SIZE is non-zero, it should be the desired block size, and must be a multiple of the device block size. If an error occurs, the error code is returned, otherwise 0. */ -error_t dev_open (struct store_parsed *name, int flags, struct dev **dev); +error_t dev_open (struct store_parsed *name, int flags, int inhibit_cache, + struct dev **dev); /* Free DEV and any resources it consumes. */ void dev_close (struct dev *dev); |