-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Illumos 3897 - zfs filesystem and snapshot limits
3897 zfs filesystem and snapshot limits Author: Jerry Jelinek <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Christopher Siden <[email protected]> References: https://www.illumos.org/issues/3897 illumos/illumos-gate@a2afb61 Porting Notes: dsl_dataset_snapshot_check(): reduce stack usage using kmem_alloc(). Ported-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
- Loading branch information
1 parent
308a451
commit 788eb90
Showing
19 changed files
with
1,021 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License, Version 1.0 only | ||
* (the "License"). You may not use this file except in compliance | ||
* with the License. | ||
* | ||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
* or http://www.opensolaris.org/os/licensing. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
#ifndef _LIBSYS_SYS_POLICY_H | ||
#define _LIBSYS_SYS_POLICY_H | ||
|
||
#endif /* _LIBSYS_SYS_POLICY_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
|
||
/* | ||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 2013, Joyent, Inc. All rights reserved. | ||
* Copyright (c) 2013 by Delphix. All rights reserved. | ||
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. | ||
* Copyright (c) 2012 Pawel Jakub Dawidek <[email protected]>. | ||
|
@@ -1934,6 +1935,10 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, | |
case ZFS_PROP_REFQUOTA: | ||
case ZFS_PROP_RESERVATION: | ||
case ZFS_PROP_REFRESERVATION: | ||
case ZFS_PROP_FILESYSTEM_LIMIT: | ||
case ZFS_PROP_SNAPSHOT_LIMIT: | ||
case ZFS_PROP_FILESYSTEM_COUNT: | ||
case ZFS_PROP_SNAPSHOT_COUNT: | ||
*val = getprop_uint64(zhp, prop, source); | ||
|
||
if (*source == NULL) { | ||
|
@@ -2342,6 +2347,30 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen, | |
} | ||
break; | ||
|
||
case ZFS_PROP_FILESYSTEM_LIMIT: | ||
case ZFS_PROP_SNAPSHOT_LIMIT: | ||
case ZFS_PROP_FILESYSTEM_COUNT: | ||
case ZFS_PROP_SNAPSHOT_COUNT: | ||
|
||
if (get_numeric_property(zhp, prop, src, &source, &val) != 0) | ||
return (-1); | ||
|
||
/* | ||
* If limit is UINT64_MAX, we translate this into 'none' (unless | ||
* literal is set), and indicate that it's the default value. | ||
* Otherwise, we print the number nicely and indicate that it's | ||
* set locally. | ||
*/ | ||
if (literal) { | ||
(void) snprintf(propbuf, proplen, "%llu", | ||
(u_longlong_t)val); | ||
} else if (val == UINT64_MAX) { | ||
(void) strlcpy(propbuf, "none", proplen); | ||
} else { | ||
zfs_nicenum(val, propbuf, proplen); | ||
} | ||
break; | ||
|
||
case ZFS_PROP_REFRATIO: | ||
case ZFS_PROP_COMPRESSRATIO: | ||
if (get_numeric_property(zhp, prop, src, &source, &val) != 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. | ||
.\" Copyright 2011 Joshua M. Clulow <[email protected]> | ||
.\" Copyright (c) 2014 by Delphix. All rights reserved. | ||
.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. | ||
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. | ||
.\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved. | ||
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. | ||
.\" | ||
|
@@ -467,6 +467,18 @@ This property is \fBon\fR if the snapshot has been marked for deferred destructi | |
.ne 2 | ||
.mk | ||
.na | ||
\fB\fBfilesystem_count\fR | ||
.ad | ||
.sp .6 | ||
.RS 4n | ||
The total number of filesystems and volumes that exist under this location in the | ||
dataset tree. This value is only available when a \fBfilesystem_limit\fR has | ||
been set somewhere in the tree under which the dataset resides. | ||
.RE | ||
|
||
.sp | ||
.ne 2 | ||
.na | ||
\fB\fBlogicalreferenced\fR\fR | ||
.ad | ||
.sp .6 | ||
|
@@ -549,6 +561,18 @@ property. | |
.ne 2 | ||
.mk | ||
.na | ||
\fB\fBsnapshot_count\fR | ||
.ad | ||
.sp .6 | ||
.RS 4n | ||
The total number of snapshots that exist under this location in the dataset tree. | ||
This value is only available when a \fBsnapshot_limit\fR has been set somewhere | ||
in the tree under which the dataset resides. | ||
.RE | ||
|
||
.sp | ||
.ne 2 | ||
.na | ||
\fB\fBtype\fR\fR | ||
.ad | ||
.sp .6 | ||
|
@@ -910,6 +934,21 @@ Zones are a Solaris feature and are not relevant on Linux. | |
.ne 2 | ||
.mk | ||
.na | ||
\fB\fBfilesystem_limit\fR=\fIcount\fR | \fBnone\fR\fR | ||
.ad | ||
.sp .6 | ||
.RS 4n | ||
Limits the number of filesystems and volumes that can exist under this point in | ||
the dataset tree. The limit is not enforced if the user is allowed to change | ||
the limit. Setting a filesystem_limit on a descendent of a filesystem that | ||
already has a filesystem_limit does not override the ancestor's filesystem_limit, | ||
but rather imposes an additional limit. This feature must be enabled to be used | ||
(see \fBzpool-features\fR(5)). | ||
.RE | ||
|
||
.sp | ||
.ne 2 | ||
.na | ||
\fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR | ||
.ad | ||
.sp .6 | ||
|
@@ -958,6 +997,22 @@ Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an implic | |
.ne 2 | ||
.mk | ||
.na | ||
\fB\fBsnapshot_limit\fR=\fIcount\fR | \fBnone\fR\fR | ||
.ad | ||
.sp .6 | ||
.RS 4n | ||
Limits the number of snapshots that can be created on a dataset and its | ||
descendents. Setting a snapshot_limit on a descendent of a dataset that already | ||
has a snapshot_limit does not override the ancestor's snapshot_limit, but | ||
rather imposes an additional limit. The limit is not enforced if the user is | ||
allowed to change the limit. For example, this means that recursive snapshots | ||
taken from the global zone are counted against each delegated dataset within | ||
a zone. This feature must be enabled to be used (see \fBzpool-features\fR(5)). | ||
.RE | ||
|
||
.sp | ||
.ne 2 | ||
.na | ||
\fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR | ||
.ad | ||
.sp .6 | ||
|
@@ -3013,6 +3068,7 @@ copies property | |
dedup property | ||
devices property | ||
exec property | ||
filesystem_limit property | ||
logbias property | ||
mlslabel property | ||
mountpoint property | ||
|
@@ -3031,6 +3087,7 @@ shareiscsi property | |
sharenfs property | ||
sharesmb property | ||
snapdir property | ||
snapshot_limit property | ||
utf8only property | ||
version property | ||
volblocksize property | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.