Lines Matching defs:part

180 int nvram_write_os_partition(struct nvram_os_partition *part,
189 if (part->index == -1)
192 if (length > part->size)
193 length = part->size;
198 tmp_index = part->index;
219 int nvram_read_partition(struct nvram_os_partition *part, char *buff,
227 if (part->index == -1)
230 if (length > part->size)
231 length = part->size;
233 tmp_index = part->index;
235 if (part->os_partition) {
249 if (part->os_partition) {
274 int __init nvram_init_os_partition(struct nvram_os_partition *part)
280 p = nvram_find_partition(part->name, NVRAM_SIG_OS, &size);
283 if (p && size < part->min_size) {
285 " removing it...\n", part->name);
286 nvram_remove_partition(part->name, NVRAM_SIG_OS, NULL);
292 p = nvram_create_partition(part->name, NVRAM_SIG_OS,
293 part->req_size, part->min_size);
297 part->name);
300 p = nvram_create_partition(part->name, NVRAM_SIG_OS,
301 part->req_size, part->min_size);
307 " partition, err %d\n", part->name, (int)p);
311 part->index = p;
312 part->size = nvram_get_partition_size(p) - sizeof(struct err_log_info);
391 /* part 1 has the recent messages from printk buffer */
392 if (record->part > 1 || (record->type != PSTORE_TYPE_DMESG))
412 record->id = record->part;
425 struct nvram_os_partition *part = NULL;
434 part = &oops_log_partition;
439 part = &common_partition;
447 part = &rtas_log_partition;
454 part = &of_config_partition;
464 part = &skiboot_partition;
475 if (!part->os_partition) {
476 p = nvram_find_partition(part->name, sig, &size);
479 "err %d\n", part->name, (int)p);
482 part->index = p;
483 part->size = size;
486 buff = kmalloc(part->size, GFP_KERNEL);
491 if (nvram_read_partition(part, buff, part->size, &err_type, &id_no)) {
498 if (part->os_partition)
531 return part->size;
724 static int __init nvram_write_header(struct nvram_partition * part)
730 memcpy(&phead, &part->header, NVRAM_HEADER_LEN);
733 tmp_index = part->index;
758 static int __init nvram_can_remove_partition(struct nvram_partition *part,
761 if (part->header.signature != sig)
764 if (strncmp(name, part->header.name, 12))
769 if (!strncmp(*except, part->header.name, 12))
788 struct nvram_partition *part, *prev, *tmp;
791 list_for_each_entry(part, &nvram_partitions, partition) {
792 if (!nvram_can_remove_partition(part, name, sig, exceptions))
796 part->header.signature = NVRAM_SIG_FREE;
797 memset(part->header.name, 'w', 12);
798 part->header.checksum = nvram_checksum(&part->header);
799 rc = nvram_write_header(part);
808 list_for_each_entry_safe(part, tmp, &nvram_partitions, partition) {
809 if (part->header.signature != NVRAM_SIG_FREE) {
814 prev->header.length += part->header.length;
821 list_del(&part->partition);
822 kfree(part);
824 prev = part;
846 struct nvram_partition *part;
874 list_for_each_entry(part, &nvram_partitions, partition) {
875 if (part->header.signature != NVRAM_SIG_FREE)
878 if (part->header.length >= req_size) {
880 free_part = part;
883 if (part->header.length > size &&
884 part->header.length >= min_size) {
885 size = part->header.length;
886 free_part = part;
952 struct nvram_partition *part;
954 list_for_each_entry(part, &nvram_partitions, partition) {
955 if (part->index + NVRAM_HEADER_LEN == data_index)
956 return (part->header.length - 1) * NVRAM_BLOCK_LEN;
966 * @out_size: if non-NULL, returns the size of the data part of the partition