equal
deleted
inserted
replaced
16 * fields enclosed by brackets "[]" replaced with your own identifying |
16 * fields enclosed by brackets "[]" replaced with your own identifying |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
|
21 |
21 /* |
22 /* |
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Portions Copyright 2011 iXsystems, Inc |
24 * Portions Copyright 2011 iXsystems, Inc |
|
25 * Copyright (c) 2012 by Delphix. All rights reserved. |
24 */ |
26 */ |
25 |
27 |
26 #include <sys/zfs_context.h> |
28 #include <sys/zfs_context.h> |
27 #include <sys/types.h> |
29 #include <sys/types.h> |
28 #include <sys/param.h> |
30 #include <sys/param.h> |
425 |
427 |
426 if (zapadd) { |
428 if (zapadd) { |
427 char attr_name[8]; |
429 char attr_name[8]; |
428 |
430 |
429 if (sa->sa_layout_attr_obj == 0) { |
431 if (sa->sa_layout_attr_obj == 0) { |
430 sa->sa_layout_attr_obj = zap_create(os, |
432 sa->sa_layout_attr_obj = zap_create_link(os, |
431 DMU_OT_SA_ATTR_LAYOUTS, DMU_OT_NONE, 0, tx); |
433 DMU_OT_SA_ATTR_LAYOUTS, |
432 VERIFY(zap_add(os, sa->sa_master_obj, SA_LAYOUTS, 8, 1, |
434 sa->sa_master_obj, SA_LAYOUTS, tx); |
433 &sa->sa_layout_attr_obj, tx) == 0); |
|
434 } |
435 } |
435 |
436 |
436 (void) snprintf(attr_name, sizeof (attr_name), |
437 (void) snprintf(attr_name, sizeof (attr_name), |
437 "%d", (int)lot_num); |
438 "%d", (int)lot_num); |
438 VERIFY(0 == zap_update(os, os->os_sa->sa_layout_attr_obj, |
439 VERIFY(0 == zap_update(os, os->os_sa->sa_layout_attr_obj, |
1550 mutex_exit(&sa->sa_lock); |
1551 mutex_exit(&sa->sa_lock); |
1551 return; |
1552 return; |
1552 } |
1553 } |
1553 |
1554 |
1554 if (sa->sa_reg_attr_obj == NULL) { |
1555 if (sa->sa_reg_attr_obj == NULL) { |
1555 sa->sa_reg_attr_obj = zap_create(hdl->sa_os, |
1556 sa->sa_reg_attr_obj = zap_create_link(hdl->sa_os, |
1556 DMU_OT_SA_ATTR_REGISTRATION, DMU_OT_NONE, 0, tx); |
1557 DMU_OT_SA_ATTR_REGISTRATION, |
1557 VERIFY(zap_add(hdl->sa_os, sa->sa_master_obj, |
1558 sa->sa_master_obj, SA_REGISTRY, tx); |
1558 SA_REGISTRY, 8, 1, &sa->sa_reg_attr_obj, tx) == 0); |
|
1559 } |
1559 } |
1560 for (i = 0; i != sa->sa_num_attrs; i++) { |
1560 for (i = 0; i != sa->sa_num_attrs; i++) { |
1561 if (sa->sa_attr_table[i].sa_registered) |
1561 if (sa->sa_attr_table[i].sa_registered) |
1562 continue; |
1562 continue; |
1563 ATTR_ENCODE(attr_value, tb[i].sa_attr, tb[i].sa_length, |
1563 ATTR_ENCODE(attr_value, tb[i].sa_attr, tb[i].sa_length, |