kernels/linux-2.4.0/drivers/md/lvm.c
/*
 * character device support function VGDA extend
 */
character device support function VGDA extend
character device support function VGDA extend
static int lvm_do_vg_extend(vg_t *vg_ptr, void *arg)
{
	int ret = 0;
	uint p;
	pv_t *pv_ptr;
	if (vg_ptr == NULL) return -ENXIO;
	if (vg_ptr->pv_cur < vg_ptr->pv_max) {
		for (p = 0; p < vg_ptr->pv_max; p++) {
			if ( ( pv_ptr = vg_ptr->pv[p]) == NULL) {
				ret = lvm_do_pv_create(arg, vg_ptr, p);
				lvm_do_create_proc_entry_of_pv ( vg_ptr, pv_ptr);
				if ( ret != 0) return ret;
				pv_ptr->pe = NULL;
				vg_ptr->pv_cur++;
				vg_ptr->pv_act++;
				vg_ptr->pe_total +=
				    pv_ptr->pe_total;
#ifdef LVM_GET_INODE
				pv_ptr->inode = lvm_get_inode(pv_ptr->pv_dev);
#endif
				return 0;
			}
		}
	}
return -EPERM;
}
static int lvm_do_vg_extend ( vg_t * vg_ptr , void * arg ) { int ret = 0 ; uint p ; pv_t * pv_ptr ; if ( vg_ptr == NULL ) return - ENXIO ; if ( vg_ptr -> pv_cur < vg_ptr -> pv_max ) { for ( p = 0 ; p < vg_ptr -> pv_max ; p ++ ) { if ( ( pv_ptr = vg_ptr -> pv [ p ] ) == NULL ) { ret = lvm_do_pv_create ( arg , vg_ptr , p ) ; lvm_do_create_proc_entry_of_pv ( vg_ptr , pv_ptr ) ; if ( ret != 0 ) return ret ; pv_ptr -> pe = NULL ; vg_ptr -> pv_cur ++ ; vg_ptr -> pv_act ++ ; vg_ptr -> pe_total += pv_ptr -> pe_total ; #ifdef LVM_GET_INODE pv_ptr -> inode = lvm_get_inode ( pv_ptr -> pv_dev ) ; #endif return 0 ; } } } return - EPERM ; }
character device support function VGDA extend
character device support function VGDA extend
/* We don't need the PE list
				   in kernel space like LVs pe_t list */ /* insert a dummy inode for fs_may_mount */