~ubuntu-branches/ubuntu/wily/grub2/wily

« back to all changes in this revision

Viewing changes to grub-core/disk/mdraid1x_linux.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-01-11 17:11:44 UTC
  • mto: (17.3.26 experimental)
  • mto: This revision was merged to the branch mainline in revision 60.
  • Revision ID: james.westby@ubuntu.com-20110111171144-o2h6luxzei5fivmf
Tags: upstream-1.99~20110111
ImportĀ upstreamĀ versionĀ 1.99~20110111

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
                          &sb))
144
144
        return grub_errno;
145
145
 
146
 
      if (sb.magic != SB_MAGIC)
 
146
      if (grub_le_to_cpu32 (sb.magic) != SB_MAGIC)
147
147
        continue;
148
148
 
149
149
      {
150
150
        grub_uint64_t sb_size;
151
151
        struct grub_raid_super_1x *real_sb;
 
152
        grub_uint32_t level;
152
153
 
153
 
        if (sb.major_version != 1)
 
154
        if (grub_le_to_cpu32 (sb.major_version) != 1)
154
155
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
155
156
                             "Unsupported RAID version: %d",
156
 
                             sb.major_version);
 
157
                             grub_le_to_cpu32 (sb.major_version));
 
158
 
 
159
        level = grub_le_to_cpu32 (sb.level);
157
160
 
158
161
        /* Multipath.  */
159
 
        if ((int) sb.level == -4)
160
 
          sb.level = 1;
 
162
        if ((int) level == -4)
 
163
          level = 1;
161
164
 
162
 
        if (sb.level != 0 && sb.level != 1 && sb.level != 4 &&
163
 
            sb.level != 5 && sb.level != 6 && sb.level != 10)
 
165
        if (level != 0 && level != 1 && level != 4 &&
 
166
            level != 5 && level != 6 && level != 10)
164
167
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
165
168
                             "Unsupported RAID level: %d", sb.level);
166
169
 
209
212
 
210
213
        grub_memcpy (array->uuid, real_sb->set_uuid, 16);
211
214
        
212
 
        *start_sector = real_sb->data_offset;
 
215
        *start_sector = grub_le_to_cpu64 (real_sb->data_offset);
213
216
 
214
217
        grub_free (real_sb);
215
218
        return 0;