diff options
author | delphij <delphij@FreeBSD.org> | 2014-05-09 07:12:31 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-05-09 07:12:31 +0000 |
commit | 7cb0f49ed2f136dd32fc5ce108ef3e244742098c (patch) | |
tree | f95691e1512ec1038738e6864508fb9da70312ea /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c | |
parent | 1b18a5ca9893b654bc9a4eaecc7a79c02c93d3ef (diff) | |
download | FreeBSD-src-7cb0f49ed2f136dd32fc5ce108ef3e244742098c.zip FreeBSD-src-7cb0f49ed2f136dd32fc5ce108ef3e244742098c.tar.gz |
MFC r264835 (MFV r264829):
3897 zfs filesystem and snapshot limits
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c index 9e695cd..639412c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2013 by Joyent, Inc. All rights reserved. */ #include <sys/zfs_context.h> @@ -430,7 +431,7 @@ dsl_destroy_snapshot_sync_impl(dsl_dataset_t *ds, boolean_t defer, dmu_tx_t *tx) ASSERT3U(val, ==, obj); } #endif - VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx)); + VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx, B_TRUE)); dsl_dataset_rele(ds_head, FTAG); if (ds_prev != NULL) @@ -657,6 +658,17 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu_tx_t *tx) ASSERT0(dd->dd_phys->dd_head_dataset_obj); /* + * Decrement the filesystem count for all parent filesystems. + * + * When we receive an incremental stream into a filesystem that already + * exists, a temporary clone is created. We never count this temporary + * clone, whose name begins with a '%'. + */ + if (dd->dd_myname[0] != '%' && dd->dd_parent != NULL) + dsl_fs_ss_count_adjust(dd->dd_parent, -1, + DD_FIELD_FILESYSTEM_COUNT, tx); + + /* * Remove our reservation. The impl() routine avoids setting the * actual property, which would require the (already destroyed) ds. */ |