11 #include <linux/cdrom.h>
14 #include <linux/slab.h>
41 *size = sb->
s_bdev->bd_inode->i_size >> 9;
43 if (
HFS_SB(sb)->session >= 0) {
44 te.cdte_track =
HFS_SB(sb)->session;
48 *start = (
sector_t)te.cdte_addr.lba << 2;
69 struct buffer_head *bh;
83 if (hfs_get_last_session(sb, &part_start, &part_size))
110 while (size & (size - 1))
117 while (
HFS_SB(sb)->alloc_blksz & (size - 1))
135 HFS_SB(sb)->part_start = part_start;
140 if (!
HFS_SB(sb)->clumpablks)
141 HFS_SB(sb)->clumpablks = 1;
154 sect = part_start + part_size - 2;
158 HFS_SB(sb)->alt_mdb_bh = bh;
159 HFS_SB(sb)->alt_mdb = mdb2;
164 if (!
HFS_SB(sb)->alt_mdb) {
176 size = (
HFS_SB(sb)->fs_ablocks + 8) / 8;
186 memcpy(ptr, bh->b_data + off2, len);
194 if (!
HFS_SB(sb)->ext_tree) {
199 if (!
HFS_SB(sb)->cat_tree) {
207 "running fsck.hfs is recommended. mounting read-only.\n");
219 be32_add_cpu(&mdb->
drWrCnt, 1);
266 lock_buffer(
HFS_SB(sb)->mdb_bh);
291 lock_buffer(
HFS_SB(sb)->alt_mdb_bh);
302 struct buffer_head *bh;
310 size = (
HFS_SB(sb)->fs_ablocks + 7) / 8;
313 bh = sb_bread(sb, block);
321 memcpy(bh->b_data + off, ptr, len);
358 brelse(
HFS_SB(sb)->mdb_bh);
359 brelse(
HFS_SB(sb)->alt_mdb_bh);