diff options
-rw-r--r-- | ext2fs/ChangeLog | 5 | ||||
-rw-r--r-- | ext2fs/hyper.c | 4 | ||||
-rw-r--r-- | libdiskfs/ChangeLog | 2 | ||||
-rw-r--r-- | libdiskfs/dev-globals.c | 46 | ||||
-rw-r--r-- | libdiskfs/dev-io.c | 59 | ||||
-rw-r--r-- | libdiskfs/dev-open.c | 66 | ||||
-rw-r--r-- | ufs/ChangeLog | 5 | ||||
-rw-r--r-- | ufs/hyper.c | 4 |
8 files changed, 18 insertions, 173 deletions
diff --git a/ext2fs/ChangeLog b/ext2fs/ChangeLog index 8f5172ac..4d98dc70 100644 --- a/ext2fs/ChangeLog +++ b/ext2fs/ChangeLog @@ -1,3 +1,8 @@ +1999-06-29 Thomas Bushnell, BSG <tb@mit.edu> + + * hyper.c (diskfs_readonly_changed): Adjust whether the store + should permit writes too. + 1999-06-19 Roland McGrath <roland@baalperazim.frob.com> * pager.c (free_page_buf): Fix type cast. diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index d7536014..6a5e1fd0 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -1,6 +1,6 @@ /* Fetching and storing the hypermetadata (superblock and bg summary info) - Copyright (C) 1994,95,96,99 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,99, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.org> @@ -192,6 +192,8 @@ diskfs_readonly_changed (int readonly) { allocate_mod_map (); + (*(readonly ? store_set_flags : store_clear_flags)) (store, STORE_READONLY); + vm_protect (mach_task_self (), (vm_address_t)disk_image, store->size, 0, VM_PROT_READ | (readonly ? 0 : VM_PROT_WRITE)); diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index 81118fe2..686f49a3 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,5 +1,7 @@ 1999-06-29 Thomas Bushnell, BSG <tb@mit.edu> + * dev-globals.c, dev-io.c, dev-open.c: Files removed. + * lookup.c (diskfs_lookup): If we get an error from fshelp_checkdirmod, clear *NP as well as returning the error. Use diskfs_nrele instead of diskfs_nput in case *NP and DP are diff --git a/libdiskfs/dev-globals.c b/libdiskfs/dev-globals.c deleted file mode 100644 index c32b6a59..00000000 --- a/libdiskfs/dev-globals.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Standard device global variables - - Copyright (C) 1995 Free Software Foundation, Inc. - - Written by Miles Bader <miles@gnu.ai.mit.edu> - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <diskfs.h> - -/* A mach device port for the device we're using. */ -mach_port_t diskfs_device = MACH_PORT_NULL; - -/* The mach device name of DISKFS_DEVICE. May be 0 if unknown. */ -char *diskfs_device_name = 0; - -/* The first valid block of DISKFS_DEVICE, in units of - DISKFS_DEVICE_BLOCK_SIZE. */ -off_t diskfs_device_start = 0; - -/* The usable size of DISKFS_DEVICE, in units of DISKFS_DEVICE_BLOCK_SIZE. */ -off_t diskfs_device_size = 0; - -/* The unit of addressing for DISKFS_DEVICE. */ -unsigned diskfs_device_block_size = 0; - -/* Some handy calculations based on DISKFS_DEVICE_BLOCK_SIZE. */ -/* Log base 2 of DEVICE_BLOCK_SIZE, or 0 if it's not a power of two. */ -unsigned diskfs_log2_device_block_size = 0; -/* Log base 2 of the number of device blocks in a vm page, or 0 if it's not a - power of two. */ -unsigned diskfs_log2_device_blocks_per_page = 0; diff --git a/libdiskfs/dev-io.c b/libdiskfs/dev-io.c deleted file mode 100644 index d3be449f..00000000 --- a/libdiskfs/dev-io.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Device input and output - Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - -This file is part of the GNU Hurd. - -The GNU Hurd is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -The GNU Hurd is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with the GNU Hurd; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <device/device.h> -#include <device/device_request.h> - -#include <diskfs.h> - -/* Write disk block ADDR with DATA of LEN bytes to DISKFS_DEVICE, waiting for - completion. ADDR is offset by DISKFS_DEVICE_START. If an error occurs, - EIO is returned. */ -error_t -diskfs_device_write_sync (off_t addr, vm_address_t data, size_t len) -{ - int written; - error_t err; - - assert (!diskfs_readonly); - err = device_write (diskfs_device, 0, diskfs_device_start + addr, - (io_buf_ptr_t) data, len, &written); - - if (err == D_READ_ONLY) - return EROFS; - else if (err || written != len) - return EIO; - return 0; -} - -/* Read disk block ADDR from DISKFS_DEVICE; put the address of the data in - DATA; read LEN bytes. Always *DATA should be a full page no matter what. - ADDR is offset by DISKFS_DEVICE_START. If an error occurs, EIO is - returned. */ -error_t -diskfs_device_read_sync (off_t addr, vm_address_t *data, size_t len) -{ - unsigned read; - if (device_read (diskfs_device, 0, diskfs_device_start + addr, len, - (io_buf_ptr_t *)data, &read) - || read != len) - return EIO; - return 0; -} - diff --git a/libdiskfs/dev-open.c b/libdiskfs/dev-open.c deleted file mode 100644 index 5b45c30e..00000000 --- a/libdiskfs/dev-open.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Standard device opening - - Copyright (C) 1995 Free Software Foundation, Inc. - - Written by Miles Bader <miles@gnu.ai.mit.edu> - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <diskfs.h> - -/* Uses the values of DISKFS_DEVICE_ARG and DISKFS_USE_MACH_DEVICE, and - attempts to open the device and set the values of DISKFS_DEVICE, - DISKFS_DEVICE_NAME, DISKFS_DEVICE_START, DISKFS_DEVICE_SIZE, and - DISKFS_DEVICE_BLOCK_SIZE. */ -error_t -diskfs_device_open () -{ - error_t err; - if (diskfs_use_mach_device) - { - diskfs_device_name = diskfs_device_arg; - err = - diskfs_get_mach_device (diskfs_device_name, &diskfs_device, - &diskfs_device_start, &diskfs_device_size, - &diskfs_device_block_size); - } - else - err = - diskfs_get_file_device (diskfs_device_arg, - &diskfs_device_name, &diskfs_device, - &diskfs_device_start, &diskfs_device_size, - &diskfs_device_block_size); - - if (! err) - { - diskfs_log2_device_block_size = 0; - while ((1 << diskfs_log2_device_block_size) < diskfs_device_block_size) - diskfs_log2_device_block_size++; - while ((1 << diskfs_log2_device_block_size) != diskfs_device_block_size) - diskfs_log2_device_block_size = 0; - - diskfs_log2_device_blocks_per_page = 0; - while ((diskfs_device_block_size << diskfs_log2_device_blocks_per_page) - < vm_page_size) - diskfs_log2_device_blocks_per_page++; - if ((diskfs_device_block_size << diskfs_log2_device_blocks_per_page) - != vm_page_size) - diskfs_log2_device_blocks_per_page = 0; - } - - return err; -} diff --git a/ufs/ChangeLog b/ufs/ChangeLog index 16ae4238..7b0fee70 100644 --- a/ufs/ChangeLog +++ b/ufs/ChangeLog @@ -1,3 +1,8 @@ +1999-06-29 Thomas Bushnell, BSG <tb@mit.edu> + + * hyper.c (diskfs_readonly_changed): Adjust whether the store + should permit writes too. + 1999-05-02 Roland McGrath <roland@baalperazim.frob.com> * main.c (main): Remove bogus uninitialized variable ERR. diff --git a/ufs/hyper.c b/ufs/hyper.c index 2a43bfed..c5101141 100644 --- a/ufs/hyper.c +++ b/ufs/hyper.c @@ -1,5 +1,5 @@ /* Fetching and storing the hypermetadata (superblock and cg summary info). - Copyright (C) 1994, 95, 96, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -396,6 +396,8 @@ copy_sblock () void diskfs_readonly_changed (int readonly) { + (*(readonly ? store_set_flags : store_clear_flags)) (store, STORE_READONLY); + vm_protect (mach_task_self (), (vm_address_t)disk_image, store->size, 0, VM_PROT_READ | (readonly ? 0 : VM_PROT_WRITE)); |