From 889807e7c406cdaa42d16d3d3a91db25c69068ed Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Fri, 11 Jan 2002 14:19:04 +0000 Subject: [PATCH] Remove some redundant code. Move prototype for dm_do_snapshot into dm.h --- kernel/common/dm-origin.c | 27 +-------------------------- kernel/common/dm.h | 7 +++++-- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/kernel/common/dm-origin.c b/kernel/common/dm-origin.c index 92ee791..b7ad33e 100644 --- a/kernel/common/dm-origin.c +++ b/kernel/common/dm-origin.c @@ -18,9 +18,6 @@ #include "dm.h" -/* TODO: put in dm.h */ -extern int dm_do_snapshot(struct dm_dev *origin, struct buffer_head *bh); - /* * Origin: maps a linear range of a device, with hooks for snapshotting. */ @@ -28,30 +25,8 @@ struct origin_c { struct dm_dev *target_dev; }; -/* A list of origins and their dm-devs so we can translate between them - when attaching a snapshot */ -static LIST_HEAD(origin_devs); -struct origin_dev { - struct list_head *list; - struct dm_dev *dev; - struct origin_c *origin; -}; - - -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; -} - /* - * Construct a origin mapping: + * Construct an origin mapping: */ static int origin_ctr(struct dm_table *t, offset_t b, offset_t l, int argc, char **argv, void **context) diff --git a/kernel/common/dm.h b/kernel/common/dm.h index 9882269..4397a21 100644 --- a/kernel/common/dm.h +++ b/kernel/common/dm.h @@ -165,14 +165,17 @@ static inline offset_t *get_node(struct dm_table *t, int l, int n) } /* - * The device-mapper can be driven through one of two interfaces; + * The device-mapper can be driven through one of two interfaces; * ioctl or filesystem, depending which patch you have applied. */ int dm_interface_init(void); void dm_interface_exit(void); -/* +/* Code in dm-snapshot called by dm-origin to do snapshot COW */ +int dm_do_snapshot(struct dm_dev *origin, struct buffer_head *bh); + +/* * Targets for linear and striped mappings */ -- 2.43.5