Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/zfs/zfsimpl.c
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/* | /* | ||||
* List of all pools, chained through spa_link. | * List of all pools, chained through spa_link. | ||||
*/ | */ | ||||
static spa_list_t zfs_pools; | static spa_list_t zfs_pools; | ||||
static uint64_t zfs_crc64_table[256]; | static uint64_t zfs_crc64_table[256]; | ||||
static const dnode_phys_t *dnode_cache_obj = 0; | static const dnode_phys_t *dnode_cache_obj = NULL; | ||||
static uint64_t dnode_cache_bn; | static uint64_t dnode_cache_bn; | ||||
static char *dnode_cache_buf; | static char *dnode_cache_buf; | ||||
static char *zap_scratch; | static char *zap_scratch; | ||||
static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; | static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; | ||||
#define TEMP_SIZE (1024 * 1024) | #define TEMP_SIZE (1024 * 1024) | ||||
static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); | static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); | ||||
▲ Show 20 Lines • Show All 1,441 Lines • ▼ Show 20 Lines | fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, | ||||
int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - zl.l_phys->l_hdr.lh_prefix_len); | int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - zl.l_phys->l_hdr.lh_prefix_len); | ||||
int h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); | int h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); | ||||
h = zl.l_phys->l_hash[h]; | h = zl.l_phys->l_hash[h]; | ||||
if (h == 0xffff) | if (h == 0xffff) | ||||
return (ENOENT); | return (ENOENT); | ||||
zc = &ZAP_LEAF_CHUNK(&zl, h); | zc = &ZAP_LEAF_CHUNK(&zl, h); | ||||
while (zc->l_entry.le_hash != hash) { | while (zc->l_entry.le_hash != hash) { | ||||
if (zc->l_entry.le_next == 0xffff) { | if (zc->l_entry.le_next == 0xffff) { | ||||
zc = 0; | zc = NULL; | ||||
break; | break; | ||||
} | } | ||||
zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); | zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); | ||||
} | } | ||||
if (fzap_name_equal(&zl, zc, name)) { | if (fzap_name_equal(&zl, zc, name)) { | ||||
if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > | if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > | ||||
integer_size * num_integers) | integer_size * num_integers) | ||||
return (E2BIG); | return (E2BIG); | ||||
▲ Show 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | if (!*p) | ||||
break; | break; | ||||
q = strchr(p, '/'); | q = strchr(p, '/'); | ||||
if (q) { | if (q) { | ||||
memcpy(element, p, q - p); | memcpy(element, p, q - p); | ||||
element[q - p] = 0; | element[q - p] = 0; | ||||
p = q; | p = q; | ||||
} else { | } else { | ||||
strcpy(element, p); | strcpy(element, p); | ||||
p = 0; | p = NULL; | ||||
} | } | ||||
rc = zfs_dnode_stat(spa, &dn, &sb); | rc = zfs_dnode_stat(spa, &dn, &sb); | ||||
if (rc) | if (rc) | ||||
return (rc); | return (rc); | ||||
if (!S_ISDIR(sb.st_mode)) | if (!S_ISDIR(sb.st_mode)) | ||||
return (ENOTDIR); | return (ENOTDIR); | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |