kernels/linux-2.4.0/drivers/md/lvm.c
/*
 * provide LV info for proc filesystem use (global)
 */
provide LV info for proc filesystem use (global)
provide LV info for proc filesystem use ( global )
int lvm_lv_info(vg_t *vg_ptr, lv_t *lv_ptr, char *buf) {
	int sz = 0;
	char inactive_flag = 'A', allocation_flag = ' ',
	     stripes_flag = ' ', rw_flag = ' ';
	if (!(lv_ptr->lv_status & LV_ACTIVE))
		inactive_flag = 'I';
	rw_flag = 'R';
	if (lv_ptr->lv_access & LV_WRITE)
		rw_flag = 'W';
	allocation_flag = 'D';
	if (lv_ptr->lv_allocation & LV_CONTIGUOUS)
		allocation_flag = 'C';
	stripes_flag = 'L';
	if (lv_ptr->lv_stripes > 1)
		stripes_flag = 'S';
	sz += sprintf(buf+sz,
		      "[%c%c%c%c",
		      inactive_flag,
	 rw_flag,
		      allocation_flag,
		      stripes_flag);
	if (lv_ptr->lv_stripes > 1)
		sz += sprintf(buf+sz, "%-2d",
			      lv_ptr->lv_stripes);
	else
		sz += sprintf(buf+sz, "  ");
	basename = strrchr(lv_ptr->lv_name, '/');
	if ( basename == 0) basename = lv_ptr->lv_name;
	else                basename++;
	sz += sprintf(buf+sz, "] %-25s", basename);
	if (strlen(basename) > 25)
		sz += sprintf(buf+sz,
			      "\n                              ");
	sz += sprintf(buf+sz, "%9d /%-6d   ",
		      lv_ptr->lv_size >> 1,
		      lv_ptr->lv_size / vg_ptr->pe_size);
	if (lv_ptr->lv_open == 0)
		sz += sprintf(buf+sz, "close");
	else
		sz += sprintf(buf+sz, "%dx open",
			      lv_ptr->lv_open);
	return sz;
}
int lvm_lv_info ( vg_t * vg_ptr , lv_t * lv_ptr , char * buf ) { int sz = 0 ; char inactive_flag = ' ' , allocation_flag = ' ' , stripes_flag = ' ' , rw_flag = ' ' ; if ( ! ( lv_ptr -> lv_status & LV_ACTIVE ) ) inactive_flag = ' ' ; rw_flag = ' ' ; if ( lv_ptr -> lv_access & LV_WRITE ) rw_flag = ' ' ; allocation_flag = ' ' ; if ( lv_ptr -> lv_allocation & LV_CONTIGUOUS ) allocation_flag = ' ' ; stripes_flag = ' ' ; if ( lv_ptr -> lv_stripes > 1 ) stripes_flag = ' ' ; sz += sprintf ( buf + sz , " " , inactive_flag , rw_flag , allocation_flag , stripes_flag ) ; if ( lv_ptr -> lv_stripes > 1 ) sz += sprintf ( buf + sz , " " , lv_ptr -> lv_stripes ) ; else sz += sprintf ( buf + sz , " " ) ; basename = strrchr ( lv_ptr -> lv_name , ' ' ) ; if ( basename == 0 ) basename = lv_ptr -> lv_name ; else basename ++ ; sz += sprintf ( buf + sz , " " , basename ) ; if ( strlen ( basename ) > 25 ) sz += sprintf ( buf + sz , " \n " ) ; sz += sprintf ( buf + sz , " " , lv_ptr -> lv_size >> 1 , lv_ptr -> lv_size / vg_ptr -> pe_size ) ; if ( lv_ptr -> lv_open == 0 ) sz += sprintf ( buf + sz , " " ) ; else sz += sprintf ( buf + sz , " " , lv_ptr -> lv_open ) ; return sz ; }
provide LV info for proc filesystem use (global)
provide LV info for proc filesystem use ( global )