extern blkid_loff_t blkid_partition_get_size(blkid_partition par);
extern int blkid_partition_get_type(blkid_partition par);
extern const char *blkid_partition_get_type_string(blkid_partition par);
+extern unsigned long long blkid_partition_get_flags(blkid_partition par);
extern int blkid_partition_is_logical(blkid_partition par);
extern int blkid_partition_is_extended(blkid_partition par);
extern int blkid_partition_is_primary(blkid_partition par);
global:
blkid_probe_all_removable;
blkid_partlist_devno_to_partition;
+ blkid_partition_get_flags;
} BLKID_2.17;
goto err;
blkid_partition_set_type(par, p->sys_type);
+ blkid_partition_set_flags(par, p->boot_ind);
ct_nodata = 0;
}
/* The first nested ext.partition should be a link to the next
goto err;
blkid_partition_set_type(par, p->sys_type);
+ blkid_partition_set_flags(par, p->boot_ind);
}
/* Linux uses partition numbers greater than 4
blkid_partition_set_type_uuid(par,
(const unsigned char *) &e->partition_type_guid);
+
+ blkid_partition_set_flags(par, e->attributes);
}
return 0;
goto err;
blkid_partition_set_type(par, p->sys_type);
+ blkid_partition_set_flags(par, p->boot_ind);
}
return 0;
*
* @PART_ENTRY_TYPE: partition type, 0xNN (e.g 0x82) or type UUID (gpt only)
*
+ * @PART_ENTRY_FLAGS: partition flags (e.g. boot_ind) or attributes (e.g. gpt attributes)
+ *
* Example:
*
* <informalexample>
int type; /* partition type */
char typestr[37]; /* partition type string (GPT and Mac) */
+ unsigned long long flags; /* partition flags / attributes */
+
int partno; /* partition number */
char uuid[37]; /* UUID (when supported by PT), e.g GPT */
unsigned char name[128]; /* Partition in UTF8 name (when supporte by PT), e.g. Mac */
(unsigned char *) v, strlen(v) + 1);
else
blkid_probe_sprintf_value(pr, "PART_ENTRY_TYPE",
- "0x%02x", blkid_partition_get_type(par));
+ "0x%x", blkid_partition_get_type(par));
+
+ if (blkid_partition_get_flags(par))
+ blkid_probe_sprintf_value(pr, "PART_ENTRY_FLAGS",
+ "0x%llx", blkid_partition_get_flags(par));
}
rc = 0;
nothing:
return par && *par->typestr ? par->typestr : NULL;
}
+
+int blkid_partition_set_flags(blkid_partition par, unsigned long long flags)
+{
+ if (!par)
+ return -1;
+ par->flags = flags;
+ return 0;
+}
+
+/**
+ * blkid_partition_get_flags
+ * @par: partition
+ *
+ * Returns: partition flags (or attributes for gpt).
+ */
+unsigned long long blkid_partition_get_flags(blkid_partition par)
+{
+ return par ? par->flags : 0;
+}
+
extern int blkid_partition_set_type_uuid(blkid_partition par,
const unsigned char *uuid);
+extern int blkid_partition_set_flags(blkid_partition par, unsigned long long flags);
+
/*
* partition probers
*/
goto err;
blkid_partition_set_type(par, le16_to_cpu(p->s_tag));
+ blkid_partition_set_flags(par, le16_to_cpu(p->s_flag));
}
return 0;
blkid_loff_t start;
blkid_loff_t size;
uint16_t type = infos ? be16_to_cpu(infos[i].id) : 0;
+ uint16_t flags = infos ? be16_to_cpu(infos[i].flags) : 0;
blkid_partition par;
start = be32_to_cpu(p->start_cylinder) * spc;
goto err;
blkid_partition_set_type(par, type);
+ blkid_partition_set_flags(par, flags);
}
return 0;
goto err;
blkid_partition_set_type(par, tag);
+ blkid_partition_set_flags(par, flg);
}
return 0;