2001-12-05 19:41:52 +03:00
/*
2004-03-30 23:08:57 +04:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
2007-08-21 20:26:07 +04:00
* Copyright ( C ) 2004 - 2006 Red Hat , Inc . All rights reserved .
2001-12-05 19:41:52 +03:00
*
2004-03-30 23:08:57 +04:00
* This file is part of the device - mapper userspace tools .
*
* 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 . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
2001-12-05 19:41:52 +03:00
*/
2002-11-14 17:44:42 +03:00
# ifndef LIB_DMTARGETS_H
# define LIB_DMTARGETS_H
2003-01-22 00:27:36 +03:00
# include <inttypes.h>
2005-01-06 01:00:40 +03:00
# include <sys/types.h>
2003-01-22 00:27:36 +03:00
struct dm_ioctl ;
struct dm_ioctl_v1 ;
2002-11-14 17:44:42 +03:00
2001-12-05 19:41:52 +03:00
struct target {
uint64_t start ;
uint64_t length ;
char * type ;
char * params ;
struct target * next ;
} ;
struct dm_task {
int type ;
char * dev_name ;
struct target * head , * tail ;
2002-01-03 13:39:21 +03:00
int read_only ;
2003-04-29 15:34:23 +04:00
uint32_t event_nr ;
2003-04-02 23:03:00 +04:00
int major ;
2002-01-11 15:12:46 +03:00
int minor ;
2009-06-18 00:55:24 +04:00
int allow_default_major_fallback ;
2005-01-06 01:00:40 +03:00
uid_t uid ;
gid_t gid ;
mode_t mode ;
2007-11-27 23:57:05 +03:00
uint32_t read_ahead ;
uint32_t read_ahead_flags ;
2003-01-22 00:27:36 +03:00
union {
2003-04-30 17:48:53 +04:00
struct dm_ioctl * v4 ;
2003-01-22 00:27:36 +03:00
struct dm_ioctl_v1 * v1 ;
} dmi ;
2002-01-11 02:29:16 +03:00
char * newname ;
2004-06-09 00:34:40 +04:00
char * message ;
2006-02-21 02:55:58 +03:00
char * geometry ;
2004-06-09 00:34:40 +04:00
uint64_t sector ;
2006-10-12 21:29:05 +04:00
int no_flush ;
2005-01-13 01:10:14 +03:00
int no_open_count ;
2005-10-05 00:12:32 +04:00
int skip_lockfs ;
2005-11-22 21:43:12 +03:00
int suppress_identical_reload ;
2008-09-18 22:34:53 +04:00
uint64_t existing_table_size ;
2009-08-03 22:01:45 +04:00
int cookie_set ;
2002-03-12 01:44:36 +03:00
char * uuid ;
2001-12-05 19:41:52 +03:00
} ;
2003-01-22 00:27:36 +03:00
struct cmd_data {
const char * name ;
const int cmd ;
const int version [ 3 ] ;
} ;
2002-11-14 17:44:42 +03:00
2003-01-22 00:27:36 +03:00
int dm_check_version ( void ) ;
2008-09-18 22:34:53 +04:00
uint64_t dm_task_get_existing_table_size ( struct dm_task * dmt ) ;
2003-01-22 00:27:36 +03:00
# endif