mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
14ce9d49f1
Things to note: o Changes to the dm-*.c files have been kept as small as possible during the development of the new fs interface and there are a few places where the new code does odd things to give the original code what it wants. These places will gradually go away during the next few days once we are sure the new code is sound. o I've spent most of my testing time looking at the parser since thats where a lot of the changes are, I've not checked the actual I/O very much, but then that code hasn't changed at all. o The print operation in the target type operations is there to help in debugging and will go away eventually o There are some other printk's which will also go away once we are sure that things are working correctly. o I've tagged the old code with PRE_DMFS if you want to use that until this is stable. o There are no kernel patches for this yet (will fix after lunch... :-) o Makefile needs some changes o need to EXPORT_SYMBOL(deny_write_access); in ksyms.c How to use the new interface ? mount -t dmfs dmfs /mnt/dm cd /mnt/dm mkdir fish fish/tank cd fish/tank cat ~/my.table > table cd .. ln -s tank ACTIVE Creates a logical volume called fish and activates a table called tank, if there is a problem doing the link, look in /mnt/dm/fish/tank/errors to see what is wrong. If you see any odd things happening, let me know right away as I'm sure there'll be one or two things that slipped through my testing.
85 lines
1.8 KiB
C
85 lines
1.8 KiB
C
/*
|
|
* device-mapper.h
|
|
*
|
|
* Copyright (C) 2001 Sistina Software (UK) Limited.
|
|
*
|
|
* This file is released under the GPL.
|
|
*/
|
|
|
|
/*
|
|
* Changelog
|
|
*
|
|
* 14/08/2001 - First version [Joe Thornber]
|
|
*/
|
|
|
|
#ifndef DEVICE_MAPPER_H
|
|
#define DEVICE_MAPPER_H
|
|
|
|
#include <linux/major.h>
|
|
|
|
/* FIXME: Use value from local range for now, for co-existence with LVM 1 */
|
|
#define DM_BLK_MAJOR 124
|
|
|
|
struct dm_table;
|
|
struct dm_dev;
|
|
typedef unsigned int offset_t;
|
|
|
|
typedef void (*dm_error_fn)(const char *message, void *private);
|
|
|
|
/*
|
|
* constructor, destructor and map fn types
|
|
*/
|
|
typedef int (*dm_ctr_fn)(struct dm_table *t, offset_t b, offset_t l,
|
|
char *args, void **context);
|
|
|
|
typedef void (*dm_dtr_fn)(struct dm_table *t, void *c);
|
|
typedef int (*dm_map_fn)(struct buffer_head *bh, int rw, void *context);
|
|
typedef int (*dm_err_fn)(struct buffer_head *bh, int rw, void *context);
|
|
typedef char *(*dm_print_fn)(void *context);
|
|
|
|
/*
|
|
* Contructors should call this to make sure any
|
|
* destination devices are handled correctly
|
|
* (ie. opened/closed).
|
|
*/
|
|
int dm_table_get_device(struct dm_table *t, const char *path,
|
|
struct dm_dev **result);
|
|
void dm_table_put_device(struct dm_table *table, struct dm_dev *d);
|
|
|
|
/*
|
|
* information about a target type
|
|
*/
|
|
struct target_type {
|
|
const char *name;
|
|
struct module *module;
|
|
dm_ctr_fn ctr;
|
|
dm_dtr_fn dtr;
|
|
dm_map_fn map;
|
|
dm_err_fn err;
|
|
dm_print_fn print;
|
|
};
|
|
|
|
int dm_register_target(struct target_type *t);
|
|
int dm_unregister_target(struct target_type *t);
|
|
|
|
static inline char *next_token(char **p)
|
|
{
|
|
static const char *delim = " \t";
|
|
char *r;
|
|
|
|
do {
|
|
r = strsep(p, delim);
|
|
} while(r && *r == 0);
|
|
|
|
return r;
|
|
}
|
|
|
|
|
|
#endif /* DEVICE_MAPPER_H */
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-file-style: "linux"
|
|
* End:
|
|
*/
|