2021-11-04 00:02:38 +03:00
/*
* Copyright ( C ) 2021 Red Hat , Inc . All rights reserved .
*
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v .2 .1 .
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
*/
# ifndef _ONLINE_H
# define _ONLINE_H
2021-11-05 20:19:35 +03:00
struct pv_online {
struct dm_list list ;
struct device * dev ;
dev_t devno ;
char pvid [ ID_LEN + 1 ] ;
char vgname [ NAME_LEN ] ;
2021-11-09 01:02:48 +03:00
char devname [ NAME_LEN ] ;
2021-11-05 20:19:35 +03:00
} ;
2021-11-04 00:02:38 +03:00
/*
* Avoid a duplicate pvscan [ % d ] prefix when logging to the journal .
* FIXME : this should probably replace if ( udevoutput ) with
* if ( log_journal & LOG_JOURNAL_OUTPUT )
*/
# define log_print_pvscan(cmd, fmt, args...) \
do \
if ( cmd - > udevoutput ) \
2023-04-26 15:40:11 +03:00
log_print_unless_silent ( fmt , # # args ) ; \
2021-11-04 00:02:38 +03:00
else \
2023-04-26 15:40:11 +03:00
log_print_unless_silent ( " pvscan[%d] " fmt , getpid ( ) , # # args ) ; \
2021-11-04 00:02:38 +03:00
while ( 0 )
# define log_error_pvscan(cmd, fmt, args...) \
do \
if ( cmd - > udevoutput ) \
log_error ( fmt , # # args ) ; \
else \
log_error ( " pvscan[%d] " fmt , getpid ( ) , # # args ) ; \
while ( 0 )
2024-05-28 17:17:53 +03:00
int online_pvid_file_read ( char * path , unsigned * major , unsigned * minor , char * vgname , char * devname ) ;
2021-11-04 00:02:38 +03:00
int online_vg_file_create ( struct cmd_context * cmd , const char * vgname ) ;
void online_vg_file_remove ( const char * vgname ) ;
int online_pvid_file_create ( struct cmd_context * cmd , struct device * dev , const char * vgname ) ;
int online_pvid_file_exists ( const char * pvid ) ;
void online_dir_setup ( struct cmd_context * cmd ) ;
2021-11-05 20:19:35 +03:00
int get_pvs_online ( struct dm_list * pvs_online , const char * vgname ) ;
int get_pvs_lookup ( struct dm_list * pvs_online , const char * vgname ) ;
void free_po_list ( struct dm_list * list ) ;
2022-09-14 17:13:58 +03:00
void online_lookup_file_remove ( const char * vgname ) ;
void online_vgremove ( struct volume_group * vg ) ;
2021-11-04 00:02:38 +03:00
# endif