libzfs_changelist.c (185029) | libzfs_changelist.c (209962) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* |
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. 25 * 26 * Portions Copyright 2007 Ramprakash Jelari 27 */ 28 29#include <libintl.h> 30#include <libuutil.h> 31#include <stddef.h> --- 181 unchanged lines hidden (view full) --- 213 * datasets before mounting the children. We walk all datasets even if 214 * there are errors. 215 */ 216 for (cn = uu_list_last(clp->cl_list); cn != NULL; 217 cn = uu_list_prev(clp->cl_list, cn)) { 218 219 boolean_t sharenfs; 220 boolean_t sharesmb; | 24 * Use is subject to license terms. 25 * 26 * Portions Copyright 2007 Ramprakash Jelari 27 */ 28 29#include <libintl.h> 30#include <libuutil.h> 31#include <stddef.h> --- 181 unchanged lines hidden (view full) --- 213 * datasets before mounting the children. We walk all datasets even if 214 * there are errors. 215 */ 216 for (cn = uu_list_last(clp->cl_list); cn != NULL; 217 cn = uu_list_prev(clp->cl_list, cn)) { 218 219 boolean_t sharenfs; 220 boolean_t sharesmb; |
221 boolean_t mounted; |
|
221 222 /* 223 * If we are in the global zone, but this dataset is exported 224 * to a local zone, do nothing. 225 */ 226 if (getzoneid() == GLOBAL_ZONEID && cn->cn_zoned) 227 continue; 228 --- 38 unchanged lines hidden (view full) --- 267 sharenfs = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARENFS, 268 shareopts, sizeof (shareopts), NULL, NULL, 0, 269 B_FALSE) == 0) && (strcmp(shareopts, "off") != 0)); 270 271 sharesmb = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARESMB, 272 shareopts, sizeof (shareopts), NULL, NULL, 0, 273 B_FALSE) == 0) && (strcmp(shareopts, "off") != 0)); 274 | 222 223 /* 224 * If we are in the global zone, but this dataset is exported 225 * to a local zone, do nothing. 226 */ 227 if (getzoneid() == GLOBAL_ZONEID && cn->cn_zoned) 228 continue; 229 --- 38 unchanged lines hidden (view full) --- 268 sharenfs = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARENFS, 269 shareopts, sizeof (shareopts), NULL, NULL, 0, 270 B_FALSE) == 0) && (strcmp(shareopts, "off") != 0)); 271 272 sharesmb = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARESMB, 273 shareopts, sizeof (shareopts), NULL, NULL, 0, 274 B_FALSE) == 0) && (strcmp(shareopts, "off") != 0)); 275 |
275 if ((cn->cn_mounted || clp->cl_waslegacy || sharenfs || 276 sharesmb) && !zfs_is_mounted(cn->cn_handle, NULL) && 277 zfs_mount(cn->cn_handle, NULL, 0) != 0) 278 errors++; | 276 mounted = zfs_is_mounted(cn->cn_handle, NULL); |
279 | 277 |
278 if (!mounted && (cn->cn_mounted || 279 ((sharenfs || sharesmb || clp->cl_waslegacy) && 280 (zfs_prop_get_int(cn->cn_handle, 281 ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_ON)))) { 282 283 if (zfs_mount(cn->cn_handle, NULL, 0) != 0) 284 errors++; 285 else 286 mounted = TRUE; 287 } 288 |
|
280 /* | 289 /* |
281 * We always re-share even if the filesystem is currently 282 * shared, so that we can adopt any new options. | 290 * If the file system is mounted we always re-share even 291 * if the filesystem is currently shared, so that we can 292 * adopt any new options. |
283 */ | 293 */ |
284 if (sharenfs) | 294 if (sharenfs && mounted) |
285 errors += zfs_share_nfs(cn->cn_handle); 286 else if (cn->cn_shared || clp->cl_waslegacy) 287 errors += zfs_unshare_nfs(cn->cn_handle, NULL); | 295 errors += zfs_share_nfs(cn->cn_handle); 296 else if (cn->cn_shared || clp->cl_waslegacy) 297 errors += zfs_unshare_nfs(cn->cn_handle, NULL); |
288 if (sharesmb) | 298 if (sharesmb && mounted) |
289 errors += zfs_share_smb(cn->cn_handle); 290 else if (cn->cn_shared || clp->cl_waslegacy) 291 errors += zfs_unshare_smb(cn->cn_handle, NULL); 292 } 293 294 return (errors ? -1 : 0); 295} 296 --- 319 unchanged lines hidden (view full) --- 616 clp->cl_alldependents = B_TRUE; 617 } else if (prop == ZFS_PROP_ZONED) { 618 clp->cl_prop = ZFS_PROP_MOUNTPOINT; 619 clp->cl_allchildren = B_TRUE; 620 } else if (prop == ZFS_PROP_CANMOUNT) { 621 clp->cl_prop = ZFS_PROP_MOUNTPOINT; 622 } else if (prop == ZFS_PROP_VOLSIZE) { 623 clp->cl_prop = ZFS_PROP_MOUNTPOINT; | 299 errors += zfs_share_smb(cn->cn_handle); 300 else if (cn->cn_shared || clp->cl_waslegacy) 301 errors += zfs_unshare_smb(cn->cn_handle, NULL); 302 } 303 304 return (errors ? -1 : 0); 305} 306 --- 319 unchanged lines hidden (view full) --- 626 clp->cl_alldependents = B_TRUE; 627 } else if (prop == ZFS_PROP_ZONED) { 628 clp->cl_prop = ZFS_PROP_MOUNTPOINT; 629 clp->cl_allchildren = B_TRUE; 630 } else if (prop == ZFS_PROP_CANMOUNT) { 631 clp->cl_prop = ZFS_PROP_MOUNTPOINT; 632 } else if (prop == ZFS_PROP_VOLSIZE) { 633 clp->cl_prop = ZFS_PROP_MOUNTPOINT; |
624 } else if (prop == ZFS_PROP_VERSION) { 625 clp->cl_prop = ZFS_PROP_MOUNTPOINT; | |
626 } else { 627 clp->cl_prop = prop; 628 } 629 clp->cl_realprop = prop; 630 631 if (clp->cl_prop != ZFS_PROP_MOUNTPOINT && 632 clp->cl_prop != ZFS_PROP_SHARENFS && 633 clp->cl_prop != ZFS_PROP_SHARESMB && --- 80 unchanged lines hidden --- | 634 } else { 635 clp->cl_prop = prop; 636 } 637 clp->cl_realprop = prop; 638 639 if (clp->cl_prop != ZFS_PROP_MOUNTPOINT && 640 clp->cl_prop != ZFS_PROP_SHARENFS && 641 clp->cl_prop != ZFS_PROP_SHARESMB && --- 80 unchanged lines hidden --- |