Lines Matching refs:block

55 					ext4_lblk_t *block)
66 *block = inode->i_size >> inode->i_sb->s_blocksize_bits;
67 map.m_lblk = *block;
71 * We're appending new directory block. Make sure the block is not
79 EXT4_ERROR_INODE(inode, "Logical block already allocated");
83 bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE);
109 * block being read to be an index block, or a block containing
111 * logical block in an htree index block). This is used to control
113 * directory block read from the storage device. EITHER will means
114 * the caller doesn't know what kind of directory block will be read,
121 #define ext4_read_dirblock(inode, block, type) \
122 __ext4_read_dirblock((inode), (block), (type), __func__, __LINE__)
125 ext4_lblk_t block,
134 if (block >= inode->i_size >> inode->i_blkbits) {
135 ext4_error_inode(inode, func, line, block,
136 "Attempting to read directory block (%u) that is past i_size (%llu)",
137 block, inode->i_size);
144 bh = ext4_bread(NULL, inode, block, 0);
148 "error %ld reading directory block",
149 inode->i_ino, (unsigned long)block,
155 ext4_error_inode(inode, func, line, block,
156 "Directory hole found for htree %s block",
163 /* Determine whether or not we have an index block */
165 if (block == 0)
173 ext4_error_inode(inode, func, line, block,
174 "directory leaf block found instead of index block");
183 * An empty leaf block can get mistaken for a index block; for
185 * caller is sure it should be an index block.
192 ext4_error_inode_err(inode, func, line, block,
204 ext4_error_inode_err(inode, func, line, block,
206 "Directory block failed checksum");
237 __le32 block;
286 * This goes at the end of each htree block.
318 u32 hash, ext4_lblk_t block);
341 /* Walk through a dirent block to find a checksum "dirent" at the tail */
564 * Future: use high four bits of block for coalesce-on-delete flags
570 return le32_to_cpu(entry->block) & 0x0fffffff;
575 entry->block = cpu_to_le32(value);
751 ext4_lblk_t block = dx_get_block(entries);
755 printk("%s%3u:%03u hash %8x/%8x ",levels?"":" ", i, block, hash, range);
756 bh = ext4_bread(NULL,dir, block, 0);
800 * Probe for a directory leaf block to search.
818 ext4_lblk_t block;
928 block = dx_get_block(at);
930 if (blocks[i] == block) {
932 "dx entry: tree cycle block %u points back to block %u",
933 blocks[level], block);
939 blocks[level] = block;
941 frame->bh = ext4_read_dirblock(dir, block, INDEX);
991 * block, and reads in the necessary intervening nodes if the search
994 * the search is only continued if the next block starts with that
997 * If the hash value is HASH_NB_ALWAYS, then always go to the next block.
1049 * block so no check is necessary
1066 * directory block. It returns the number directory entries loaded
1070 struct inode *dir, ext4_lblk_t block,
1080 dxtrace(printk(KERN_INFO "In htree dirblock_to_tree: block %lu\n",
1081 (unsigned long)block));
1082 bh = ext4_read_dirblock(dir, block, DIRENT_HTREE);
1110 (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb))
1112 /* silently ignore the rest of the block */
1189 ext4_lblk_t block;
1259 block = dx_get_block(frame->at);
1260 ret = htree_dirblock_to_tree(dir_file, dir, block, &hinfo,
1304 * Directory block splitting, compacting
1308 * Create map of hash values, offsets, and sizes, stored at end of block.
1378 static void dx_insert_block(struct dx_frame *frame, u32 hash, ext4_lblk_t block)
1388 dx_set_block(new, block);
1553 /* prevent looping on a bad block */
1564 static int is_dx_internal_node(struct inode *dir, ext4_lblk_t block,
1571 if (block == 0)
1599 ext4_lblk_t start, block;
1627 * "." or ".." will only be in the first block
1630 block = start = 0;
1655 block = start;
1665 if (block < start)
1666 ra_max = start - block;
1668 ra_max = nblocks - block;
1670 retval = ext4_bread_batch(dir, block, ra_max,
1684 (unsigned long) block);
1690 !is_dx_internal_node(dir, block,
1695 "block %lu", (unsigned long)block);
1702 block << EXT4_BLOCK_SIZE_BITS(sb), res_dir);
1704 EXT4_I(dir)->i_dir_start_lookup = block;
1713 if (++block >= nblocks)
1714 block = 0;
1715 } while (block != start);
1721 block = nblocks;
1723 if (block < nblocks) {
1783 ext4_lblk_t block;
1793 block = dx_get_block(frame->at);
1794 bh = ext4_read_dirblock(dir, block, DIRENT_HTREE);
1799 block << EXT4_BLOCK_SIZE_BITS(sb),
1814 "error %d reading directory index block",
1969 * Split a full leaf block to make room for a new dir entry.
1970 * Allocate a new block, and move entries so that they are approx. equally full.
1971 * Returns pointer to de in block into which the new entry will be inserted.
2014 /* create map in the end of data2 block */
2023 /* Ensure that neither split block is over half full */
2027 /* is more than half of this entry in 2nd half of the block? */
2036 * If the sum of active entries didn't exceed half the block size, just
2037 * split it in half by count; each resulting block will have at least
2047 dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
2071 /* Which block gets the new entry? */
2162 * Add a new entry into a directory (leaf) block. If de is non-NULL,
2165 * add_dirent_to_buf will attempt search the directory block for
2221 * This converts a one block unindexed directory to a 3 block indexed
2237 ext4_lblk_t block;
2256 /* The 0th block becomes the root, move the dirents out */
2267 /* Allocate new block for the 0th block's dirents */
2268 bh2 = ext4_append(handle, dir, &block);
2350 * Even if the block split failed, we have to properly write
2382 ext4_lblk_t block, blocks;
2432 for (block = 0; block < blocks; block++) {
2433 bh = ext4_read_dirblock(dir, block, DIRENT);
2435 bh = ext4_bread(handle, dir, block,
2458 bh = ext4_append(handle, dir, &block);
2538 frame--; /* split higher index block */
2590 /* Which index block gets the new entry? */
2960 ext4_lblk_t block = 0;
2977 dir_block = ext4_append(handle, inode, &block);
3086 /* The first directory block must not be a hole,
3389 * EXT4_DATA_TRANS_BLOCKS for the data block allocation and
3421 /* alloc symlink block and fill it */
3518 * Try to find buffer head where contains the parent block.
3519 * It should be the inode block if it is inlined or the 1st block
3534 /* The first directory block must not be a hole, so
3762 * for inode block, sb block, group summaries,
3916 * from what is now the extent tree root (or a block map).