X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibzfs%2Flibzfs_pool.c;fp=lib%2Flibzfs%2Flibzfs_pool.c;h=468243c3ac7a592356294154cebab657e7281c61;hb=a36bf1149d7408fde273851350c0ef6c0e4fe989;hp=a6cacd370c2c6945b7a42c8b08489ad220f65b43;hpb=0c28fb480836ab7bb1bbf8de6e572d2443273396;p=zfs.git diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index a6cacd3..468243c 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -235,13 +235,23 @@ zpool_pool_state_to_name(pool_state_t state) } /* - * Get a zpool property value for 'prop' and return the value in - * a pre-allocated buffer. + * API compatibility wrapper around zpool_get_prop_literal */ int zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, zprop_source_t *srctype) { + return zpool_get_prop_literal(zhp, prop, buf, len, srctype, B_FALSE); +} + +/* + * Get a zpool property value for 'prop' and return the value in + * a pre-allocated buffer. + */ +int +zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, + zprop_source_t *srctype, boolean_t literal) +{ uint64_t intval; const char *strval; zprop_source_t src = ZPROP_SRC_NONE; @@ -307,7 +317,11 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, case ZPOOL_PROP_FREEING: case ZPOOL_PROP_EXPANDSZ: case ZPOOL_PROP_ASHIFT: - (void) zfs_nicenum(intval, buf, len); + if (literal) + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + else + (void) zfs_nicenum(intval, buf, len); break; case ZPOOL_PROP_CAPACITY: