equal
deleted
inserted
replaced
571 uint64_t val; |
571 uint64_t val; |
572 |
572 |
573 /* must not have any changes since most recent snapshot */ |
573 /* must not have any changes since most recent snapshot */ |
574 if (!rbsa->force && dsl_dataset_modified_since_lastsnap(ds)) |
574 if (!rbsa->force && dsl_dataset_modified_since_lastsnap(ds)) |
575 return (ETXTBSY); |
575 return (ETXTBSY); |
|
576 |
|
577 /* new snapshot name must not exist */ |
|
578 err = zap_lookup(ds->ds_dir->dd_pool->dp_meta_objset, |
|
579 ds->ds_phys->ds_snapnames_zapobj, rbsa->tosnap, 8, 1, &val); |
|
580 if (err == 0) |
|
581 return (EEXIST); |
|
582 if (err != ENOENT) |
|
583 return (err); |
576 |
584 |
577 if (rbsa->fromguid) { |
585 if (rbsa->fromguid) { |
578 /* if incremental, most recent snapshot must match fromguid */ |
586 /* if incremental, most recent snapshot must match fromguid */ |
579 if (ds->ds_prev == NULL) |
587 if (ds->ds_prev == NULL) |
580 return (ENODEV); |
588 return (ENODEV); |
619 if (err == 0) |
627 if (err == 0) |
620 return (EEXIST); |
628 return (EEXIST); |
621 if (err != ENOENT) |
629 if (err != ENOENT) |
622 return (err); |
630 return (err); |
623 |
631 |
624 /* new snapshot name must not exist */ |
|
625 err = zap_lookup(ds->ds_dir->dd_pool->dp_meta_objset, |
|
626 ds->ds_phys->ds_snapnames_zapobj, rbsa->tosnap, 8, 1, &val); |
|
627 if (err == 0) |
|
628 return (EEXIST); |
|
629 if (err != ENOENT) |
|
630 return (err); |
|
631 return (0); |
632 return (0); |
632 } |
633 } |
633 |
634 |
634 /* ARGSUSED */ |
635 /* ARGSUSED */ |
635 static void |
636 static void |