kernels/linux-2.4.0/drivers/md/lvm.c
/*
 * character device support function get physical volume status
 */
character device support function get physical volume status
character device support function get physical volume status
static int lvm_do_pv_status(vg_t *vg_ptr, void *arg)
{
	uint p;
	pv_t *pv_ptr;
	if (vg_ptr == NULL) return -ENXIO;
	if (copy_from_user(&pv_status_req, arg,
			   sizeof(pv_status_req)) != 0)
		return -EFAULT;
	for (p = 0; p < vg_ptr->pv_max; p++) {
		pv_ptr = vg_ptr->pv[p];
		if (pv_ptr != NULL &&
		    strcmp(pv_ptr->pv_name,
			       pv_status_req.pv_name) == 0) {
			if (copy_to_user(pv_status_req.pv,
					 pv_ptr,
				         sizeof(pv_t)) != 0)
				return -EFAULT;
			return 0;
		}
	}
	return -ENXIO;
}
static int lvm_do_pv_status ( vg_t * vg_ptr , void * arg ) { uint p ; pv_t * pv_ptr ; if ( vg_ptr == NULL ) return - ENXIO ; if ( copy_from_user ( & pv_status_req , arg , sizeof ( pv_status_req ) ) != 0 ) return - EFAULT ; for ( p = 0 ; p < vg_ptr -> pv_max ; p ++ ) { pv_ptr = vg_ptr -> pv [ p ] ; if ( pv_ptr != NULL && strcmp ( pv_ptr -> pv_name , pv_status_req . pv_name ) == 0 ) { if ( copy_to_user ( pv_status_req . pv , pv_ptr , sizeof ( pv_t ) ) != 0 ) return - EFAULT ; return 0 ; } } return - ENXIO ; }
character device support function get physical volume status
character device support function get physical volume status