Lines Matching defs:cp

254 	struct yaffs_checkpt_validity cp;
256 memset(&cp, 0, sizeof(cp));
258 cp.struct_type = sizeof(cp);
259 cp.magic = YAFFS_MAGIC;
260 cp.version = YAFFS_CHECKPOINT_VERSION;
261 cp.head = (head) ? 1 : 0;
263 return (yaffs2_checkpt_wr(dev, &cp, sizeof(cp)) == sizeof(cp)) ? 1 : 0;
268 struct yaffs_checkpt_validity cp;
271 ok = (yaffs2_checkpt_rd(dev, &cp, sizeof(cp)) == sizeof(cp));
274 ok = (cp.struct_type == sizeof(cp)) &&
275 (cp.magic == YAFFS_MAGIC) &&
276 (cp.version == YAFFS_CHECKPOINT_VERSION) &&
277 (cp.head == ((head) ? 1 : 0));
281 static void yaffs2_dev_to_checkpt_dev(struct yaffs_checkpt_dev *cp,
284 cp->n_erased_blocks = dev->n_erased_blocks;
285 cp->alloc_block = dev->alloc_block;
286 cp->alloc_page = dev->alloc_page;
287 cp->n_free_chunks = dev->n_free_chunks;
289 cp->n_deleted_files = dev->n_deleted_files;
290 cp->n_unlinked_files = dev->n_unlinked_files;
291 cp->n_bg_deletions = dev->n_bg_deletions;
292 cp->seq_number = dev->seq_number;
297 struct yaffs_checkpt_dev *cp)
299 dev->n_erased_blocks = cp->n_erased_blocks;
300 dev->alloc_block = cp->alloc_block;
301 dev->alloc_page = cp->alloc_page;
302 dev->n_free_chunks = cp->n_free_chunks;
304 dev->n_deleted_files = cp->n_deleted_files;
305 dev->n_unlinked_files = cp->n_unlinked_files;
306 dev->n_bg_deletions = cp->n_bg_deletions;
307 dev->seq_number = cp->seq_number;
312 struct yaffs_checkpt_dev cp;
318 yaffs2_dev_to_checkpt_dev(&cp, dev);
319 cp.struct_type = sizeof(cp);
321 ok = (yaffs2_checkpt_wr(dev, &cp, sizeof(cp)) == sizeof(cp));
340 struct yaffs_checkpt_dev cp;
346 ok = (yaffs2_checkpt_rd(dev, &cp, sizeof(cp)) == sizeof(cp));
350 if (cp.struct_type != sizeof(cp))
353 yaffs_checkpt_dev_to_dev(dev, &cp);
369 static void yaffs2_obj_checkpt_obj(struct yaffs_checkpt_obj *cp,
372 cp->obj_id = obj->obj_id;
373 cp->parent_id = (obj->parent) ? obj->parent->obj_id : 0;
374 cp->hdr_chunk = obj->hdr_chunk;
375 cp->variant_type = obj->variant_type;
376 cp->deleted = obj->deleted;
377 cp->soft_del = obj->soft_del;
378 cp->unlinked = obj->unlinked;
379 cp->fake = obj->fake;
380 cp->rename_allowed = obj->rename_allowed;
381 cp->unlink_allowed = obj->unlink_allowed;
382 cp->serial = obj->serial;
383 cp->n_data_chunks = obj->n_data_chunks;
386 cp->size_or_equiv_obj = obj->variant.file_variant.file_size;
388 cp->size_or_equiv_obj = obj->variant.hardlink_variant.equiv_id;
392 struct yaffs_checkpt_obj *cp)
396 if (obj->variant_type != cp->variant_type) {
399 cp->obj_id, cp->variant_type, cp->hdr_chunk,
404 obj->obj_id = cp->obj_id;
406 if (cp->parent_id)
408 cp->parent_id,
417 cp->obj_id, cp->parent_id,
418 cp->variant_type, cp->hdr_chunk,
425 obj->hdr_chunk = cp->hdr_chunk;
426 obj->variant_type = cp->variant_type;
427 obj->deleted = cp->deleted;
428 obj->soft_del = cp->soft_del;
429 obj->unlinked = cp->unlinked;
430 obj->fake = cp->fake;
431 obj->rename_allowed = cp->rename_allowed;
432 obj->unlink_allowed = cp->unlink_allowed;
433 obj->serial = cp->serial;
434 obj->n_data_chunks = cp->n_data_chunks;
437 obj->variant.file_variant.file_size = cp->size_or_equiv_obj;
439 obj->variant.hardlink_variant.equiv_id = cp->size_or_equiv_obj;
545 struct yaffs_checkpt_obj cp;
558 yaffs2_obj_checkpt_obj(&cp, obj);
559 cp.struct_type = sizeof(cp);
563 cp.obj_id, cp.parent_id,
564 cp.variant_type, cp.hdr_chunk, obj);
566 ok = (yaffs2_checkpt_wr(dev, &cp,
567 sizeof(cp)) == sizeof(cp));
578 memset(&cp, 0xff, sizeof(struct yaffs_checkpt_obj));
579 cp.struct_type = sizeof(cp);
582 ok = (yaffs2_checkpt_wr(dev, &cp, sizeof(cp)) == sizeof(cp));
590 struct yaffs_checkpt_obj cp;
597 ok = (yaffs2_checkpt_rd(dev, &cp, sizeof(cp)) == sizeof(cp));
598 if (cp.struct_type != sizeof(cp)) {
601 cp.struct_type, (int)sizeof(cp), ok);
607 cp.obj_id, cp.parent_id, cp.variant_type,
608 cp.hdr_chunk);
610 if (ok && cp.obj_id == ~0) {
614 yaffs_find_or_create_by_number(dev, cp.obj_id,
615 cp.variant_type);
617 ok = yaffs2_checkpt_obj_to_obj(obj, &cp);