mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
73 lines
1.8 KiB
C
73 lines
1.8 KiB
C
/*
|
|
* device-mapper.h
|
|
*
|
|
* Copyright (C) 2001 Sistina Software
|
|
*
|
|
* This software is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2, or (at
|
|
* your option) any later version.
|
|
*
|
|
* This software is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with GNU CC; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
/*
|
|
* Changelog
|
|
*
|
|
* 14/08/2001 - First version [Joe Thornber]
|
|
*/
|
|
|
|
#ifndef DEVICE_MAPPER_H
|
|
#define DEVICE_MAPPER_H
|
|
|
|
#include <linux/major.h>
|
|
|
|
/* FIXME: steal LVM's devices for now */
|
|
#define DM_BLK_MAJOR LVM_BLK_MAJOR
|
|
#define DM_CTL_MAJOR LVM_CHAR_MAJOR
|
|
|
|
typedef unsigned int offset_t;
|
|
|
|
struct device_map {
|
|
offset_t high;
|
|
const char *type;
|
|
const char *context;
|
|
};
|
|
|
|
struct device_table {
|
|
unsigned int minor;
|
|
unsigned int major;
|
|
|
|
unsigned long count;
|
|
struct device_map *map;
|
|
};
|
|
|
|
#define MAPPED_DEVICE_CREATE _IOWR(DM_CTL_MAJOR, 0, struct device_table)
|
|
#define MAPPED_DEVICE_DESTROY _IOW(DM_CTL_MAJOR, 1, struct device_table)
|
|
|
|
#ifdef __KERNEL__
|
|
typedef int (*dm_ctr_fn)(offset_t b, offset_t e,
|
|
const char *context, void **result);
|
|
typedef void (*dm_dtr_fn)(void *c);
|
|
typedef int (*dm_map_fn)(struct buffer_head *bh, void *context);
|
|
|
|
int register_mapping_type(const char *name, dm_ctr_fn ctr, dm_dtr_fn dtr,
|
|
dm_map_fn map);
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-file-style: "linux"
|
|
* End:
|
|
*/
|