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 ,
2016-01-21 13:49:46 +03:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 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
{
2024-08-14 14:07:25 +03:00
if ( arg_is_set ( cmd , refresh_ARG ) & & lv_is_visible ( lv ) ) {
2024-08-14 14:50:22 +03:00
if ( ! lv_refresh ( cmd , lv ) ) {
2024-08-14 15:20:55 +03:00
log_error ( " Refresh failed for %s. " , display_lvname ( lv ) ) ;
2013-07-01 13:27:22 +04:00
return_ECMD_FAILED ;
2024-08-14 14:50:22 +03:00
}
2024-10-30 13:40:30 +03:00
if ( ! sync_local_dev_names ( cmd ) )
stack ;
2024-08-14 14:07:25 +03:00
}
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 )
{
2024-08-14 14:53:17 +03:00
if ( ! dm_udev_get_sync_support ( ) ) {
if ( ! lv_mknodes ( cmd , NULL ) )
return_ECMD_FAILED ;
}
2004-03-30 18:40:03 +04:00
2016-11-29 21:00:15 +03:00
return process_each_lv ( cmd , argc , argv , NULL , NULL , LCK_VG_READ , NULL , NULL , & _vgmknodes_single ) ;
2003-11-12 22:16:48 +03:00
}