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 ,
2016-01-21 11:49:46 +01:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
2003-11-12 19:16:48 +00:00
*/
# include "tools.h"
static int _vgmknodes_single ( struct cmd_context * cmd , struct logical_volume * lv ,
2014-11-27 15:02:13 +01:00
struct processing_handle * handle __attribute__ ( ( unused ) ) )
2003-11-12 19:16:48 +00:00
{
2016-06-21 22:24:52 +01:00
if ( arg_is_set ( cmd , refresh_ARG ) & & lv_is_visible ( lv ) )
2013-07-01 11:27:22 +02:00
if ( ! lv_refresh ( cmd , lv ) )
return_ECMD_FAILED ;
2008-12-22 09:00:51 +00:00
2013-07-01 11:27:22 +02:00
if ( ! lv_mknodes ( cmd , lv ) )
return_ECMD_FAILED ;
2003-11-12 19:16:48 +00:00
return ECMD_PROCESSED ;
}
int vgmknodes ( struct cmd_context * cmd , int argc , char * * argv )
{
2013-07-01 11:27:22 +02:00
if ( ! lv_mknodes ( cmd , NULL ) )
return_ECMD_FAILED ;
2004-03-30 14:40:03 +00:00
2016-05-23 13:42:17 -05:00
return process_each_lv ( cmd , argc , argv , NULL , NULL , LCK_VG_READ , NULL , & _vgmknodes_single ) ;
2003-11-12 19:16:48 +00:00
}