13 #include <linux/cdrom.h>
15 #include <asm/unaligned.h>
27 static void hfsplus_end_io_sync(
struct bio *bio,
int err)
68 io_size = hfsplus_min_io_size(sb);
70 offset = start & (io_size - 1);
76 bio->bi_end_io = hfsplus_end_io_sync;
77 bio->bi_private = &
wait;
79 if (!(rw &
WRITE) && data)
80 *data = (
u8 *)buf + offset;
93 buf = (
u8 *)buf + len;
99 if (!bio_flagged(bio, BIO_UPTODATE))
104 return ret < 0 ? ret : 0;
148 *size = sb->
s_bdev->bd_inode->i_size >> 9;
150 if (HFSPLUS_SB(sb)->session >= 0) {
151 te.cdte_track = HFSPLUS_SB(sb)->session;
156 *start = (
sector_t)te.cdte_addr.lba << 2;
159 printk(
KERN_ERR "hfs: invalid session number or type of track\n");
185 if (hfsplus_get_last_session(sb, &part_start, &part_size))
201 goto out_free_backup_vhdr;
204 switch (sbi->
s_vhdr->signature) {
211 if (!hfsplus_read_mdb(sbi->
s_vhdr, &wd))
212 goto out_free_backup_vhdr;
225 goto out_free_backup_vhdr;
233 goto out_free_backup_vhdr;
238 "hfs: invalid secondary volume header\n");
239 goto out_free_backup_vhdr;
248 goto out_free_backup_vhdr;
251 while ((blocksize >>= 1) != 0)
264 goto out_free_backup_vhdr;
274 out_free_backup_vhdr: