summaryrefslogtreecommitdiff
path: root/ext2fs/getblk.c
AgeCommit message (Collapse)Author
2013-09-16Large store support for ext2fsRichard Braun
This is a revised version of the large store patch for ext2fs, written by Ognyan Kulev. It provides support for stores larger than 2 GiB. * ext2fs/balloc.c: Use the new disk_cache_block_ref and disk_cache_block_deref functions to access blocks from the disk cache. * ext2fs/ext2fs.c (main): Update initialization call to pokel_init, and call map_hypermetadata instead of get_hypermetadata. * ext2fs/ext2fs.h: Include <hurd/store.h> and <hurd/ihash.h>. (DISK_CACHE_BLOCKS): New macro. (DC_INCORE): Likewise. (DC_UNTOUCHED): Likewise. (DC_FIXED): Likewise. (DC_DONT_REUSE): Likewise. (DC_NO_BLOCK): Likewise. (DISK_CACHE_LAST_READ_XOR) [!NDEBUG]: Likewise. (struct disk_cache_info): New structure. (disk_cache): New external variable. (disk_cache_size): Likewise. (disk_cache_blocks): Likewise. (disk_cache_bptr): Likewise. (disk_cache_info): Likewise. (disk_cache_lock): Likewise. (disk_cache_reassociation): Likewise. (disk_cache_block_ref): New declaration. (disk_cache_block_ref_ptr): Likewise. (disk_cache_block_deref): Likewise. (disk_cache_block_is_ref): Likewise. (map_hypermetadata): Likewise. (trunc_block): Cast to off_t. (round_block): Likewise. (boffs): Likewise. (bptr_index): New macro. (boffs_ptr): Rewrite as an inline function to make it look up a block from the disk cache. (bptr_offs): Likewise. (dino): Remove function, replaced with ... (dino_ref): ... this one, which adds a reference to the inode block. (dino_deref): New inline function. (record_global_poke): Make sure block is referenced. (record_indir_poke): Likewise. (sync_global_ptr): Remove block reference, and adjust call to pager_sync_some. (sync_global): Add debug call to print wait parameter. * ext2fs/getblk.c: Use the new disk_cache_block_ref and disk_cache_block_deref functions to access blocks from the disk cache. * ext2fs/hyper.c (get_hypermetadata): Read the superblock from the store now that it's not directly mapped in memory. Move the initialization of zeroblock here from ... (map_hypermetadata): ... here. Also, set the superblock pointer. (diskfs_set_hypermetadata): Add a reference to the superblock. (diskfs_readonly_changed): Update call to mprotect. * ext2fs/ialloc.c: Use the new disk_cache_block_ref, disk_cache_block_ref_ptr and disk_cache_block_deref functions to access blocks from the disk cache. * ext2fs/inode.c: Update calls that used the disk image to use the disk cache, and use the new reference handling functions where appropriate. * ext2fs/pager.c: Include <unistd.h> and "../libpager/priv.h". (disk_image): Remove global variable. (disk_pager_read_page): Update cache information. (disk_pager_write_page): Likewise. (disk_pager_notify_evict): New function. (pager_notify_evict): Call disk_pager_notify_evict appropriately. (disk_cache): New global variable. (disk_cache_size): Likewise. (disk_cache_blocks): Likewise. (disk_cache_bptr): Likewise. (disk_cache_info): Likewise. (disk_cache_hint): Likewise. (disk_cache_lock): Likewise. (disk_cache_reassociation): Likewise. (disk_cache_init): New function. (disk_cache_return_unused): Likewise. (disk_cache_block_ref): Likewise. (disk_cache_block_ref_ptr): Likewise. (disk_cache_block_deref): Likewise. (disk_cache_block_is_ref): Likewise. (create_disk_pager): Update initialization of the disk pager. * ext2fs/pokel.c (pokel_add): Drop block references with disk_cache_block_deref. (_pokel_exec): Likewise. * ext2fs/truncate.c (trunc_indirect): Use the new disk_cache_block_ref and disk_cache_block_deref functions to access blocks from the disk cache.
2004-01-102004-01-10 Roberto Reale <rreale@iol.it>Roland McGrath
* ext2fs.h (ext2_getblk): Fix typo in comment. * getblk.c (ext2_getblk): Likewise. * dir.c (diskfs_get_directs): Likewise.
2000-03-102000-03-09 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* balloc.c (ext2_free_blocks, ext2_new_block): Fix formats to avoid -Wformat warnings. * getblk.c (ext2_alloc_block, inode_getblk, ext2_getblk): Likewise. * ialloc.c (ext2_count_free_inodes): Likewise. * truncate.c (trunc_direct): Likewise. * pager.c (pending_blocks_write, diskfs_grow): Likewise.
1999-08-231999-08-23 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* balloc.c (ext2_new_block): Take new arg PREALLOC_GOAL. Use that instead of hard-coded 8 as maximum of blocks to preallocate. Also test that instead of PREALLOC_COUNT to decide whether to try any preallocation at all. * getblk.c (ext2_alloc_block): Pass new arg to ext2_new_block. Use EXT2_DEFAULT_PREALLOC_BLOCKS as default (replaces hard-coded 8); For a regular file, use SBLOCK->s_prealloc_blocks before default. For a directory, use SBLOCK->s_dir_prealloc_blocks if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is set, otherwise zero. * inode.c (diskfs_set_translator): Pass new arg (zero).
1999-05-231999-05-23 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* ialloc.c (diskfs_alloc_node): Frob printf format to suppress warning. * getblk.c (ext2_getblk): Likewise. * balloc.c (ext2_free_blocks): Likewise. * hyper.c (get_hypermetadata): Likewise.
1996-04-11Replace references to the NUMBER field in a node's disknode structures withMiles Bader
references to the CACHE_ID field in the node.
1996-01-14(inode_getblk, block_getblk): Set dn_set_mtime too.Miles Bader
1995-09-15u32 --> block_tMiles Bader
1995-05-12Change uses of the ext2_{warning,error,panic} functions to not have theMiles Bader
initial function name argument (it's now supplied automagically).
1995-05-10(block_getblk, inode_getblk): Return ENOSPC instead of EIO when we can'tMiles Bader
allocate a new block.
1995-05-09entered into RCSMiles Bader
1995-05-01Formerly getblk.c.~15~Miles Bader
1995-04-29Formerly getblk.c.~14~Miles Bader
1995-04-27Formerly getblk.c.~13~Miles Bader
1995-04-24Formerly getblk.c.~12~Miles Bader
1995-04-22Formerly getblk.c.~11~Miles Bader
1995-04-20Formerly getblk.c.~10~Miles Bader
1995-04-17Formerly getblk.c.~9~Miles Bader
1995-04-16Formerly getblk.c.~8~Miles Bader
1995-04-16Formerly getblk.c.~7~Miles Bader
1995-04-16Formerly getblk.c.~6~Miles Bader
1995-04-16Formerly getblk.c.~5~Miles Bader
1995-04-15Formerly getblk.c.~4~Miles Bader
1995-04-12Formerly getblk.c.~3~Miles Bader
1995-04-12Formerly getblk.c.~2~Miles Bader
1995-04-12Initial revisionMiles Bader