kernels/linux-2.4.0/drivers/md/lvm.c
/*
 * character device support function logical volume status by device number
 */
character device support function logical volume status by device number
character device support function logical volume status by device number
static int lvm_do_lv_status_bydev(vg_t * vg_ptr, void * arg) {
	int l;
	lv_status_bydev_req_t lv_status_bydev_req;
	if (vg_ptr == NULL) return -ENXIO;
	if (copy_from_user(&lv_status_bydev_req, arg,
			   sizeof(lv_status_bydev_req)) != 0)
		return -EFAULT;
	for ( l = 0; l < vg_ptr->lv_max; l++) {
		if ( vg_ptr->lv[l] == NULL) continue;
		if ( vg_ptr->lv[l]->lv_dev == lv_status_bydev_req.dev) break;
	}
	if ( l == vg_ptr->lv_max) return -ENXIO;
	if (copy_to_user(lv_status_bydev_req.lv,
			 vg_ptr->lv[l], sizeof(lv_t)) != 0)
		return -EFAULT;
	return 0;
}
static int lvm_do_lv_status_bydev ( vg_t * vg_ptr , void * arg ) { int l ; lv_status_bydev_req_t lv_status_bydev_req ; if ( vg_ptr == NULL ) return - ENXIO ; if ( copy_from_user ( & lv_status_bydev_req , arg , sizeof ( lv_status_bydev_req ) ) != 0 ) return - EFAULT ; for ( l = 0 ; l < vg_ptr -> lv_max ; l ++ ) { if ( vg_ptr -> lv [ l ] == NULL ) continue ; if ( vg_ptr -> lv [ l ] -> lv_dev == lv_status_bydev_req . dev ) break ; } if ( l == vg_ptr -> lv_max ) return - ENXIO ; if ( copy_to_user ( lv_status_bydev_req . lv , vg_ptr -> lv [ l ] , sizeof ( lv_t ) ) != 0 ) return - EFAULT ; return 0 ; }
character device support function logical volume status by device number
character device support function logical volume status by device number