Lines Matching refs:part
161 int part, offset; in dev_nvram_ioctl() local
165 if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) in dev_nvram_ioctl()
167 if (part < pmac_nvram_OF || part > pmac_nvram_NR) in dev_nvram_ioctl()
169 offset = pmac_get_partition(part); in dev_nvram_ioctl()
214 static int __init nvram_write_header(struct nvram_partition * part) in nvram_write_header() argument
219 tmp_index = part->index; in nvram_write_header()
220 rc = ppc_md.nvram_write((char *)&part->header, NVRAM_HEADER_LEN, &tmp_index); in nvram_write_header()
244 static int nvram_can_remove_partition(struct nvram_partition *part, in nvram_can_remove_partition() argument
247 if (part->header.signature != sig) in nvram_can_remove_partition()
250 if (strncmp(name, part->header.name, 12)) in nvram_can_remove_partition()
255 if (!strncmp(*except, part->header.name, 12)) in nvram_can_remove_partition()
274 struct nvram_partition *part, *prev, *tmp; in nvram_remove_partition() local
277 list_for_each_entry(part, &nvram_partitions, partition) { in nvram_remove_partition()
278 if (!nvram_can_remove_partition(part, name, sig, exceptions)) in nvram_remove_partition()
282 part->header.signature = NVRAM_SIG_FREE; in nvram_remove_partition()
283 strncpy(part->header.name, "wwwwwwwwwwww", 12); in nvram_remove_partition()
284 part->header.checksum = nvram_checksum(&part->header); in nvram_remove_partition()
285 rc = nvram_write_header(part); in nvram_remove_partition()
294 list_for_each_entry_safe(part, tmp, &nvram_partitions, partition) { in nvram_remove_partition()
295 if (part->header.signature != NVRAM_SIG_FREE) { in nvram_remove_partition()
300 prev->header.length += part->header.length; in nvram_remove_partition()
301 prev->header.checksum = nvram_checksum(&part->header); in nvram_remove_partition()
302 rc = nvram_write_header(part); in nvram_remove_partition()
307 list_del(&part->partition); in nvram_remove_partition()
308 kfree(part); in nvram_remove_partition()
310 prev = part; in nvram_remove_partition()
332 struct nvram_partition *part; in nvram_create_partition() local
358 list_for_each_entry(part, &nvram_partitions, partition) { in nvram_create_partition()
359 if (part->header.signature != NVRAM_SIG_FREE) in nvram_create_partition()
362 if (part->header.length >= req_size) { in nvram_create_partition()
364 free_part = part; in nvram_create_partition()
367 if (part->header.length > size && in nvram_create_partition()
368 part->header.length >= min_size) { in nvram_create_partition()
369 size = part->header.length; in nvram_create_partition()
370 free_part = part; in nvram_create_partition()
435 struct nvram_partition *part; in nvram_get_partition_size() local
437 list_for_each_entry(part, &nvram_partitions, partition) { in nvram_get_partition_size()
438 if (part->index + NVRAM_HEADER_LEN == data_index) in nvram_get_partition_size()
439 return (part->header.length - 1) * NVRAM_BLOCK_LEN; in nvram_get_partition_size()