2003-11-12 19:16:48 +00:00
/*
2008-01-30 14:00:02 +00:00
* Copyright ( C ) 2003 - 2004 Sistina Software , Inc . All rights reserved .
2007-08-20 20:55:30 +00:00
* Copyright ( C ) 2004 - 2006 Red Hat , Inc . All rights reserved .
2003-11-12 19:16:48 +00:00
*
2004-03-30 19:35:44 +00:00
* This file is part of LVM2 .
2003-11-12 19:16:48 +00:00
*
2004-03-30 19:35:44 +00:00
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
2007-08-20 20:55:30 +00:00
* of the GNU Lesser General Public License v .2 .1 .
2003-11-12 19:16:48 +00:00
*
2007-08-20 20:55:30 +00:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 19:35:44 +00:00
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2003-11-12 19:16:48 +00:00
*/
# include "tools.h"
static int _vgmknodes_single ( struct cmd_context * cmd , struct logical_volume * lv ,
2006-05-09 21:23:51 +00:00
void * handle __attribute ( ( unused ) ) )
2003-11-12 19:16:48 +00:00
{
2008-12-22 09:00:51 +00:00
if ( arg_count ( cmd , refresh_ARG ) & & lv_is_visible ( lv ) )
2009-09-14 22:47:49 +00:00
if ( ! lv_refresh ( cmd , lv ) ) {
stack ;
2008-12-22 09:00:51 +00:00
return ECMD_FAILED ;
2009-09-14 22:47:49 +00:00
}
2008-12-22 09:00:51 +00:00
2009-09-14 22:47:49 +00:00
if ( ! lv_mknodes ( cmd , lv ) ) {
stack ;
2003-11-12 19:16:48 +00:00
return ECMD_FAILED ;
2009-09-14 22:47:49 +00:00
}
2003-11-12 19:16:48 +00:00
return ECMD_PROCESSED ;
}
int vgmknodes ( struct cmd_context * cmd , int argc , char * * argv )
{
2009-09-14 22:47:49 +00:00
if ( ! lv_mknodes ( cmd , NULL ) ) {
stack ;
2008-12-22 09:00:51 +00:00
return ECMD_FAILED ;
2009-09-14 22:47:49 +00:00
}
2004-03-30 14:40:03 +00:00
2008-12-22 09:00:51 +00:00
return process_each_lv ( cmd , argc , argv , LCK_VG_READ , NULL ,
2004-03-30 14:40:03 +00:00
& _vgmknodes_single ) ;
2003-11-12 19:16:48 +00:00
}