1941 int error = 0;
1942 nvlist_t *nv;
1943
1944 dmu_objset_fast_stat(os, &zc->zc_objset_stats);
1945
1946 if (zc->zc_nvlist_dst != 0 &&
1947 (error = dsl_prop_get_all(os, &nv)) == 0) {
1948 dmu_objset_stats(os, nv);
1949 /*
1950 * NB: zvol_get_stats() will read the objset contents,
1951 * which we aren't supposed to do with a
1952 * DS_MODE_USER hold, because it could be
1953 * inconsistent. So this is a bit of a workaround...
1954 * XXX reading with out owning
1955 */
1956 if (!zc->zc_objset_stats.dds_inconsistent &&
1957 dmu_objset_type(os) == DMU_OST_ZVOL) {
1958 error = zvol_get_stats(os, nv);
1959 if (error == EIO)
1960 return (error);
1961 VERIFY3S(error, ==, 0);
1962 }
1963 error = put_nvlist(zc, nv);
1964 nvlist_free(nv);
1965 }
1966
1967 return (error);
1968 }
1969
1970 /*
1971 * inputs:
1972 * zc_name name of filesystem
1973 * zc_nvlist_dst_size size of buffer for property nvlist
1974 *
1975 * outputs:
1976 * zc_objset_stats stats
1977 * zc_nvlist_dst property nvlist
1978 * zc_nvlist_dst_size size of property nvlist
1979 */
1980 static int
1981 zfs_ioc_objset_stats(zfs_cmd_t *zc)
|
1941 int error = 0;
1942 nvlist_t *nv;
1943
1944 dmu_objset_fast_stat(os, &zc->zc_objset_stats);
1945
1946 if (zc->zc_nvlist_dst != 0 &&
1947 (error = dsl_prop_get_all(os, &nv)) == 0) {
1948 dmu_objset_stats(os, nv);
1949 /*
1950 * NB: zvol_get_stats() will read the objset contents,
1951 * which we aren't supposed to do with a
1952 * DS_MODE_USER hold, because it could be
1953 * inconsistent. So this is a bit of a workaround...
1954 * XXX reading with out owning
1955 */
1956 if (!zc->zc_objset_stats.dds_inconsistent &&
1957 dmu_objset_type(os) == DMU_OST_ZVOL) {
1958 error = zvol_get_stats(os, nv);
1959 if (error == EIO)
1960 return (error);
1961 VERIFY0(error);
1962 }
1963 error = put_nvlist(zc, nv);
1964 nvlist_free(nv);
1965 }
1966
1967 return (error);
1968 }
1969
1970 /*
1971 * inputs:
1972 * zc_name name of filesystem
1973 * zc_nvlist_dst_size size of buffer for property nvlist
1974 *
1975 * outputs:
1976 * zc_objset_stats stats
1977 * zc_nvlist_dst property nvlist
1978 * zc_nvlist_dst_size size of property nvlist
1979 */
1980 static int
1981 zfs_ioc_objset_stats(zfs_cmd_t *zc)
|