Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/makefs/zfs.c
Show First 20 Lines • Show All 602 Lines • ▼ Show 20 Lines | dnode_cursor_init(zfs_opt_t *zfs, zfs_objset_t *os, dnode_phys_t *dnode, | ||||
uint64_t nbppindir, indlevel, ndatablks, nindblks; | uint64_t nbppindir, indlevel, ndatablks, nindblks; | ||||
assert(dnode->dn_nblkptr == 1); | assert(dnode->dn_nblkptr == 1); | ||||
assert(blksz <= MAXBLOCKSIZE); | assert(blksz <= MAXBLOCKSIZE); | ||||
if (blksz == 0) { | if (blksz == 0) { | ||||
/* Must be between 1<<ashift and 128KB. */ | /* Must be between 1<<ashift and 128KB. */ | ||||
blksz = MIN(MAXBLOCKSIZE, MAX(1 << zfs->ashift, | blksz = MIN(MAXBLOCKSIZE, MAX(1 << zfs->ashift, | ||||
powerof2(size) ? size : (1ul << flsll(size)))); | powerof2(size) ? size : (1l << flsll(size)))); | ||||
} | } | ||||
assert(powerof2(blksz)); | assert(powerof2(blksz)); | ||||
/* | /* | ||||
* Do we need indirect blocks? Figure out how many levels are needed | * Do we need indirect blocks? Figure out how many levels are needed | ||||
* (indlevel == 1 means no indirect blocks) and how much space is needed | * (indlevel == 1 means no indirect blocks) and how much space is needed | ||||
* (it has to be allocated up-front to break the dependency cycle | * (it has to be allocated up-front to break the dependency cycle | ||||
* described in objset_write()). | * described in objset_write()). | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |