zap_micro.c (229578) | zap_micro.c (243674) |
---|---|
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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | 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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2011 by Delphix. All rights reserved. | 23 * Copyright (c) 2012 by Delphix. All rights reserved. |
24 */ 25 26#include <sys/zio.h> 27#include <sys/spa.h> 28#include <sys/dmu.h> 29#include <sys/zfs_context.h> 30#include <sys/zap.h> 31#include <sys/refcount.h> --- 435 unchanged lines hidden (view full) --- 467 err = dmu_buf_hold(os, obj, 0, NULL, &db, DMU_READ_NO_PREFETCH); 468 if (err) 469 return (err); 470 471#ifdef ZFS_DEBUG 472 { 473 dmu_object_info_t doi; 474 dmu_object_info_from_db(db, &doi); | 24 */ 25 26#include <sys/zio.h> 27#include <sys/spa.h> 28#include <sys/dmu.h> 29#include <sys/zfs_context.h> 30#include <sys/zap.h> 31#include <sys/refcount.h> --- 435 unchanged lines hidden (view full) --- 467 err = dmu_buf_hold(os, obj, 0, NULL, &db, DMU_READ_NO_PREFETCH); 468 if (err) 469 return (err); 470 471#ifdef ZFS_DEBUG 472 { 473 dmu_object_info_t doi; 474 dmu_object_info_from_db(db, &doi); |
475 ASSERT(dmu_ot[doi.doi_type].ot_byteswap == zap_byteswap); | 475 ASSERT3U(DMU_OT_BYTESWAP(doi.doi_type), ==, DMU_BSWAP_ZAP); |
476 } 477#endif 478 479 zap = dmu_buf_get_user(db); 480 if (zap == NULL) 481 zap = mzap_open(os, obj, db); 482 483 /* --- 28 unchanged lines hidden (view full) --- 512 uint64_t newsz = db->db_size + SPA_MINBLOCKSIZE; 513 if (newsz > MZAP_MAX_BLKSZ) { 514 dprintf("upgrading obj %llu: num_entries=%u\n", 515 obj, zap->zap_m.zap_num_entries); 516 *zapp = zap; 517 return (mzap_upgrade(zapp, tx, 0)); 518 } 519 err = dmu_object_set_blocksize(os, obj, newsz, 0, tx); | 476 } 477#endif 478 479 zap = dmu_buf_get_user(db); 480 if (zap == NULL) 481 zap = mzap_open(os, obj, db); 482 483 /* --- 28 unchanged lines hidden (view full) --- 512 uint64_t newsz = db->db_size + SPA_MINBLOCKSIZE; 513 if (newsz > MZAP_MAX_BLKSZ) { 514 dprintf("upgrading obj %llu: num_entries=%u\n", 515 obj, zap->zap_m.zap_num_entries); 516 *zapp = zap; 517 return (mzap_upgrade(zapp, tx, 0)); 518 } 519 err = dmu_object_set_blocksize(os, obj, newsz, 0, tx); |
520 ASSERT3U(err, ==, 0); | 520 ASSERT0(err); |
521 zap->zap_m.zap_num_chunks = 522 db->db_size / MZAP_ENT_LEN - 1; 523 } 524 525 *zapp = zap; 526 return (0); 527} 528 --- 62 unchanged lines hidden (view full) --- 591 mzap_phys_t *zp; 592 593 VERIFY(0 == dmu_buf_hold(os, obj, 0, FTAG, &db, DMU_READ_NO_PREFETCH)); 594 595#ifdef ZFS_DEBUG 596 { 597 dmu_object_info_t doi; 598 dmu_object_info_from_db(db, &doi); | 521 zap->zap_m.zap_num_chunks = 522 db->db_size / MZAP_ENT_LEN - 1; 523 } 524 525 *zapp = zap; 526 return (0); 527} 528 --- 62 unchanged lines hidden (view full) --- 591 mzap_phys_t *zp; 592 593 VERIFY(0 == dmu_buf_hold(os, obj, 0, FTAG, &db, DMU_READ_NO_PREFETCH)); 594 595#ifdef ZFS_DEBUG 596 { 597 dmu_object_info_t doi; 598 dmu_object_info_from_db(db, &doi); |
599 ASSERT(dmu_ot[doi.doi_type].ot_byteswap == zap_byteswap); | 599 ASSERT3U(DMU_OT_BYTESWAP(doi.doi_type), ==, DMU_BSWAP_ZAP); |
600 } 601#endif 602 603 dmu_buf_will_dirty(db, tx); 604 zp = db->db_data; 605 zp->mz_block_type = ZBT_MICRO; 606 zp->mz_salt = ((uintptr_t)db ^ (uintptr_t)tx ^ (obj << 1)) | 1ULL; 607 zp->mz_normflags = normflags; --- 860 unchanged lines hidden --- | 600 } 601#endif 602 603 dmu_buf_will_dirty(db, tx); 604 zp = db->db_data; 605 zp->mz_block_type = ZBT_MICRO; 606 zp->mz_salt = ((uintptr_t)db ^ (uintptr_t)tx ^ (obj << 1)) | 1ULL; 607 zp->mz_normflags = normflags; --- 860 unchanged lines hidden --- |