blob: 4efdfa33d0702f8e362ed01329f1795b2b01a91a [file] [log] [blame]
bigbiff bigbiffe60683a2013-02-22 20:55:50 -05001/*
2 * aix partitions
3 *
4 * Copyright (C) 2009 Karel Zak <kzak@redhat.com>
5 *
6 * This file may be redistributed under the terms of the
7 * GNU Lesser General Public License.
8 */
9#include <stdio.h>
10#include <string.h>
11#include <stdlib.h>
12#include <stdint.h>
13
14#include "partitions.h"
15#include "aix.h"
16
17static int probe_aix_pt(blkid_probe pr,
18 const struct blkid_idmag *mag __attribute__((__unused__)))
19{
20 blkid_partlist ls;
21 blkid_parttable tab;
22
23 if (blkid_partitions_need_typeonly(pr))
24 /* caller does not ask for details about partitions */
bigbiff7b4c7a62015-01-01 19:44:14 -050025 return BLKID_PROBE_OK;
bigbiff bigbiffe60683a2013-02-22 20:55:50 -050026
27 ls = blkid_probe_get_partlist(pr);
28 if (!ls)
bigbiff7b4c7a62015-01-01 19:44:14 -050029 return BLKID_PROBE_NONE;
bigbiff bigbiffe60683a2013-02-22 20:55:50 -050030
31 tab = blkid_partlist_new_parttable(ls, "aix", 0);
32 if (!tab)
bigbiff7b4c7a62015-01-01 19:44:14 -050033 return -ENOMEM;
bigbiff bigbiffe60683a2013-02-22 20:55:50 -050034
bigbiff7b4c7a62015-01-01 19:44:14 -050035 return BLKID_PROBE_OK;
bigbiff bigbiffe60683a2013-02-22 20:55:50 -050036}
37
38/*
39 * We know nothing about AIX on-disk structures. Everything what we know is the
40 * magic number at begin of the disk.
41 *
42 * Note, Linux kernel is tring to be smart and AIX signature is ignored when
bigbiff7b4c7a62015-01-01 19:44:14 -050043 * there is a valid DOS partitions table. We don't support such behavior. All
bigbiff bigbiffe60683a2013-02-22 20:55:50 -050044 * fdisk-like programs has to properly wipe the fist sector. Everything other
45 * is a bug.
46 */
47const struct blkid_idinfo aix_pt_idinfo =
48{
49 .name = "aix",
50 .probefunc = probe_aix_pt,
51 .magics =
52 {
53 { .magic = BLKID_AIX_MAGIC_STRING, .len = BLKID_AIX_MAGIC_STRLEN },
54 { NULL }
55 }
56};
57