Lines Matching defs:hip
90 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
93 WARN_ON(!mutex_is_locked(&hip->extents_lock));
95 hfsplus_ext_build_key(fd->search_key, inode->i_ino, hip->cached_start,
100 if (hip->extent_state & HFSPLUS_EXT_NEW) {
107 hfs_brec_insert(fd, hip->cached_extents,
109 hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW);
113 hfs_bnode_write(fd->bnode, hip->cached_extents,
115 hip->extent_state &= ~HFSPLUS_EXT_DIRTY;
124 set_bit(HFSPLUS_I_EXT_DIRTY, &hip->flags);
180 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
183 WARN_ON(!mutex_is_locked(&hip->extents_lock));
185 if (hip->extent_state & HFSPLUS_EXT_DIRTY) {
191 res = __hfsplus_ext_read_extent(fd, hip->cached_extents, inode->i_ino,
196 hip->cached_start = be32_to_cpu(fd->key->ext.start_block);
197 hip->cached_blocks =
198 hfsplus_ext_block_count(hip->cached_extents);
200 hip->cached_start = hip->cached_blocks = 0;
201 hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW);
208 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
212 if (block >= hip->cached_start &&
213 block < hip->cached_start + hip->cached_blocks)
230 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
239 if (iblock >= hip->fs_blocks) {
242 if (iblock > hip->fs_blocks)
244 if (ablock >= hip->alloc_blocks) {
252 if (ablock < hip->first_blocks) {
253 dblock = hfsplus_ext_find_block(hip->first_extents, ablock);
260 mutex_lock(&hip->extents_lock);
267 was_dirty = (hip->extent_state & HFSPLUS_EXT_DIRTY);
270 mutex_unlock(&hip->extents_lock);
273 dblock = hfsplus_ext_find_block(hip->cached_extents,
274 ablock - hip->cached_start);
275 mutex_unlock(&hip->extents_lock);
288 hip->phys_size += sb->s_blocksize;
289 hip->fs_blocks++;
444 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
457 mutex_lock(&hip->extents_lock);
458 if (hip->alloc_blocks == hip->first_blocks)
459 goal = hfsplus_ext_lastblock(hip->first_extents);
461 res = hfsplus_ext_read_extent(inode, hip->alloc_blocks);
464 goal = hfsplus_ext_lastblock(hip->cached_extents);
467 len = hip->clump_blocks;
485 if (hip->alloc_blocks <= hip->first_blocks) {
486 if (!hip->first_blocks) {
489 hip->first_extents[0].start_block = cpu_to_be32(start);
490 hip->first_extents[0].block_count = cpu_to_be32(len);
494 res = hfsplus_add_extent(hip->first_extents,
495 hip->alloc_blocks,
501 hfsplus_dump_extent(hip->first_extents);
502 hip->first_blocks += len;
505 res = hfsplus_add_extent(hip->cached_extents,
506 hip->alloc_blocks - hip->cached_start,
509 hfsplus_dump_extent(hip->cached_extents);
510 hip->extent_state |= HFSPLUS_EXT_DIRTY;
511 hip->cached_blocks += len;
517 hip->alloc_blocks += len;
518 mutex_unlock(&hip->extents_lock);
522 mutex_unlock(&hip->extents_lock);
531 memset(hip->cached_extents, 0, sizeof(hfsplus_extent_rec));
532 hip->cached_extents[0].start_block = cpu_to_be32(start);
533 hip->cached_extents[0].block_count = cpu_to_be32(len);
534 hfsplus_dump_extent(hip->cached_extents);
535 hip->extent_state |= HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW;
536 hip->cached_start = hip->alloc_blocks;
537 hip->cached_blocks = len;
546 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
552 inode->i_ino, (long long)hip->phys_size, inode->i_size);
554 if (inode->i_size > hip->phys_size) {
570 } else if (inode->i_size == hip->phys_size)
576 mutex_lock(&hip->extents_lock);
578 alloc_cnt = hip->alloc_blocks;
584 mutex_unlock(&hip->extents_lock);
589 if (alloc_cnt == hip->first_blocks) {
591 hfsplus_free_extents(sb, hip->first_extents,
593 hfsplus_dump_extent(hip->first_extents);
594 hip->first_blocks = blk_cnt;
602 start = hip->cached_start;
606 hfsplus_free_extents(sb, hip->cached_extents,
608 hfsplus_dump_extent(hip->cached_extents);
611 hip->extent_state |= HFSPLUS_EXT_DIRTY;
615 hip->cached_start = hip->cached_blocks = 0;
616 hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW);
620 hip->alloc_blocks = blk_cnt;
622 mutex_unlock(&hip->extents_lock);
623 hip->phys_size = inode->i_size;
624 hip->fs_blocks = (inode->i_size + sb->s_blocksize - 1) >>
626 inode_set_bytes(inode, hip->fs_blocks << sb->s_blocksize_bits);