sys/dev/disk/dm/targets/striped/dm_target_striped.c
static char *
dm_target_stripe_status(void *target_config)
{
	dm_target_stripe_config_t *tsc;
	char *params;
	char *ptr;
	size_t len;
	size_t nlen;
	int n;

	tsc = target_config;

	/* caller expects use of M_DM for returned params */
	nlen = DM_MAX_PARAMS_SIZE;
	params = kmalloc(nlen, M_DM, M_WAITOK);
	ptr = params;

	ksnprintf(ptr, nlen, "%d %jd",
		  tsc->stripe_num, (intmax_t)tsc->stripe_chunksize);
	len = strlen(params);
	ptr += len;
	nlen -= len;

	for (n = 0; n < tsc->stripe_num; ++n) {
		ksnprintf(ptr, nlen, " %s %jd",
			  tsc->stripe_devs[n].pdev->name,
			  (intmax_t)tsc->stripe_devs[n].offset);
		len = strlen(ptr);
		ptr += len;
		nlen -= len;
	}

	return params;
}
/*
 * Status routine called to get params string.
 */
Status routine called to get params string.
Status routine called to get params string .
static char *
dm_target_stripe_status(void *target_config)
{
	dm_target_stripe_config_t *tsc;
	char *params;
	char *ptr;
	size_t len;
	size_t nlen;
	int n;
	tsc = target_config;
	nlen = DM_MAX_PARAMS_SIZE;
	params = kmalloc(nlen, M_DM, M_WAITOK);
	ptr = params;
	ksnprintf(ptr, nlen, "%d %jd",
		  tsc->stripe_num, (intmax_t)tsc->stripe_chunksize);
	len = strlen(params);
	ptr += len;
	nlen -= len;
	for (n = 0; n < tsc->stripe_num; ++n) {
		ksnprintf(ptr, nlen, " %s %jd",
			  tsc->stripe_devs[n].pdev->name,
			  (intmax_t)tsc->stripe_devs[n].offset);
		len = strlen(ptr);
		ptr += len;
		nlen -= len;
	}
	return params;
}
static char * dm_target_stripe_status ( void * target_config ) { dm_target_stripe_config_t * tsc ; char * params ; char * ptr ; size_t len ; size_t nlen ; int n ; tsc = target_config ; nlen = DM_MAX_PARAMS_SIZE ; params = kmalloc ( nlen , M_DM , M_WAITOK ) ; ptr = params ; ksnprintf ( ptr , nlen , " " , tsc -> stripe_num , ( intmax_t ) tsc -> stripe_chunksize ) ; len = strlen ( params ) ; ptr += len ; nlen -= len ; for ( n = 0 ; n < tsc -> stripe_num ; ++ n ) { ksnprintf ( ptr , nlen , " " , tsc -> stripe_devs [ n ] . pdev -> name , ( intmax_t ) tsc -> stripe_devs [ n ] . offset ) ; len = strlen ( ptr ) ; ptr += len ; nlen -= len ; } return params ; }
Status routine called to get params string.
Status routine called to get params string .
/* caller expects use of M_DM for returned params */