~ubuntu-branches/ubuntu/precise/util-linux/precise-proposed

« back to all changes in this revision

Viewing changes to shlibs/blkid/src/superblocks/highpoint_raid.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-06-20 22:31:50 UTC
  • mfrom: (1.6.3 upstream) (4.5.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110620223150-lz8wrv0946ihcz3z
Tags: 2.19.1-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build for multiarch.
  - Add pre-depends on multiarch-support.
  - configure.ac: don't try to be clever about extracting a path name from
    $libdir to append to /usr in a way that's not overridable; instead,
    reuse the built-in configurable libexecdir.
  - Fix up the .pc.in files to know about libexecdir, so our substitutions
    don't leave us with unusable pkg-config files.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.
  - Since upstart is required in Ubuntu, the hwclock.sh init script is not
    called on startup and the hwclockfirst.sh init script is removed.
  - Drop depends on initscripts for the above.
  - Replace hwclock udev rule with an Upstart job.
  - For the case where mount is called with a directory to mount, look
    that directory up in mountall's /lib/init/fstab if we couldn't find
    it mentioned anywhere else.  This means "mount /proc", "mount /sys",
    etc. work.
  - mount.8 points to the cifs-utils package, not the obsolete smbfs one. 
* Dropped changes:
  - mount.preinst: lsb_release has been fixed in lucid and above to be
    usable without configuration, so we don't have to diverge from Debian
    here anymore.
* Changes merged upstream:
  - sfdisk support for '+' with '-N'
  - mount/umount.c: fix a segfault on umount with empty mtab entry
  - Fix arbitrary unmount with fuse security issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
        if (pr->size < 0x10000)
32
32
                return -1;
 
33
        if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
 
34
                return -1;
33
35
 
34
36
        off = ((pr->size / 0x200) - 11) * 0x200;
35
37
        hpt = (struct hpt45x_metadata *)
41
43
        magic = le32_to_cpu(hpt->magic);
42
44
        if (magic != HPT45X_MAGIC_OK && magic != HPT45X_MAGIC_BAD)
43
45
                return -1;
44
 
        return 0;
45
 
}
 
46
        if (blkid_probe_set_magic(pr, off, sizeof(hpt->magic),
 
47
                                (unsigned char *) &hpt->magic))
 
48
                return -1;
 
49
        return 0;
 
50
}
 
51
 
 
52
static int probe_highpoint37x(blkid_probe pr, const struct blkid_idmag *mag)
 
53
{
 
54
        if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
 
55
                return -1;
 
56
        return 0;
 
57
}
 
58
 
46
59
 
47
60
const struct blkid_idinfo highpoint45x_idinfo = {
48
61
        .name           = "hpt45x_raid_member",
54
67
const struct blkid_idinfo highpoint37x_idinfo = {
55
68
        .name           = "hpt37x_raid_member",
56
69
        .usage          = BLKID_USAGE_RAID,
 
70
        .probefunc      = probe_highpoint37x,
57
71
        .magics         = {
58
72
                /*
59
73
                 * Superblok offset:                      4608 bytes  (9 sectors)