Lines Matching refs:block

17  * Added 32k buffer block sizes - these are required older ARM systems. - RMK
49 #include <trace/events/block.h>
131 "Buffer I/O error on dev %pg, logical block %llu%s\n",
190 __find_get_block_slow(struct block_device *bdev, sector_t block)
202 index = ((loff_t)block << bd_inode->i_blkbits) / PAGE_SIZE;
215 else if (bh->b_blocknr == block) {
225 * file io on the block device and getblk. It gets dealt with
230 printk("__find_get_block_slow() failed. block=%llu, "
233 (unsigned long long)block,
653 * Called when we've recently written block `bblock', and it is known that
654 * `bblock' was for a buffer_boundary() buffer. This means that the block at
655 * `bblock + 1' is probably a dirty indirect block. Hunt it down and, if it's
1002 sector_t block = div_u64(folio_pos(folio), size);
1010 bh->b_blocknr = block;
1013 if (block < end_block)
1016 block++;
1021 * Caller needs to validate requested block against end of device.
1027 * Create the page-cache folio that contains the requested block.
1034 static bool grow_dev_folio(struct block_device *bdev, sector_t block,
1059 * the block size?
1083 return block < end_block;
1087 * Create buffers for the specified block device block's folio. If
1091 static bool grow_buffers(struct block_device *bdev, sector_t block,
1097 * Check for a block which lies outside our maximum possible
1100 if (check_mul_overflow(block, (sector_t)size, &pos) || pos > MAX_LFS_FILESIZE) {
1101 printk(KERN_ERR "%s: requested out-of-range block %llu for device %pg\n",
1102 __func__, (unsigned long long)block,
1108 return grow_dev_folio(bdev, block, pos / PAGE_SIZE, size, gfp);
1112 __getblk_slow(struct block_device *bdev, sector_t block,
1118 printk(KERN_ERR "getblk(): invalid block size %d requested\n",
1120 printk(KERN_ERR "logical block size: %d\n",
1130 bh = __find_get_block(bdev, block, size);
1134 if (!grow_buffers(bdev, block, size, gfp))
1356 lookup_bh_lru(struct block_device *bdev, sector_t block, unsigned size)
1370 if (bh && bh->b_blocknr == block && bh->b_bdev == bdev &&
1395 __find_get_block(struct block_device *bdev, sector_t block, unsigned size)
1397 struct buffer_head *bh = lookup_bh_lru(bdev, block, size);
1401 bh = __find_get_block_slow(bdev, block);
1412 * bdev_getblk - Get a buffer_head in a block device's buffer cache.
1413 * @bdev: The block device.
1414 * @block: The block number.
1420 struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block,
1423 struct buffer_head *bh = __find_get_block(bdev, block, size);
1429 return __getblk_slow(bdev, block, size, gfp);
1436 void __breadahead(struct block_device *bdev, sector_t block, unsigned size)
1438 struct buffer_head *bh = bdev_getblk(bdev, block, size,
1449 * __bread_gfp() - reads a specified block and returns the bh
1451 * @block: number of block
1455 * Reads a specified block, and returns buffer head that contains it.
1458 * It returns NULL if the block was unreadable.
1461 __bread_gfp(struct block_device *bdev, sector_t block,
1474 bh = bdev_getblk(bdev, block, size, gfp);
1619 * is this block fully invalidated?
1678 * clean_bdev_aliases: clean a range of buffers in block device
1680 * @block: Start of a range of blocks to clean
1686 * will not happen until we will free that block ;-) We don't even need to mark
1697 void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len)
1702 pgoff_t index = ((loff_t)block << bd_inode->i_blkbits) / PAGE_SIZE;
1708 end = ((loff_t)(block + len - 1) << bd_inode->i_blkbits) / PAGE_SIZE;
1729 if (!buffer_mapped(bh) || (bh->b_blocknr < block))
1731 if (bh->b_blocknr >= block + len)
1799 sector_t block;
1822 block = div_u64(folio_pos(folio), blocksize);
1830 if (block > last_block) {
1844 err = get_block(inode, block, bh, 1);
1855 block++;
1962 * block data from leaking). And clear the new bit.
2003 iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
2006 loff_t offset = (loff_t)block << inode->i_blkbits;
2013 * current block, then do not map the buffer and let the caller
2023 * we need to mark it as new to ensure sub-block zeroing is
2041 * in the block we are not writing to are zeroed. Mark the
2051 * This can happen if truncating the block device races
2053 * block devices aren't synchronized by i_rwsem for
2054 * block devices.
2077 sector_t block;
2088 block = div_u64(folio_pos(folio), blocksize);
2091 block++, block_start=block_end, bh = bh->b_this_page) {
2105 err = get_block(inode, block, bh, 1);
2107 err = iomap_to_bh(inode, block, bh, iomap);
2197 * block_write_begin takes care of the basic task of block allocation and
2200 * The filesystem needs to handle block truncation upon failure.
2342 * Generic "read_folio" function for block devices that have the normal
2343 * get_block functionality. This is most of the block device filesystems.
2517 /* if we will expand the thing last block will be filled */
2736 sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
2744 get_block(inode, block, &tmp, 0);
2873 * may be against a block device, and a later reattachment of buffers