Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / lib / format_text / import_vsn1.c
blob53f403b55f47835ac66edc5de4a08599b9175fdd
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #include "lib.h"
19 #include "metadata.h"
20 #include "import-export.h"
21 #include "display.h"
22 #include "toolcontext.h"
23 #include "lvmcache.h"
24 #include "lv_alloc.h"
25 #include "pv_alloc.h"
26 #include "segtype.h"
27 #include "text_import.h"
29 typedef int (*section_fn) (struct format_instance * fid, struct dm_pool * mem,
30 struct volume_group * vg, struct config_node * pvn,
31 struct config_node * vgn,
32 struct dm_hash_table * pv_hash);
34 #define _read_int32(root, path, result) \
35 get_config_uint32(root, path, (uint32_t *) result)
37 #define _read_uint32(root, path, result) \
38 get_config_uint32(root, path, result)
40 #define _read_int64(root, path, result) \
41 get_config_uint64(root, path, result)
44 * Logs an attempt to read an invalid format file.
46 static void _invalid_format(const char *str)
48 log_error("Can't process text format file - %s.", str);
52 * Checks that the config file contains vg metadata, and that it
53 * we recognise the version number,
55 static int _check_version(struct config_tree *cft)
57 struct config_node *cn;
58 struct config_value *cv;
61 * Check the contents field.
63 if (!(cn = find_config_node(cft->root, CONTENTS_FIELD))) {
64 _invalid_format("missing contents field");
65 return 0;
68 cv = cn->v;
69 if (!cv || cv->type != CFG_STRING || strcmp(cv->v.str, CONTENTS_VALUE)) {
70 _invalid_format("unrecognised contents field");
71 return 0;
75 * Check the version number.
77 if (!(cn = find_config_node(cft->root, FORMAT_VERSION_FIELD))) {
78 _invalid_format("missing version number");
79 return 0;
82 cv = cn->v;
83 if (!cv || cv->type != CFG_INT || cv->v.i != FORMAT_VERSION_VALUE) {
84 _invalid_format("unrecognised version number");
85 return 0;
88 return 1;
91 static int _is_converting(struct logical_volume *lv)
93 struct lv_segment *seg;
95 if (lv->status & MIRRORED) {
96 seg = first_seg(lv);
97 /* Can't use is_temporary_mirror() because the metadata for
98 * seg_lv may not be read in and flags may not be set yet. */
99 if (seg_type(seg, 0) == AREA_LV &&
100 strstr(seg_lv(seg, 0)->name, MIRROR_SYNC_LAYER))
101 return 1;
104 return 0;
107 static int _read_id(struct id *id, struct config_node *cn, const char *path)
109 struct config_value *cv;
111 if (!(cn = find_config_node(cn, path))) {
112 log_error("Couldn't find uuid.");
113 return 0;
116 cv = cn->v;
117 if (!cv || !cv->v.str) {
118 log_error("uuid must be a string.");
119 return 0;
122 if (!id_read_format(id, cv->v.str)) {
123 log_error("Invalid uuid.");
124 return 0;
127 return 1;
130 static int _read_flag_config(struct config_node *n, uint32_t *status, int type)
132 struct config_node *cn;
133 *status = 0;
135 if (!(cn = find_config_node(n, "status"))) {
136 log_error("Could not find status flags.");
137 return 0;
140 if (!(read_flags(status, type | STATUS_FLAG, cn->v))) {
141 log_error("Could not read status flags.");
142 return 0;
145 if ((cn = find_config_node(n, "flags"))) {
146 if (!(read_flags(status, type, cn->v))) {
147 log_error("Could not read flags.");
148 return 0;
152 return 1;
155 static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
156 struct volume_group *vg, struct config_node *pvn,
157 struct config_node *vgn __attribute((unused)),
158 struct dm_hash_table *pv_hash)
160 struct physical_volume *pv;
161 struct pv_list *pvl;
162 struct config_node *cn;
163 uint64_t size;
165 if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) ||
166 !(pvl->pv = dm_pool_zalloc(mem, sizeof(*pvl->pv))))
167 return_0;
169 pv = pvl->pv;
172 * Add the pv to the pv hash for quick lookup when we read
173 * the lv segments.
175 if (!dm_hash_insert(pv_hash, pvn->key, pv))
176 return_0;
178 if (!(pvn = pvn->child)) {
179 log_error("Empty pv section.");
180 return 0;
183 if (!_read_id(&pv->id, pvn, "id")) {
184 log_error("Couldn't read uuid for physical volume.");
185 return 0;
189 * Convert the uuid into a device.
191 if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id))) {
192 char buffer[64] __attribute((aligned(8)));
194 if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
195 log_error("Couldn't find device.");
196 else
197 log_error("Couldn't find device with uuid '%s'.",
198 buffer);
201 if (!(pv->vg_name = dm_pool_strdup(mem, vg->name)))
202 return_0;
204 memcpy(&pv->vgid, &vg->id, sizeof(vg->id));
206 if (!_read_flag_config(pvn, &pv->status, PV_FLAGS)) {
207 log_error("Couldn't read status flags for physical volume.");
208 return 0;
211 if (!pv->dev)
212 pv->status |= MISSING_PV;
214 /* Late addition */
215 _read_int64(pvn, "dev_size", &pv->size);
217 if (!_read_int64(pvn, "pe_start", &pv->pe_start)) {
218 log_error("Couldn't read extent size for physical volume.");
219 return 0;
222 if (!_read_int32(pvn, "pe_count", &pv->pe_count)) {
223 log_error("Couldn't find extent count (pe_count) for "
224 "physical volume.");
225 return 0;
228 dm_list_init(&pv->tags);
229 dm_list_init(&pv->segments);
231 /* Optional tags */
232 if ((cn = find_config_node(pvn, "tags")) &&
233 !(read_tags(mem, &pv->tags, cn->v))) {
234 log_error("Couldn't read tags for physical volume %s in %s.",
235 pv_dev_name(pv), vg->name);
236 return 0;
239 /* adjust the volume group. */
240 vg->extent_count += pv->pe_count;
241 vg->free_count += pv->pe_count;
243 pv->pe_size = vg->extent_size;
245 pv->pe_alloc_count = 0;
246 pv->pe_align = 0;
247 pv->fmt = fid->fmt;
249 /* Fix up pv size if missing or impossibly large */
250 if ((!pv->size || pv->size > (1ULL << 62)) && pv->dev) {
251 if (!dev_get_size(pv->dev, &pv->size)) {
252 log_error("%s: Couldn't get size.", pv_dev_name(pv));
253 return 0;
255 log_verbose("Fixing up missing size (%s) "
256 "for PV %s", display_size(fid->fmt->cmd, pv->size),
257 pv_dev_name(pv));
258 if (vg) {
259 size = pv->pe_count * (uint64_t) vg->extent_size +
260 pv->pe_start;
261 if (size > pv->size)
262 log_error("WARNING: Physical Volume %s is too "
263 "large for underlying device",
264 pv_dev_name(pv));
268 if (!alloc_pv_segment_whole_pv(mem, pv))
269 return_0;
271 vg->pv_count++;
272 dm_list_add(&vg->pvs, &pvl->list);
274 return 1;
277 static void _insert_segment(struct logical_volume *lv, struct lv_segment *seg)
279 struct lv_segment *comp;
281 dm_list_iterate_items(comp, &lv->segments) {
282 if (comp->le > seg->le) {
283 dm_list_add(&comp->list, &seg->list);
284 return;
288 lv->le_count += seg->len;
289 dm_list_add(&lv->segments, &seg->list);
292 static int _read_segment(struct dm_pool *mem, struct volume_group *vg,
293 struct logical_volume *lv, struct config_node *sn,
294 struct dm_hash_table *pv_hash)
296 uint32_t area_count = 0u;
297 struct lv_segment *seg;
298 struct config_node *cn, *sn_child = sn->child;
299 struct config_value *cv;
300 uint32_t start_extent, extent_count;
301 struct segment_type *segtype;
302 const char *segtype_str;
304 if (!sn_child) {
305 log_error("Empty segment section.");
306 return 0;
309 if (!_read_int32(sn_child, "start_extent", &start_extent)) {
310 log_error("Couldn't read 'start_extent' for segment '%s' "
311 "of logical volume %s.", sn->key, lv->name);
312 return 0;
315 if (!_read_int32(sn_child, "extent_count", &extent_count)) {
316 log_error("Couldn't read 'extent_count' for segment '%s' "
317 "of logical volume %s.", sn->key, lv->name);
318 return 0;
321 segtype_str = "striped";
323 if ((cn = find_config_node(sn_child, "type"))) {
324 cv = cn->v;
325 if (!cv || !cv->v.str) {
326 log_error("Segment type must be a string.");
327 return 0;
329 segtype_str = cv->v.str;
332 if (!(segtype = get_segtype_from_string(vg->cmd, segtype_str)))
333 return_0;
335 if (segtype->ops->text_import_area_count &&
336 !segtype->ops->text_import_area_count(sn_child, &area_count))
337 return_0;
339 if (!(seg = alloc_lv_segment(mem, segtype, lv, start_extent,
340 extent_count, 0, 0, NULL, area_count,
341 extent_count, 0, 0, 0))) {
342 log_error("Segment allocation failed");
343 return 0;
346 if (seg->segtype->ops->text_import &&
347 !seg->segtype->ops->text_import(seg, sn_child, pv_hash))
348 return_0;
350 /* Optional tags */
351 if ((cn = find_config_node(sn_child, "tags")) &&
352 !(read_tags(mem, &seg->tags, cn->v))) {
353 log_error("Couldn't read tags for a segment of %s/%s.",
354 vg->name, lv->name);
355 return 0;
359 * Insert into correct part of segment list.
361 _insert_segment(lv, seg);
363 if (seg_is_mirrored(seg))
364 lv->status |= MIRRORED;
366 if (seg_is_virtual(seg))
367 lv->status |= VIRTUAL;
369 if (_is_converting(lv))
370 lv->status |= CONVERTING;
372 return 1;
375 int text_import_areas(struct lv_segment *seg, const struct config_node *sn,
376 const struct config_node *cn, struct dm_hash_table *pv_hash,
377 uint32_t flags)
379 unsigned int s;
380 struct config_value *cv;
381 struct logical_volume *lv1;
382 struct physical_volume *pv;
383 const char *seg_name = config_parent_name(sn);
385 if (!seg->area_count) {
386 log_error("Zero areas not allowed for segment %s", seg_name);
387 return 0;
390 for (cv = cn->v, s = 0; cv && s < seg->area_count; s++, cv = cv->next) {
392 /* first we read the pv */
393 if (cv->type != CFG_STRING) {
394 log_error("Bad volume name in areas array for segment %s.", seg_name);
395 return 0;
398 if (!cv->next) {
399 log_error("Missing offset in areas array for segment %s.", seg_name);
400 return 0;
403 if (cv->next->type != CFG_INT) {
404 log_error("Bad offset in areas array for segment %s.", seg_name);
405 return 0;
408 /* FIXME Cope if LV not yet read in */
409 if ((pv = dm_hash_lookup(pv_hash, cv->v.str))) {
410 if (!set_lv_segment_area_pv(seg, s, pv, (uint32_t) cv->next->v.i))
411 return_0;
412 } else if ((lv1 = find_lv(seg->lv->vg, cv->v.str))) {
413 if (!set_lv_segment_area_lv(seg, s, lv1,
414 (uint32_t) cv->next->v.i,
415 flags))
416 return_0;
417 } else {
418 log_error("Couldn't find volume '%s' "
419 "for segment '%s'.",
420 cv->v.str ? : "NULL", seg_name);
421 return 0;
424 cv = cv->next;
428 * Check we read the correct number of stripes.
430 if (cv || (s < seg->area_count)) {
431 log_error("Incorrect number of areas in area array "
432 "for segment '%s'.", seg_name);
433 return 0;
436 return 1;
439 static int _read_segments(struct dm_pool *mem, struct volume_group *vg,
440 struct logical_volume *lv, struct config_node *lvn,
441 struct dm_hash_table *pv_hash)
443 struct config_node *sn;
444 int count = 0, seg_count;
446 for (sn = lvn; sn; sn = sn->sib) {
449 * All sub-sections are assumed to be segments.
451 if (!sn->v) {
452 if (!_read_segment(mem, vg, lv, sn, pv_hash))
453 return_0;
455 count++;
457 /* FIXME Remove this restriction */
458 if ((lv->status & SNAPSHOT) && count > 1) {
459 log_error("Only one segment permitted for snapshot");
460 return 0;
464 if (!_read_int32(lvn, "segment_count", &seg_count)) {
465 log_error("Couldn't read segment count for logical volume %s.",
466 lv->name);
467 return 0;
470 if (seg_count != count) {
471 log_error("segment_count and actual number of segments "
472 "disagree for logical volume %s.", lv->name);
473 return 0;
477 * Check there are no gaps or overlaps in the lv.
479 if (!check_lv_segments(lv, 0))
480 return_0;
483 * Merge segments in case someones been editing things by hand.
485 if (!lv_merge_segments(lv))
486 return_0;
488 return 1;
491 static int _read_lvnames(struct format_instance *fid __attribute((unused)),
492 struct dm_pool *mem,
493 struct volume_group *vg, struct config_node *lvn,
494 struct config_node *vgn __attribute((unused)),
495 struct dm_hash_table *pv_hash __attribute((unused)))
497 struct logical_volume *lv;
498 struct config_node *cn;
500 if (!(lv = alloc_lv(mem)))
501 return_0;
503 if (!(lv->name = dm_pool_strdup(mem, lvn->key)))
504 return_0;
506 if (!(lvn = lvn->child)) {
507 log_error("Empty logical volume section.");
508 return 0;
511 if (!_read_flag_config(lvn, &lv->status, LV_FLAGS)) {
512 log_error("Couldn't read status flags for logical volume %s.",
513 lv->name);
514 return 0;
517 lv->alloc = ALLOC_INHERIT;
518 if ((cn = find_config_node(lvn, "allocation_policy"))) {
519 struct config_value *cv = cn->v;
520 if (!cv || !cv->v.str) {
521 log_error("allocation_policy must be a string.");
522 return 0;
525 lv->alloc = get_alloc_from_string(cv->v.str);
526 if (lv->alloc == ALLOC_INVALID)
527 return_0;
530 if (!_read_int32(lvn, "read_ahead", &lv->read_ahead))
531 /* If not present, choice of auto or none is configurable */
532 lv->read_ahead = vg->cmd->default_settings.read_ahead;
533 else {
534 switch (lv->read_ahead) {
535 case 0:
536 lv->read_ahead = DM_READ_AHEAD_AUTO;
537 break;
538 case (uint32_t) -1:
539 lv->read_ahead = DM_READ_AHEAD_NONE;
540 break;
541 default:
546 /* Optional tags */
547 if ((cn = find_config_node(lvn, "tags")) &&
548 !(read_tags(mem, &lv->tags, cn->v))) {
549 log_error("Couldn't read tags for logical volume %s/%s.",
550 vg->name, lv->name);
551 return 0;
554 return link_lv_to_vg(vg, lv);
557 static int _read_lvsegs(struct format_instance *fid __attribute((unused)),
558 struct dm_pool *mem,
559 struct volume_group *vg, struct config_node *lvn,
560 struct config_node *vgn __attribute((unused)),
561 struct dm_hash_table *pv_hash)
563 struct logical_volume *lv;
564 struct lv_list *lvl;
566 if (!(lvl = find_lv_in_vg(vg, lvn->key))) {
567 log_error("Lost logical volume reference %s", lvn->key);
568 return 0;
571 lv = lvl->lv;
573 if (!(lvn = lvn->child)) {
574 log_error("Empty logical volume section.");
575 return 0;
578 /* FIXME: read full lvid */
579 if (!_read_id(&lv->lvid.id[1], lvn, "id")) {
580 log_error("Couldn't read uuid for logical volume %s.",
581 lv->name);
582 return 0;
585 memcpy(&lv->lvid.id[0], &lv->vg->id, sizeof(lv->lvid.id[0]));
587 if (!_read_segments(mem, vg, lv, lvn, pv_hash))
588 return_0;
590 lv->size = (uint64_t) lv->le_count * (uint64_t) vg->extent_size;
592 lv->minor = -1;
593 if ((lv->status & FIXED_MINOR) &&
594 !_read_int32(lvn, "minor", &lv->minor)) {
595 log_error("Couldn't read minor number for logical "
596 "volume %s.", lv->name);
597 return 0;
600 lv->major = -1;
601 if ((lv->status & FIXED_MINOR) &&
602 !_read_int32(lvn, "major", &lv->major)) {
603 log_error("Couldn't read major number for logical "
604 "volume %s.", lv->name);
607 return 1;
610 static int _read_sections(struct format_instance *fid,
611 const char *section, section_fn fn,
612 struct dm_pool *mem,
613 struct volume_group *vg, struct config_node *vgn,
614 struct dm_hash_table *pv_hash, int optional)
616 struct config_node *n;
618 if (!(n = find_config_node(vgn, section))) {
619 if (!optional) {
620 log_error("Couldn't find section '%s'.", section);
621 return 0;
624 return 1;
627 for (n = n->child; n; n = n->sib) {
628 if (!fn(fid, mem, vg, n, vgn, pv_hash))
629 return_0;
632 return 1;
635 static struct volume_group *_read_vg(struct format_instance *fid,
636 struct config_tree *cft)
638 struct config_node *vgn, *cn;
639 struct volume_group *vg;
640 struct dm_hash_table *pv_hash = NULL;
641 struct dm_pool *mem = dm_pool_create("lvm2 vg_read", VG_MEMPOOL_CHUNK);
643 if (!mem)
644 return_NULL;
646 /* skip any top-level values */
647 for (vgn = cft->root; (vgn && vgn->v); vgn = vgn->sib) ;
649 if (!vgn) {
650 log_error("Couldn't find volume group in file.");
651 goto bad;
654 if (!(vg = dm_pool_zalloc(mem, sizeof(*vg))))
655 goto_bad;
657 vg->vgmem = mem;
658 vg->cmd = fid->fmt->cmd;
660 /* FIXME Determine format type from file contents */
661 /* eg Set to instance of fmt1 here if reading a format1 backup? */
662 vg->fid = fid;
664 if (!(vg->name = dm_pool_strdup(mem, vgn->key)))
665 goto_bad;
667 if (!(vg->system_id = dm_pool_zalloc(mem, NAME_LEN)))
668 goto_bad;
670 vgn = vgn->child;
672 if ((cn = find_config_node(vgn, "system_id")) && cn->v) {
673 if (!cn->v->v.str) {
674 log_error("system_id must be a string");
675 goto bad;
677 strncpy(vg->system_id, cn->v->v.str, NAME_LEN);
680 if (!_read_id(&vg->id, vgn, "id")) {
681 log_error("Couldn't read uuid for volume group %s.", vg->name);
682 goto bad;
685 if (!_read_int32(vgn, "seqno", &vg->seqno)) {
686 log_error("Couldn't read 'seqno' for volume group %s.",
687 vg->name);
688 goto bad;
691 if (!_read_flag_config(vgn, &vg->status, VG_FLAGS)) {
692 log_error("Error reading flags of volume group %s.",
693 vg->name);
694 goto bad;
697 if (!_read_int32(vgn, "extent_size", &vg->extent_size)) {
698 log_error("Couldn't read extent size for volume group %s.",
699 vg->name);
700 goto bad;
704 * 'extent_count' and 'free_count' get filled in
705 * implicitly when reading in the pv's and lv's.
708 if (!_read_int32(vgn, "max_lv", &vg->max_lv)) {
709 log_error("Couldn't read 'max_lv' for volume group %s.",
710 vg->name);
711 goto bad;
714 if (!_read_int32(vgn, "max_pv", &vg->max_pv)) {
715 log_error("Couldn't read 'max_pv' for volume group %s.",
716 vg->name);
717 goto bad;
720 vg->alloc = ALLOC_NORMAL;
721 if ((cn = find_config_node(vgn, "allocation_policy"))) {
722 struct config_value *cv = cn->v;
723 if (!cv || !cv->v.str) {
724 log_error("allocation_policy must be a string.");
725 return 0;
728 vg->alloc = get_alloc_from_string(cv->v.str);
729 if (vg->alloc == ALLOC_INVALID)
730 return_0;
734 * The pv hash memoises the pv section names -> pv
735 * structures.
737 if (!(pv_hash = dm_hash_create(32))) {
738 log_error("Couldn't create hash table.");
739 goto bad;
742 dm_list_init(&vg->pvs);
743 if (!_read_sections(fid, "physical_volumes", _read_pv, mem, vg,
744 vgn, pv_hash, 0)) {
745 log_error("Couldn't find all physical volumes for volume "
746 "group %s.", vg->name);
747 goto bad;
750 dm_list_init(&vg->lvs);
751 dm_list_init(&vg->tags);
752 dm_list_init(&vg->removed_pvs);
754 /* Optional tags */
755 if ((cn = find_config_node(vgn, "tags")) &&
756 !(read_tags(mem, &vg->tags, cn->v))) {
757 log_error("Couldn't read tags for volume group %s.", vg->name);
758 goto bad;
761 if (!_read_sections(fid, "logical_volumes", _read_lvnames, mem, vg,
762 vgn, pv_hash, 1)) {
763 log_error("Couldn't read all logical volume names for volume "
764 "group %s.", vg->name);
765 goto bad;
768 if (!_read_sections(fid, "logical_volumes", _read_lvsegs, mem, vg,
769 vgn, pv_hash, 1)) {
770 log_error("Couldn't read all logical volumes for "
771 "volume group %s.", vg->name);
772 goto bad;
775 if (!fixup_imported_mirrors(vg)) {
776 log_error("Failed to fixup mirror pointers after import for "
777 "volume group %s.", vg->name);
778 goto bad;
781 dm_hash_destroy(pv_hash);
784 * Finished.
786 return vg;
788 bad:
789 if (pv_hash)
790 dm_hash_destroy(pv_hash);
792 dm_pool_destroy(mem);
793 return NULL;
796 static void _read_desc(struct dm_pool *mem,
797 struct config_tree *cft, time_t *when, char **desc)
799 const char *d;
800 unsigned int u = 0u;
801 int old_suppress;
803 old_suppress = log_suppress(1);
804 d = find_config_str(cft->root, "description", "");
805 log_suppress(old_suppress);
806 *desc = dm_pool_strdup(mem, d);
808 get_config_uint32(cft->root, "creation_time", &u);
809 *when = u;
812 static const char *_read_vgname(const struct format_type *fmt,
813 struct config_tree *cft, struct id *vgid,
814 uint32_t *vgstatus, char **creation_host)
816 struct config_node *vgn;
817 struct dm_pool *mem = fmt->cmd->mem;
818 char *vgname;
819 int old_suppress;
821 old_suppress = log_suppress(2);
822 *creation_host = dm_pool_strdup(mem,
823 find_config_str(cft->root,
824 "creation_host", ""));
825 log_suppress(old_suppress);
827 /* skip any top-level values */
828 for (vgn = cft->root; (vgn && vgn->v); vgn = vgn->sib) ;
830 if (!vgn) {
831 log_error("Couldn't find volume group in file.");
832 return 0;
835 if (!(vgname = dm_pool_strdup(mem, vgn->key)))
836 return_0;
838 vgn = vgn->child;
840 if (!_read_id(vgid, vgn, "id")) {
841 log_error("Couldn't read uuid for volume group %s.", vgname);
842 return 0;
845 if (!_read_flag_config(vgn, vgstatus, VG_FLAGS)) {
846 log_error("Couldn't find status flags for volume group %s.",
847 vgname);
848 return 0;
851 return vgname;
854 static struct text_vg_version_ops _vsn1_ops = {
855 .check_version = _check_version,
856 .read_vg = _read_vg,
857 .read_desc = _read_desc,
858 .read_vgname = _read_vgname,
861 struct text_vg_version_ops *text_vg_vsn1_init(void)
863 return &_vsn1_ops;