~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to fs/partitions/atari.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
                memcmp (s, "RAW", 3) == 0 ;
31
31
}
32
32
 
33
 
int atari_partition(struct parsed_partitions *state, struct block_device *bdev)
 
33
int atari_partition(struct parsed_partitions *state)
34
34
{
35
35
        Sector sect;
36
36
        struct rootsector *rs;
42
42
        int part_fmt = 0; /* 0:unknown, 1:AHDI, 2:ICD/Supra */
43
43
#endif
44
44
 
45
 
        rs = (struct rootsector *) read_dev_sector(bdev, 0, &sect);
 
45
        rs = read_part_sector(state, 0, &sect);
46
46
        if (!rs)
47
47
                return -1;
48
48
 
49
49
        /* Verify this is an Atari rootsector: */
50
 
        hd_size = bdev->bd_inode->i_size >> 9;
 
50
        hd_size = state->bdev->bd_inode->i_size >> 9;
51
51
        if (!VALID_PARTITION(&rs->part[0], hd_size) &&
52
52
            !VALID_PARTITION(&rs->part[1], hd_size) &&
53
53
            !VALID_PARTITION(&rs->part[2], hd_size) &&
62
62
        }
63
63
 
64
64
        pi = &rs->part[0];
65
 
        printk (" AHDI");
 
65
        strlcat(state->pp_buf, " AHDI", PAGE_SIZE);
66
66
        for (slot = 1; pi < &rs->part[4] && slot < state->limit; slot++, pi++) {
67
67
                struct rootsector *xrs;
68
68
                Sector sect2;
81
81
#ifdef ICD_PARTS
82
82
                part_fmt = 1;
83
83
#endif
84
 
                printk(" XGM<");
 
84
                strlcat(state->pp_buf, " XGM<", PAGE_SIZE);
85
85
                partsect = extensect = be32_to_cpu(pi->st);
86
86
                while (1) {
87
 
                        xrs = (struct rootsector *)read_dev_sector(bdev, partsect, &sect2);
 
87
                        xrs = read_part_sector(state, partsect, &sect2);
88
88
                        if (!xrs) {
89
89
                                printk (" block %ld read failed\n", partsect);
90
90
                                put_dev_sector(sect);
120
120
                                break;
121
121
                        }
122
122
                }
123
 
                printk(" >");
 
123
                strlcat(state->pp_buf, " >", PAGE_SIZE);
124
124
        }
125
125
#ifdef ICD_PARTS
126
126
        if ( part_fmt!=1 ) { /* no extended partitions -> test ICD-format */
127
127
                pi = &rs->icdpart[0];
128
128
                /* sanity check: no ICD format if first partition invalid */
129
129
                if (OK_id(pi->id)) {
130
 
                        printk(" ICD<");
 
130
                        strlcat(state->pp_buf, " ICD<", PAGE_SIZE);
131
131
                        for (; pi < &rs->icdpart[8] && slot < state->limit; slot++, pi++) {
132
132
                                /* accept only GEM,BGM,RAW,LNX,SWP partitions */
133
133
                                if (!((pi->flg & 1) && OK_id(pi->id)))
137
137
                                                be32_to_cpu(pi->st),
138
138
                                                be32_to_cpu(pi->siz));
139
139
                        }
140
 
                        printk(" >");
 
140
                        strlcat(state->pp_buf, " >", PAGE_SIZE);
141
141
                }
142
142
        }
143
143
#endif
144
144
        put_dev_sector(sect);
145
145
 
146
 
        printk ("\n");
 
146
        strlcat(state->pp_buf, "\n", PAGE_SIZE);
147
147
 
148
148
        return 1;
149
149
}