Lines Matching refs:shadow

29  * ZFS shadow data migration
31 * ZFS supports native integration with the 'shadow' mount property used to
33 * this is quite generic, and allows for 'shadow=<path>' to be set on any
35 * native 'shadow' property, and support a friendlier way of specifying
38 * The 'shadow' ZFS property does not take a filesystem path, but a URI
47 * appropriate protocol, and pass down the path to the shadow filesystem.
69 #define ZFS_SHADOW_DIR _PATH_SYSVOL "/zfs/shadow"
73 zfs_shadow_parse(libzfs_handle_t *hdl, const char *shadow,
80 errmsg = dgettext(TEXT_DOMAIN, "cannot create shadow directory");
84 if (strncmp(shadow, "file://", 7) == 0) {
88 shadow += 7;
94 if (shadow[0] != '/') {
96 "shadow file path must be absolute"));
100 if ((len = resolvepath(shadow, fullpath,
109 * Don't accept a path within our shadow mount directory.
111 * the way to the shadow mount directory.
146 } else if (strncmp(shadow, "nfs://", 6) == 0) {
148 shadow += 6;
154 if (shadow[0] == '/' || shadow[0] == '\0') {
160 if ((slash = strchr(shadow, '/')) == NULL) {
166 if ((*path = zfs_alloc(hdl, strlen(shadow) + 2)) == NULL)
169 len = slash - shadow;
170 (void) strncpy(*path, shadow, len);
172 (void) strcpy(*path + len + 1, shadow + len);
180 } else if (strncmp(shadow, "smb://", 6) == 0) {
182 shadow += 6;
188 if (strchr(shadow, '/') == NULL) {
194 if ((*path = zfs_strdup(hdl, shadow)) == NULL)
199 "unknown shadow protocol"));
207 zfs_shadow_validate(libzfs_handle_t *hdl, const char *shadow)
213 if (strcmp(shadow, "none") == 0)
216 if (zfs_shadow_parse(hdl, shadow, &protocol, &mntopts, &path) != 0)
231 char shadow[ZFS_MAXPROPLEN];
240 if (zfs_prop_get(zhp, ZFS_PROP_SHADOW, shadow, sizeof (shadow),
242 strcmp(shadow, "none") == 0)
247 /* strip any 'shadow=standby' from a mount that doesn't need it */
250 if ((shadopt = hasmntopt(&entry, "shadow")) == NULL)
259 * If this is a remount request, then check to see if the shadow
264 (prevshadow = hasmntopt(&entry, "shadow")) != NULL) {
265 assert(strncmp(prevshadow, "shadow=", 7) == 0);
267 len = strlen(shadow);
269 if (strncmp(prevshadow, shadow, len) == 0 &&
284 * Make sure the shadow directory exists.
290 "failed to create shadow directory")));
302 * If the user has manually specified a shadow setting (typically only
303 * allowed with "shadow=standby"), then don't do anything else.
305 if (strstr(mountopts, "shadow=") != NULL)
323 if (zfs_shadow_parse(hdl, shadow, &mnttype, &mntopts, &arg) != 0)
341 dgettext(TEXT_DOMAIN, "failed to mount shadow directory")));
347 (void) strcat(mountopts, "shadow=");
374 char shadow[ZFS_MAXPROPLEN];
376 if (zfs_prop_get(zhp, ZFS_PROP_SHADOW, shadow, sizeof (shadow),
378 strcmp(shadow, "none") == 0)
406 char shadow[ZFS_MAXPROPLEN];
408 if (zfs_prop_get(zhp, ZFS_PROP_SHADOW, shadow,
409 sizeof (shadow), NULL, NULL, 0, B_FALSE) != 0)
412 if (strcmp(shadow, "none") == 0)