Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist Merge NetBSD local changes to new z...
details: https://anonhg.NetBSD.org/src/rev/29f5d814cf28
branches: trunk
changeset: 752500:29f5d814cf28
user: haad <haad%NetBSD.org@localhost>
date: Sat Feb 27 23:43:52 2010 +0000
description:
Merge NetBSD local changes to new zfs version 22 sources.
diffstat:
external/cddl/osnet/dist/cmd/zfs/zfs_main.c | 1042 +-
external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c | 93 +-
external/cddl/osnet/dist/cmd/ztest/ztest.c | 5057 +++++++---
external/cddl/osnet/dist/lib/libdtrace/common/drti.c | 15 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c | 6 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_error.c | 8 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h | 17 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c | 19 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c | 4 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c | 25 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c | 22 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c | 7 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c | 56 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c | 17 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c | 265 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c | 100 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_pool.c | 1322 ++-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c | 90 +-
external/cddl/osnet/dist/tools/ctf/cvt/ctf.c | 32 +-
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c | 9 +-
external/cddl/osnet/dist/uts/common/Makefile.files | 404 +-
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c | 81 +-
external/cddl/osnet/dist/uts/common/dtrace/fasttrap.c | 14 +-
external/cddl/osnet/dist/uts/common/dtrace/lockstat.c | 5 +-
external/cddl/osnet/dist/uts/common/dtrace/profile.c | 5 +-
external/cddl/osnet/dist/uts/common/dtrace/sdt_subr.c | 238 +-
external/cddl/osnet/dist/uts/common/dtrace/systrace.c | 7 +-
external/cddl/osnet/dist/uts/common/fs/zfs/arc.c | 903 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c | 586 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c | 715 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dnode.c | 157 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dnode_sync.c | 65 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_deleg.c | 22 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_pool.c | 260 +-
external/cddl/osnet/dist/uts/common/fs/zfs/rrwlock.c | 37 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa.c | 3084 ++++-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c | 123 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c | 70 +-
external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c | 234 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_dir.h | 11 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h | 13 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zvol.h | 8 +-
external/cddl/osnet/dist/uts/common/fs/zfs/txg.c | 130 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c | 1371 ++-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c | 48 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zap_micro.c | 522 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_acl.c | 662 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_dir.c | 142 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_fuid.c | 247 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c | 2729 ++++-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c | 128 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c | 794 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c | 2020 +++-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c | 360 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zio.c | 1490 ++-
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c | 773 +-
external/cddl/osnet/dist/uts/common/sys/dtrace.h | 29 +-
external/cddl/osnet/dist/uts/common/sys/fs/zfs.h | 235 +-
external/cddl/osnet/dist/uts/common/sys/processor.h | 4 +-
external/cddl/osnet/dist/uts/common/sys/sysevent.h | 113 +-
60 files changed, 19077 insertions(+), 7968 deletions(-)
diffs (truncated from 41654 to 300 lines):
diff -r 777f16329c49 -r 29f5d814cf28 external/cddl/osnet/dist/cmd/zfs/zfs_main.c
--- a/external/cddl/osnet/dist/cmd/zfs/zfs_main.c Sat Feb 27 22:42:54 2010 +0000
+++ b/external/cddl/osnet/dist/cmd/zfs/zfs_main.c Sat Feb 27 23:43:52 2010 +0000
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -39,12 +39,14 @@
#include <unistd.h>
#include <fcntl.h>
#include <zone.h>
+#include <grp.h>
+#include <pwd.h>
#include <sys/mkdev.h>
#include <sys/mntent.h>
#include <sys/mnttab.h>
#include <sys/mount.h>
#include <sys/stat.h>
-#include <sys/avl.h>
+#include <sys/fs/zfs.h>
#include <libzfs.h>
#include <libuutil.h>
@@ -56,6 +58,7 @@
static FILE *mnttab_file;
static char history_str[HIS_MAX_RECORD_LEN];
+const char *pypath = "/usr/lib/zfs/pyzfs.py";
static int zfs_do_clone(int argc, char **argv);
static int zfs_do_create(int argc, char **argv);
@@ -75,8 +78,10 @@
static int zfs_do_send(int argc, char **argv);
static int zfs_do_receive(int argc, char **argv);
static int zfs_do_promote(int argc, char **argv);
-static int zfs_do_allow(int argc, char **argv);
-static int zfs_do_unallow(int argc, char **argv);
+static int zfs_do_userspace(int argc, char **argv);
+static int zfs_do_python(int argc, char **argv);
+static int zfs_do_hold(int argc, char **argv);
+static int zfs_do_release(int argc, char **argv);
/*
* Enable a reasonable set of defaults for libumem debugging on DEBUG builds.
@@ -116,7 +121,12 @@
HELP_UNMOUNT,
HELP_UNSHARE,
HELP_ALLOW,
- HELP_UNALLOW
+ HELP_UNALLOW,
+ HELP_USERSPACE,
+ HELP_GROUPSPACE,
+ HELP_HOLD,
+ HELP_HOLDS,
+ HELP_RELEASE
} zfs_help_t;
typedef struct zfs_command {
@@ -147,9 +157,11 @@
{ "list", zfs_do_list, HELP_LIST },
{ NULL },
{ "set", zfs_do_set, HELP_SET },
- { "get", zfs_do_get, HELP_GET },
+ { "get", zfs_do_get, HELP_GET },
{ "inherit", zfs_do_inherit, HELP_INHERIT },
{ "upgrade", zfs_do_upgrade, HELP_UPGRADE },
+ { "userspace", zfs_do_userspace, HELP_USERSPACE },
+ { "groupspace", zfs_do_userspace, HELP_GROUPSPACE },
{ NULL },
{ "mount", zfs_do_mount, HELP_MOUNT },
{ "unmount", zfs_do_unmount, HELP_UNMOUNT },
@@ -159,9 +171,13 @@
{ "send", zfs_do_send, HELP_SEND },
{ "receive", zfs_do_receive, HELP_RECEIVE },
{ NULL },
- { "allow", zfs_do_allow, HELP_ALLOW },
+ { "allow", zfs_do_python, HELP_ALLOW },
+ { NULL },
+ { "unallow", zfs_do_python, HELP_UNALLOW },
{ NULL },
- { "unallow", zfs_do_unallow, HELP_UNALLOW },
+ { "hold", zfs_do_hold, HELP_HOLD },
+ { "holds", zfs_do_python, HELP_HOLDS },
+ { "release", zfs_do_release, HELP_RELEASE },
};
#define NCOMMAND (sizeof (command_table) / sizeof (command_table[0]))
@@ -181,22 +197,22 @@
"\tcreate [-ps] [-b blocksize] [-o property=value] ... "
"-V <size> <volume>\n"));
case HELP_DESTROY:
- return (gettext("\tdestroy [-rRf] "
- "<filesystem|volume|snapshot>\n"));
+ return (gettext("\tdestroy [-rRf] <filesystem|volume>\n"
+ "\tdestroy [-rRd] <snapshot>\n"));
case HELP_GET:
- return (gettext("\tget [-rHp] [-o field[,...]] "
- "[-s source[,...]]\n"
+ return (gettext("\tget [-rHp] [-d max] "
+ "[-o \"all\" | field[,...]] [-s source[,...]]\n"
"\t <\"all\" | property[,...]> "
"[filesystem|volume|snapshot] ...\n"));
case HELP_INHERIT:
- return (gettext("\tinherit [-r] <property> "
+ return (gettext("\tinherit [-rS] <property> "
"<filesystem|volume|snapshot> ...\n"));
case HELP_UPGRADE:
return (gettext("\tupgrade [-v]\n"
"\tupgrade [-r] [-V version] <-a | filesystem ...>\n"));
case HELP_LIST:
- return (gettext("\tlist [-rH] [-o property[,...]] "
- "[-t type[,...]] [-s property] ...\n"
+ return (gettext("\tlist [-rH][-d max] "
+ "[-o property[,...]] [-t type[,...]] [-s property] ...\n"
"\t [-S property] ... "
"[filesystem|volume|snapshot] ...\n"));
case HELP_MOUNT:
@@ -216,7 +232,7 @@
case HELP_ROLLBACK:
return (gettext("\trollback [-rRf] <snapshot>\n"));
case HELP_SEND:
- return (gettext("\tsend [-R] [-[iI] snapshot] <snapshot>\n"));
+ return (gettext("\tsend [-RDp] [-[iI] snapshot] <snapshot>\n"));
case HELP_SET:
return (gettext("\tset <property=value> "
"<filesystem|volume|snapshot> ...\n"));
@@ -229,10 +245,11 @@
return (gettext("\tunmount [-f] "
"<-a | filesystem|mountpoint>\n"));
case HELP_UNSHARE:
- return (gettext("\tunshare [-f] "
+ return (gettext("\tunshare "
"<-a | filesystem|mountpoint>\n"));
case HELP_ALLOW:
- return (gettext("\tallow [-ldug] "
+ return (gettext("\tallow <filesystem|volume>\n"
+ "\tallow [-ldug] "
"<\"everyone\"|user|group>[,...] <perm|@setname>[,...]\n"
"\t <filesystem|volume>\n"
"\tallow [-ld] -e <perm|@setname>[,...] "
@@ -250,6 +267,20 @@
"<filesystem|volume>\n"
"\tunallow [-r] -s @setname [<perm|@setname>[,...]] "
"<filesystem|volume>\n"));
+ case HELP_USERSPACE:
+ return (gettext("\tuserspace [-hniHp] [-o field[,...]] "
+ "[-sS field] ... [-t type[,...]]\n"
+ "\t <filesystem|snapshot>\n"));
+ case HELP_GROUPSPACE:
+ return (gettext("\tgroupspace [-hniHpU] [-o field[,...]] "
+ "[-sS field] ... [-t type[,...]]\n"
+ "\t <filesystem|snapshot>\n"));
+ case HELP_HOLD:
+ return (gettext("\thold [-r] <tag> <snapshot> ...\n"));
+ case HELP_HOLDS:
+ return (gettext("\tholds [-r] <snapshot> ...\n"));
+ case HELP_RELEASE:
+ return (gettext("\trelease [-r] <tag> <snapshot> ...\n"));
}
abort();
@@ -311,7 +342,6 @@
{
int i;
boolean_t show_properties = B_FALSE;
- boolean_t show_permissions = B_FALSE;
FILE *fp = requested ? stdout : stderr;
if (current_command == NULL) {
@@ -342,13 +372,7 @@
strcmp(current_command->name, "list") == 0))
show_properties = B_TRUE;
- if (current_command != NULL &&
- (strcmp(current_command->name, "allow") == 0 ||
- strcmp(current_command->name, "unallow") == 0))
- show_permissions = B_TRUE;
-
if (show_properties) {
-
(void) fprintf(fp,
gettext("\nThe following properties are supported:\n"));
@@ -359,29 +383,33 @@
(void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
ZFS_TYPE_DATASET);
+ (void) fprintf(fp, "\t%-15s ", "userused@...");
+ (void) fprintf(fp, " NO NO <size>\n");
+ (void) fprintf(fp, "\t%-15s ", "groupused@...");
+ (void) fprintf(fp, " NO NO <size>\n");
+ (void) fprintf(fp, "\t%-15s ", "userquota@...");
+ (void) fprintf(fp, "YES NO <size> | none\n");
+ (void) fprintf(fp, "\t%-15s ", "groupquota@...");
+ (void) fprintf(fp, "YES NO <size> | none\n");
+
(void) fprintf(fp, gettext("\nSizes are specified in bytes "
"with standard units such as K, M, G, etc.\n"));
(void) fprintf(fp, gettext("\nUser-defined properties can "
"be specified by using a name containing a colon (:).\n"));
-
- } else if (show_permissions) {
- (void) fprintf(fp,
- gettext("\nThe following permissions are supported:\n"));
-
- zfs_deleg_permissions();
+ (void) fprintf(fp, gettext("\nThe {user|group}{used|quota}@ "
+ "properties must be appended with\n"
+ "a user or group specifier of one of these forms:\n"
+ " POSIX name (eg: \"matt\")\n"
+ " POSIX id (eg: \"126829\")\n"
+ " SMB name@domain (eg: \"matt@sun\")\n"
+ " SMB SID (eg: \"S-1-234-567-89\")\n"));
} else {
- /*
- * TRANSLATION NOTE:
- * "zfs set|get" must not be localised this is the
- * command name and arguments.
- */
-
(void) fprintf(fp,
- gettext("\nFor the property list, run: zfs set|get\n"));
-
+ gettext("\nFor the property list, run: %s\n"),
+ "zfs set|get");
(void) fprintf(fp,
- gettext("\nFor the delegated permission list, run:"
- " zfs allow|unallow\n"));
+ gettext("\nFor the delegated permission list, run: %s\n"),
+ "zfs allow|unallow");
}
/*
@@ -419,7 +447,27 @@
return (-1);
}
return (0);
-
+}
+
+static int
+parse_depth(char *opt, int *flags)
+{
+ char *tmp;
+ int depth;
+
+ depth = (int)strtol(opt, &tmp, 0);
+ if (*tmp) {
+ (void) fprintf(stderr,
+ gettext("%s is not an integer\n"), optarg);
+ usage(B_FALSE);
+ }
+ if (depth < 0) {
+ (void) fprintf(stderr,
+ gettext("Depth can not be negative.\n"));
+ usage(B_FALSE);
+ }
+ *flags |= (ZFS_ITER_DEPTH_LIMIT|ZFS_ITER_RECURSE);
+ return (depth);
}
/*
@@ -666,6 +714,7 @@
resv_prop = ZFS_PROP_REFRESERVATION;
else
resv_prop = ZFS_PROP_RESERVATION;
+ volsize = zvol_volsize_to_reservation(volsize, props);
if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop),
&strval) != 0) {
@@ -736,11 +785,13 @@
}
/*
- * zfs destroy [-rf] <fs, snap, vol>
+ * zfs destroy [-rRf] <fs, vol>
+ * zfs destroy [-rRd] <snap>
*
- * -r Recursively destroy all children
- * -R Recursively destroy all dependents, including clones
- * -f Force unmounting of any dependents
+ * -r Recursively destroy all children
+ * -R Recursively destroy all dependents, including clones
+ * -f Force unmounting of any dependents
+ * -d If we can't destroy now, mark for deferred destruction
*
* Destroys the given dataset. By default, it will unmount any filesystems,
* and refuse to destroy a dataset that has any dependents. A dependent can
@@ -756,6 +807,7 @@
boolean_t cb_closezhp;
zfs_handle_t *cb_target;
char *cb_snapname;
+ boolean_t cb_defer_destroy;
} destroy_cbdata_t;
Home |
Main Index |
Thread Index |
Old Index