git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
md
/
dm-table.c
diff --git
a/drivers/md/dm-table.c
b/drivers/md/dm-table.c
index
a6c2484
..
3ef2ad4
100644
(file)
--- a/
drivers/md/dm-table.c
+++ b/
drivers/md/dm-table.c
@@
-1,5
+1,6
@@
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
+ * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
*
* This file is released under the GPL.
*/
*
* This file is released under the GPL.
*/
@@
-57,7
+58,7
@@
struct dm_table {
/*
* Similar to ceiling(log_size(n))
*/
/*
* Similar to ceiling(log_size(n))
*/
-static unsigned int int_log(unsigned
long n, unsigned long
base)
+static unsigned int int_log(unsigned
int n, unsigned int
base)
{
int result = 0;
{
int result = 0;
@@
-575,7
+576,7
@@
static char **realloc_argv(unsigned *array_size, char **old_argv)
/*
* Destructively splits up the argument list to pass to ctr.
*/
/*
* Destructively splits up the argument list to pass to ctr.
*/
-
static int
split_args(int *argc, char ***argvp, char *input)
+
int dm_
split_args(int *argc, char ***argvp, char *input)
{
char *start, *end = input, *out, **argv = NULL;
unsigned array_size = 0;
{
char *start, *end = input, *out, **argv = NULL;
unsigned array_size = 0;
@@
-663,14
+664,14
@@
int dm_table_add_target(struct dm_table *t, const char *type,
if (!len) {
tgt->error = "zero-length target";
if (!len) {
tgt->error = "zero-length target";
- DMERR("
: %s\n
", tgt->error);
+ DMERR("
%s
", tgt->error);
return -EINVAL;
}
tgt->type = dm_get_target_type(type);
if (!tgt->type) {
tgt->error = "unknown target type";
return -EINVAL;
}
tgt->type = dm_get_target_type(type);
if (!tgt->type) {
tgt->error = "unknown target type";
- DMERR("
: %s\n
", tgt->error);
+ DMERR("
%s
", tgt->error);
return -EINVAL;
}
return -EINVAL;
}
@@
-688,7
+689,7
@@
int dm_table_add_target(struct dm_table *t, const char *type,
goto bad;
}
goto bad;
}
- r = split_args(&argc, &argv, params);
+ r =
dm_
split_args(&argc, &argv, params);
if (r) {
tgt->error = "couldn't split parameters (insufficient memory)";
goto bad;
if (r) {
tgt->error = "couldn't split parameters (insufficient memory)";
goto bad;
@@
-707,7
+708,7
@@
int dm_table_add_target(struct dm_table *t, const char *type,
return 0;
bad:
return 0;
bad:
- DMERR("
: %s\n
", tgt->error);
+ DMERR("
%s
", tgt->error);
dm_put_target_type(tgt->type);
return r;
}
dm_put_target_type(tgt->type);
return r;
}
@@
-848,18
+849,32
@@
int dm_table_get_mode(struct dm_table *t)
return t->mode;
}
return t->mode;
}
-
void dm_table_suspend_targets(struct dm_table *t
)
+
static void suspend_targets(struct dm_table *t, unsigned postsuspend
)
{
{
- int i;
+ int i = t->num_targets;
+ struct dm_target *ti = t->targets;
- for (i = 0; i < t->num_targets; i++) {
- struct dm_target *ti = t->targets + i;
+ while (i--) {
+ if (postsuspend) {
+ if (ti->type->postsuspend)
+ ti->type->postsuspend(ti);
+ } else if (ti->type->presuspend)
+ ti->type->presuspend(ti);
- if (ti->type->suspend)
- ti->type->suspend(ti);
+ ti++;
}
}
}
}
+void dm_table_presuspend_targets(struct dm_table *t)
+{
+ return suspend_targets(t, 0);
+}
+
+void dm_table_postsuspend_targets(struct dm_table *t)
+{
+ return suspend_targets(t, 1);
+}
+
void dm_table_resume_targets(struct dm_table *t)
{
int i;
void dm_table_resume_targets(struct dm_table *t)
{
int i;