From 7923631d706ab5d80b5274966343fb25bce3d375 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 22 May 1996 00:00:43 +0000 Subject: (store_write): Return an error if STORE is readonly. (store_read, store_read): References to METHS field changed to CLASS. --- libstore/rdwr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libstore') diff --git a/libstore/rdwr.c b/libstore/rdwr.c index 2757fb68..9e9d3f84 100644 --- a/libstore/rdwr.c +++ b/libstore/rdwr.c @@ -101,7 +101,10 @@ store_write (struct store *store, off_t base; struct store_run *run, *runs_end; int block_shift = store->log2_block_size; - store_write_meth_t write = store->meths->write; + store_write_meth_t write = store->class->write; + + if (store->flags & STORE_READONLY) + return EROFS; /* XXX */ addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) @@ -167,7 +170,7 @@ store_read (struct store *store, off_t base; struct store_run *run, *runs_end; int block_shift = store->log2_block_size; - store_read_meth_t read = store->meths->read; + store_read_meth_t read = store->class->read; addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) -- cgit v1.2.3