Lines Matching refs:HFSPLUS_SB

32 	u32 cnt = atomic_read(&HFSPLUS_SB(sb).inode_cnt);  in hfsplus_inode_check()
33 u32 last_cnt = HFSPLUS_SB(sb).last_inode_cnt; in hfsplus_inode_check()
37 HFSPLUS_SB(sb).last_inode_cnt = cnt; in hfsplus_inode_check()
39 HFSPLUS_SB(sb).cat_tree ? HFSPLUS_SB(sb).cat_tree->node_hash_cnt : 0); in hfsplus_inode_check()
50 atomic_inc(&HFSPLUS_SB(inode->i_sb).inode_cnt); in hfsplus_read_inode()
55 hfsplus_find_init(HFSPLUS_SB(inode->i_sb).cat_tree, &fd); in hfsplus_read_inode()
64 vhdr = HFSPLUS_SB(inode->i_sb).s_vhdr; in hfsplus_read_inode()
105 vhdr = HFSPLUS_SB(inode->i_sb).s_vhdr; in hfsplus_write_inode()
112 HFSPLUS_SB(inode->i_sb).flags |= HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_inode()
116 hfsplus_write_btree(HFSPLUS_SB(inode->i_sb).ext_tree); in hfsplus_write_inode()
120 HFSPLUS_SB(inode->i_sb).flags |= HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_inode()
124 hfsplus_write_btree(HFSPLUS_SB(inode->i_sb).cat_tree); in hfsplus_write_inode()
128 HFSPLUS_SB(inode->i_sb).flags |= HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_inode()
135 HFSPLUS_SB(inode->i_sb).flags |= HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_inode()
142 HFSPLUS_SB(inode->i_sb).flags |= HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_inode()
146 hfsplus_write_btree(HFSPLUS_SB(inode->i_sb).attr_tree); in hfsplus_write_inode()
153 atomic_dec(&HFSPLUS_SB(inode->i_sb).inode_cnt); in hfsplus_clear_inode()
163 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; in hfsplus_write_super()
171 vhdr->free_blocks = cpu_to_be32(HFSPLUS_SB(sb).free_blocks); in hfsplus_write_super()
172 vhdr->next_alloc = cpu_to_be32(HFSPLUS_SB(sb).next_alloc); in hfsplus_write_super()
173 vhdr->next_cnid = cpu_to_be32(HFSPLUS_SB(sb).next_cnid); in hfsplus_write_super()
174 vhdr->folder_count = cpu_to_be32(HFSPLUS_SB(sb).folder_count); in hfsplus_write_super()
175 vhdr->file_count = cpu_to_be32(HFSPLUS_SB(sb).file_count); in hfsplus_write_super()
177 mark_buffer_dirty(HFSPLUS_SB(sb).s_vhbh); in hfsplus_write_super()
178 if (HFSPLUS_SB(sb).flags & HFSPLUS_SB_WRITEBACKUP) { in hfsplus_write_super()
179 if (HFSPLUS_SB(sb).sect_count) { in hfsplus_write_super()
183 block = HFSPLUS_SB(sb).blockoffset; in hfsplus_write_super()
184 block += (HFSPLUS_SB(sb).sect_count - 2) >> (sb->s_blocksize_bits - 9); in hfsplus_write_super()
185 offset = ((HFSPLUS_SB(sb).sect_count - 2) << 9) & (sb->s_blocksize - 1); in hfsplus_write_super()
191 memcpy(vhdr, HFSPLUS_SB(sb).s_vhdr, sizeof(*vhdr)); in hfsplus_write_super()
197 HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP; in hfsplus_write_super()
205 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; in hfsplus_put_super()
210 mark_buffer_dirty(HFSPLUS_SB(sb).s_vhbh); in hfsplus_put_super()
211 ll_rw_block(WRITE, 1, &HFSPLUS_SB(sb).s_vhbh); in hfsplus_put_super()
212 wait_on_buffer(HFSPLUS_SB(sb).s_vhbh); in hfsplus_put_super()
215 hfsplus_close_btree(HFSPLUS_SB(sb).cat_tree); in hfsplus_put_super()
216 hfsplus_close_btree(HFSPLUS_SB(sb).ext_tree); in hfsplus_put_super()
217 iput(HFSPLUS_SB(sb).alloc_file); in hfsplus_put_super()
218 iput(HFSPLUS_SB(sb).hidden_dir); in hfsplus_put_super()
219 brelse(HFSPLUS_SB(sb).s_vhbh); in hfsplus_put_super()
226 buf->f_blocks = be32_to_cpu(HFSPLUS_SB(sb).s_vhdr->total_blocks); in hfsplus_statfs()
227 buf->f_bfree = HFSPLUS_SB(sb).free_blocks; in hfsplus_statfs()
230 buf->f_ffree = 0xFFFFFFFF - HFSPLUS_SB(sb).next_cnid; in hfsplus_statfs()
241 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; in hfsplus_remount()
291 memset(sbi, 0, sizeof(HFSPLUS_SB(sb))); in hfsplus_read_super()
303 INIT_LIST_HEAD(&HFSPLUS_SB(sb).rsrc_inodes); in hfsplus_read_super()
316 fill_current(sbi, &HFSPLUS_SB(sb)); in hfsplus_read_super()
327 vhdr = HFSPLUS_SB(sb).s_vhdr; in hfsplus_read_super()
336 HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks); in hfsplus_read_super()
337 HFSPLUS_SB(sb).free_blocks = be32_to_cpu(vhdr->free_blocks); in hfsplus_read_super()
338 HFSPLUS_SB(sb).next_alloc = be32_to_cpu(vhdr->next_alloc); in hfsplus_read_super()
339 HFSPLUS_SB(sb).next_cnid = be32_to_cpu(vhdr->next_cnid); in hfsplus_read_super()
340 HFSPLUS_SB(sb).file_count = be32_to_cpu(vhdr->file_count); in hfsplus_read_super()
341 HFSPLUS_SB(sb).folder_count = be32_to_cpu(vhdr->folder_count); in hfsplus_read_super()
359 HFSPLUS_SB(sb).ext_tree = hfsplus_open_btree(sb, HFSPLUS_EXT_CNID); in hfsplus_read_super()
360 if (!HFSPLUS_SB(sb).ext_tree) { in hfsplus_read_super()
365 HFSPLUS_SB(sb).cat_tree = hfsplus_open_btree(sb, HFSPLUS_CAT_CNID); in hfsplus_read_super()
366 if (!HFSPLUS_SB(sb).cat_tree) { in hfsplus_read_super()
372 HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID); in hfsplus_read_super()
373 if (!HFSPLUS_SB(sb).alloc_file) { in hfsplus_read_super()
389 hfsplus_find_init(HFSPLUS_SB(sb).cat_tree, &fd); in hfsplus_read_super()
395 HFSPLUS_SB(sb).hidden_dir = iget(sb, be32_to_cpu(entry.folder.id)); in hfsplus_read_super()
396 if (!HFSPLUS_SB(sb).hidden_dir) in hfsplus_read_super()
412 mark_buffer_dirty(HFSPLUS_SB(sb).s_vhbh); in hfsplus_read_super()
413 ll_rw_block(WRITE, 1, &HFSPLUS_SB(sb).s_vhbh); in hfsplus_read_super()
414 wait_on_buffer(HFSPLUS_SB(sb).s_vhbh); in hfsplus_read_super()
416 if (!HFSPLUS_SB(sb).hidden_dir) { in hfsplus_read_super()
418 HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR); in hfsplus_read_super()
419 hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode, in hfsplus_read_super()
420 &str, HFSPLUS_SB(sb).hidden_dir); in hfsplus_read_super()
421 mark_inode_dirty(HFSPLUS_SB(sb).hidden_dir); in hfsplus_read_super()