kernels/linux-2.4.0/drivers/md/lvm.c
/*
 * provide PV info for proc filesystem use (global)
 */
provide PV info for proc filesystem use (global)
provide PV info for proc filesystem use ( global )
int lvm_pv_info(pv_t *pv_ptr, char *buf) {
	int sz = 0;
	char inactive_flag = 'A', allocation_flag = ' ';
	char *pv_name = NULL;
	if (!(pv_ptr->pv_status & PV_ACTIVE))
		inactive_flag = 'I';
	allocation_flag = 'A';
	if (!(pv_ptr->pv_allocatable & PV_ALLOCATABLE))
		allocation_flag = 'N';
	pv_name = strrchr(pv_ptr->pv_name+1,'/');
	if ( pv_name == 0) pv_name = pv_ptr->pv_name;
	else               pv_name++;
	sz = sprintf(buf,
		     "[%c%c] %-21s %8d /%-6d  "
		     "%8d /%-6d  %8d /%-6d",
		     inactive_flag,
		     allocation_flag,
		     pv_name,
		     pv_ptr->pe_total *
		     pv_ptr->pe_size >> 1,
		     pv_ptr->pe_total,
		     pv_ptr->pe_allocated *
		     pv_ptr->pe_size >> 1,
		     pv_ptr->pe_allocated,
		     (pv_ptr->pe_total -
		      pv_ptr->pe_allocated) *
		     pv_ptr->pe_size >> 1,
		     pv_ptr->pe_total -
		     pv_ptr->pe_allocated);
	return sz;
}
int lvm_pv_info ( pv_t * pv_ptr , char * buf ) { int sz = 0 ; char inactive_flag = ' ' , allocation_flag = ' ' ; char * pv_name = NULL ; if ( ! ( pv_ptr -> pv_status & PV_ACTIVE ) ) inactive_flag = ' ' ; allocation_flag = ' ' ; if ( ! ( pv_ptr -> pv_allocatable & PV_ALLOCATABLE ) ) allocation_flag = ' ' ; pv_name = strrchr ( pv_ptr -> pv_name + 1 , ' ' ) ; if ( pv_name == 0 ) pv_name = pv_ptr -> pv_name ; else pv_name ++ ; sz = sprintf ( buf , " " " " , inactive_flag , allocation_flag , pv_name , pv_ptr -> pe_total * pv_ptr -> pe_size >> 1 , pv_ptr -> pe_total , pv_ptr -> pe_allocated * pv_ptr -> pe_size >> 1 , pv_ptr -> pe_allocated , ( pv_ptr -> pe_total - pv_ptr -> pe_allocated ) * pv_ptr -> pe_size >> 1 , pv_ptr -> pe_total - pv_ptr -> pe_allocated ) ; return sz ; }
provide PV info for proc filesystem use (global)
provide PV info for proc filesystem use ( global )