space_map.h (258717) | space_map.h (269118) |
---|---|
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 --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26/* | 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 --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26/* |
27 * Copyright (c) 2013 by Delphix. All rights reserved. | 27 * Copyright (c) 2012, 2014 by Delphix. All rights reserved. |
28 */ 29 30#ifndef _SYS_SPACE_MAP_H 31#define _SYS_SPACE_MAP_H 32 33#include <sys/avl.h> 34#include <sys/range_tree.h> 35#include <sys/dmu.h> 36 37#ifdef __cplusplus 38extern "C" { 39#endif 40 41/* 42 * The size of the space map object has increased to include a histogram. 43 * The SPACE_MAP_SIZE_V0 designates the original size and is used to 44 * maintain backward compatibility. 45 */ 46#define SPACE_MAP_SIZE_V0 (3 * sizeof (uint64_t)) | 28 */ 29 30#ifndef _SYS_SPACE_MAP_H 31#define _SYS_SPACE_MAP_H 32 33#include <sys/avl.h> 34#include <sys/range_tree.h> 35#include <sys/dmu.h> 36 37#ifdef __cplusplus 38extern "C" { 39#endif 40 41/* 42 * The size of the space map object has increased to include a histogram. 43 * The SPACE_MAP_SIZE_V0 designates the original size and is used to 44 * maintain backward compatibility. 45 */ 46#define SPACE_MAP_SIZE_V0 (3 * sizeof (uint64_t)) |
47#define SPACE_MAP_HISTOGRAM_SIZE(sm) \ 48 (sizeof ((sm)->sm_phys->smp_histogram) / \ 49 sizeof ((sm)->sm_phys->smp_histogram[0])) | 47#define SPACE_MAP_HISTOGRAM_SIZE 32 |
50 51/* 52 * The space_map_phys is the on-disk representation of the space map. 53 * Consumers of space maps should never reference any of the members of this 54 * structure directly. These members may only be updated in syncing context. 55 * 56 * Note the smp_object is no longer used but remains in the structure 57 * for backward compatibility. --- 5 unchanged lines hidden (view full) --- 63 uint64_t smp_pad[5]; /* reserved */ 64 65 /* 66 * The smp_histogram maintains a histogram of free regions. Each 67 * bucket, smp_histogram[i], contains the number of free regions 68 * whose size is: 69 * 2^(i+sm_shift) <= size of free region in bytes < 2^(i+sm_shift+1) 70 */ | 48 49/* 50 * The space_map_phys is the on-disk representation of the space map. 51 * Consumers of space maps should never reference any of the members of this 52 * structure directly. These members may only be updated in syncing context. 53 * 54 * Note the smp_object is no longer used but remains in the structure 55 * for backward compatibility. --- 5 unchanged lines hidden (view full) --- 61 uint64_t smp_pad[5]; /* reserved */ 62 63 /* 64 * The smp_histogram maintains a histogram of free regions. Each 65 * bucket, smp_histogram[i], contains the number of free regions 66 * whose size is: 67 * 2^(i+sm_shift) <= size of free region in bytes < 2^(i+sm_shift+1) 68 */ |
71 uint64_t smp_histogram[32]; /* histogram of free space */ | 69 uint64_t smp_histogram[SPACE_MAP_HISTOGRAM_SIZE]; |
72} space_map_phys_t; 73 74/* 75 * The space map object defines a region of space, its size, how much is 76 * allocated, and the on-disk object that stores this information. 77 * Consumers of space maps may only access the members of this structure. 78 */ 79typedef struct space_map { --- 98 unchanged lines hidden --- | 70} space_map_phys_t; 71 72/* 73 * The space map object defines a region of space, its size, how much is 74 * allocated, and the on-disk object that stores this information. 75 * Consumers of space maps may only access the members of this structure. 76 */ 77typedef struct space_map { --- 98 unchanged lines hidden --- |