2003-11-12 22:16:48 +03:00
/*
2008-01-30 17:00:02 +03:00
* Copyright ( C ) 2003 - 2004 Sistina Software , Inc . All rights reserved .
2007-08-21 00:55:30 +04:00
* Copyright ( C ) 2004 - 2006 Red Hat , Inc . All rights reserved .
2003-11-12 22:16:48 +03:00
*
2004-03-30 23:35:44 +04:00
* This file is part of LVM2 .
2003-11-12 22:16:48 +03:00
*
2004-03-30 23:35:44 +04: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-21 00:55:30 +04:00
* of the GNU Lesser General Public License v .2 .1 .
2003-11-12 22:16:48 +03:00
*
2007-08-21 00:55:30 +04:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 23:35:44 +04: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 22:16:48 +03:00
*/
# include "tools.h"
static int _vgmknodes_single ( struct cmd_context * cmd , struct logical_volume * lv ,
2014-11-27 17:02:13 +03:00
struct processing_handle * handle __attribute__ ( ( unused ) ) )
2003-11-12 22:16:48 +03:00
{
2008-12-22 12:00:51 +03:00
if ( arg_count ( cmd , refresh_ARG ) & & lv_is_visible ( lv ) )
2013-07-01 13:27:22 +04:00
if ( ! lv_refresh ( cmd , lv ) )
return_ECMD_FAILED ;
2008-12-22 12:00:51 +03:00
2013-07-01 13:27:22 +04:00
if ( ! lv_mknodes ( cmd , lv ) )
return_ECMD_FAILED ;
2003-11-12 22:16:48 +03:00
return ECMD_PROCESSED ;
}
int vgmknodes ( struct cmd_context * cmd , int argc , char * * argv )
{
2013-07-01 13:27:22 +04:00
if ( ! lv_mknodes ( cmd , NULL ) )
return_ECMD_FAILED ;
2004-03-30 18:40:03 +04:00
2008-12-22 12:00:51 +03:00
return process_each_lv ( cmd , argc , argv , LCK_VG_READ , NULL ,
2004-03-30 18:40:03 +04:00
& _vgmknodes_single ) ;
2003-11-12 22:16:48 +03:00
}