Home | History | Annotate | Download | only in ext2fs

Lines Matching refs:block

5  * Implements a one-block write-through cache.
56 #define BLKSSZGET _IO(0x12,104)/* get block device sector size */
73 unsigned long block;
101 static errcode_t unix_read_blk(io_channel channel, unsigned long block,
103 static errcode_t unix_write_blk(io_channel channel, unsigned long block,
113 struct unix_cache *cache, unsigned long long block);
114 static errcode_t unix_read_blk64(io_channel channel, unsigned long long block,
116 static errcode_t unix_write_blk64(io_channel channel, unsigned long long block,
158 unsigned long long block,
168 location = ((ext2_loff_t) block * channel->block_size) + data->offset;
211 retval = (channel->read_error)(channel, block, count, buf,
218 unsigned long long block,
236 location = ((ext2_loff_t) block * channel->block_size) + data->offset;
284 retval = (channel->write_error)(channel, block, count, buf,
304 cache->block = 0;
332 cache->block = 0;
345 * Try to find a block in the cache. If the block is not found, and
350 unsigned long long block,
363 if (cache->block == block) {
377 * Reuse a particular cache entry for another block.
380 struct unix_cache *cache, unsigned long long block)
383 raw_write_blk(channel, data, cache->block, 1, cache->buf);
387 cache->block = block;
415 cache->block, 1, cache->buf);
516 /* Is the block device actually writable? */
535 * block devices are wrongly getting hit by the filesize
624 static errcode_t unix_read_blk64(io_channel channel, unsigned long long block,
638 return raw_read_blk(channel, data, block, count, buf);
647 return raw_read_blk(channel, data, block, count, buf);
653 if ((cache = find_cached_block(data, block, &reuse[0]))) {
655 printf("Using cached block %lu\n", block);
659 block++;
669 block);
670 if ((retval = raw_read_blk(channel, data, block, 1,
684 if (find_cached_block(data, block+i, &reuse[i]))
687 printf("Reading %d blocks starting at %lu\n", i, block);
689 if ((retval = raw_read_blk(channel, data, block, i, cp)))
696 reuse_cache(channel, data, cache, block++);
705 static errcode_t unix_read_blk(io_channel channel, unsigned long block,
708 return unix_read_blk64(channel, block, count, buf);
711 static errcode_t unix_write_blk64(io_channel channel, unsigned long long block,
725 return raw_write_blk(channel, data, block, count, buf);
734 return raw_write_blk(channel, data, block, count, buf);
738 * For a moderate-sized multi-block write, first force a write
744 retval = raw_write_blk(channel, data, block, count, buf);
748 cache = find_cached_block(data, block, &reuse);
751 reuse_cache(channel, data, cache, block);
756 block++;
763 static errcode_t unix_write_blk(io_channel channel, unsigned long block,
766 return unix_write_blk64(channel, block, count, buf);