Lines Matching defs:inode
47 * group preallocation or inode preallocation depending on the size of
59 * First stage the allocator looks at the inode prealloc list,
61 * spaces for this particular inode. The inode prealloc space is
69 * The inode preallocation space is used looking at the _logical_ start
74 * The important thing to be noted in case of inode prealloc space is that
75 * we don't modify the values associated to inode prealloc space except
78 * If we are not able to find blocks in the inode prealloc space and if we
90 * If we can't allocate blocks via inode prealloc or/and locality group
92 * by ext4_sb_info.s_buddy_cache (struct inode) whose file offset gets
94 * groups. The buddy information is attached to buddy cache inode so that
98 * inode as:
109 * The buddy cache inode is not stored on disk. The inode is thrown
119 * list. In case of inode preallocation we follow a list of heuristics
166 * - inode
167 * assiged to specific inode and can be used for this inode only.
168 * it describes part of inode's space preallocated to specific
177 * permanent set of inodes: inode can join and leave group. space
178 * from this type of preallocation can be used for any inode. thus
198 * - use inode PA: on-disk += N; PA -= N
199 * - discard inode PA buddy -= on-disk - PA; PA = 0
223 * - use inode PA
226 * - discard inode PA
233 * - use inode PA
235 * - discard inode PA
241 * - use inode PA
242 * - use inode PA
244 * - discard inode PA
274 * find proper PA (per-inode or group)
290 * remove PA from object (inode or locality group)
293 * - discard inode's preallocations:
301 * - object (inode/locality) (object)
321 * - discard all for given object (inode, locality group):
477 static void mb_free_blocks_double(struct inode *inode, struct ext4_buddy *e4b,
493 inode ? inode->i_ino : 0,
566 static inline void mb_free_blocks_double(struct inode *inode,
844 /* The buddy information is attached the buddy cache inode
848 * stored in the inode as
877 struct inode *inode;
882 inode = page->mapping->host;
883 sb = inode->i_sb;
885 blocksize = i_blocksize(inode);
1040 struct inode *inode = EXT4_SB(sb)->s_buddy_cache;
1050 * the buddy cache inode stores the block bitmap
1057 page = find_or_create_page(inode->i_mapping, pnum, gfp);
1060 BUG_ON(page->mapping != inode->i_mapping);
1071 page = find_or_create_page(inode->i_mapping, pnum, gfp);
1074 BUG_ON(page->mapping != inode->i_mapping);
1178 struct inode *inode = sbi->s_buddy_cache;
1206 * the buddy cache inode stores the block bitmap
1216 page = find_get_page_flags(inode->i_mapping, pnum, FGP_ACCESSED);
1228 page = find_or_create_page(inode->i_mapping, pnum, gfp);
1230 BUG_ON(page->mapping != inode->i_mapping);
1260 page = find_get_page_flags(inode->i_mapping, pnum, FGP_ACCESSED);
1264 page = find_or_create_page(inode->i_mapping, pnum, gfp);
1266 BUG_ON(page->mapping != inode->i_mapping);
1477 static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
1495 mb_free_blocks_double(inode, e4b, first, count);
1519 inode ? inode->i_ino : 0,
2806 ext4_msg(sb, KERN_ERR, "can't get new inode");
2809 /* To avoid potentially colliding with an valid on-disk inode number,
2810 * use EXT4_BAD_INO for the buddy cache inode number. This inode is
2811 * not in the inode hash, so it should never be found by iget(), but
3768 * Called on failure; free up any blocks from the inode PA for this
3804 * use blocks preallocated to inode
3831 mb_debug(ac->ac_sb, "use %llu/%d from inode pa %p\n", start, len, pa);
3939 /* inode may have no locality group for some reason */
4137 * creates new preallocated space for given inode
4213 mb_debug(sb, "new inode pa %p: %llu/%d for %u\n", pa, pa->pa_pstart,
4304 * @pa must be unlinked from inode and group lists, so that
4306 * the caller MUST hold group/inode locks.
4463 /* remove from object (inode or locality group) */
4487 * releases all non-used preallocated blocks for given inode
4491 * space when we are discarding the inode prealloc space.
4495 void ext4_discard_preallocations(struct inode *inode, unsigned int needed)
4497 struct ext4_inode_info *ei = EXT4_I(inode);
4498 struct super_block *sb = inode->i_sb;
4506 if (!S_ISREG(inode->i_mode)) {
4514 mb_debug(sb, "discard preallocation for inode %lu\n",
4515 inode->i_ino);
4516 trace_ext4_discard_preallocations(inode,
4525 /* first, collect all pa's in the inode */
4560 * ->clear_inode() the inode will get freed
4562 * pa from inode's list may access already
4768 struct super_block *sb = ar->inode->i_sb;
4794 ac->ac_inode = ar->inode;
4812 inode_is_open_for_write(ar->inode) ? "" : "non-");
4952 * if per-inode prealloc list is too long, trim some PA
4954 static void ext4_mb_trim_inode_pa(struct inode *inode)
4956 struct ext4_inode_info *ei = EXT4_I(inode);
4957 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
4964 ext4_discard_preallocations(inode, count);
4973 struct inode *inode = ac->ac_inode;
4974 struct ext4_inode_info *ei = EXT4_I(inode);
5003 * treat per-inode prealloc list as a lru list, then try
5020 ext4_mb_trim_inode_pa(inode);
5096 sb = ar->inode->i_sb;
5104 if (ext4_is_quota_file(ar->inode))
5126 dquot_alloc_block_nofail(ar->inode,
5130 dquot_alloc_block(ar->inode,
5217 dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len));
5340 struct super_block *sb = ar->inode->i_sb;
5394 static void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
5398 struct super_block *sb = inode->i_sb;
5439 * @inode: inode
5445 static void ext4_mb_clear_bb(handle_t *handle, struct inode *inode,
5450 struct super_block *sb = inode->i_sb;
5466 !ext4_inode_block_valid(inode, block, count)) {
5507 !ext4_inode_block_valid(inode, block, count)) {
5535 trace_ext4_mballoc_free(sb, inode, block_group, bit, count_clusters);
5545 * transaction is committed. We make an exception if the inode is to be
5551 !ext4_should_writeback_data(inode))) {
5585 mb_free_blocks(inode, &e4b, bit, count_clusters);
5608 dquot_free_block(inode, EXT4_C2B(sbi, count_clusters));
5642 * @inode: inode
5648 void ext4_free_blocks(handle_t *handle, struct inode *inode,
5652 struct super_block *sb = inode->i_sb;
5666 ext4_free_blocks_simple(inode, block, EXT4_NUM_B2C(sbi, count));
5673 !ext4_inode_block_valid(inode, block, count)) {
5681 trace_ext4_free_blocks(inode, block, count, flags);
5687 inode, bh, block);
5733 bh = sb_find_get_block(inode->i_sb, block + i);
5734 ext4_forget(handle, is_metadata, inode, bh, block + i);
5738 ext4_mb_clear_bb(handle, inode, block, count, flags);