1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add dmsetup --nolockfs support for suspend/reload.

Requires kernel patches to have any effect.
Library version incremented.
This commit is contained in:
Alasdair Kergon 2005-10-04 20:12:32 +00:00
parent 9b02bdbce0
commit 72a444276f
6 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 1.01.06 - Version 1.01.06 -
============================= =============================
Add dmsetup --nolockfs support for suspend/reload.
Version 1.01.05 - 26 Sep 2005 Version 1.01.05 - 26 Sep 2005
============================= =============================

View File

@ -21,6 +21,7 @@ dm_task_set_sector
dm_task_set_message dm_task_set_message
dm_task_add_target dm_task_add_target
dm_task_no_open_count dm_task_no_open_count
dm_task_skip_lockfs
dm_get_next_target dm_get_next_target
dm_task_run dm_task_run
dm_set_dev_dir dm_set_dev_dir

View File

@ -950,6 +950,13 @@ int dm_task_no_open_count(struct dm_task *dmt)
return 1; return 1;
} }
int dm_task_skip_lockfs(struct dm_task *dmt)
{
dmt->skip_lockfs = 1;
return 1;
}
int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr) int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr)
{ {
dmt->event_nr = event_nr; dmt->event_nr = event_nr;
@ -1105,6 +1112,8 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
dmi->flags |= DM_SUSPEND_FLAG; dmi->flags |= DM_SUSPEND_FLAG;
if (dmt->read_only) if (dmt->read_only)
dmi->flags |= DM_READONLY_FLAG; dmi->flags |= DM_READONLY_FLAG;
if (dmt->skip_lockfs)
dmi->flags |= DM_SKIP_LOCKFS_FLAG;
if (dmt->minor >= 0) { if (dmt->minor >= 0) {
if (dmt->major <= 0) { if (dmt->major <= 0) {

View File

@ -52,6 +52,7 @@ struct dm_task {
char *message; char *message;
uint64_t sector; uint64_t sector;
int no_open_count; int no_open_count;
int skip_lockfs;
char *uuid; char *uuid;
}; };

View File

@ -135,6 +135,7 @@ int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr);
int dm_task_set_message(struct dm_task *dmt, const char *message); int dm_task_set_message(struct dm_task *dmt, const char *message);
int dm_task_set_sector(struct dm_task *dmt, uint64_t sector); int dm_task_set_sector(struct dm_task *dmt, uint64_t sector);
int dm_task_no_open_count(struct dm_task *dmt); int dm_task_no_open_count(struct dm_task *dmt);
int dm_task_skip_lockfs(struct dm_task *dmt);
/* /*
* Use these to prepare for a create or reload. * Use these to prepare for a create or reload.

View File

@ -76,6 +76,7 @@ enum {
MAJOR_ARG, MAJOR_ARG,
MINOR_ARG, MINOR_ARG,
NOHEADINGS_ARG, NOHEADINGS_ARG,
NOLOCKFS_ARG,
NOOPENCOUNT_ARG, NOOPENCOUNT_ARG,
NOTABLE_ARG, NOTABLE_ARG,
OPTIONS_ARG, OPTIONS_ARG,
@ -527,6 +528,9 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display)
if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt))
goto out; goto out;
if (_switches[NOLOCKFS_ARG] && !dm_task_skip_lockfs(dmt))
goto out;
r = dm_task_run(dmt); r = dm_task_run(dmt);
if (r && display && _switches[VERBOSE_ARG]) if (r && display && _switches[VERBOSE_ARG])
@ -1000,7 +1004,7 @@ static void _usage(FILE *out)
fprintf(out, "Usage:\n\n"); fprintf(out, "Usage:\n\n");
fprintf(out, "dmsetup [--version] [-v|--verbose [-v|--verbose ...]]\n" fprintf(out, "dmsetup [--version] [-v|--verbose [-v|--verbose ...]]\n"
" [-r|--readonly] [--noopencount]\n\n"); " [-r|--readonly] [--noopencount] [--nolockfs]\n\n");
for (i = 0; _commands[i].name; i++) for (i = 0; _commands[i].name; i++)
fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help); fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help);
fprintf(out, "\n<device> may be device name or -u <uuid> or " fprintf(out, "\n<device> may be device name or -u <uuid> or "
@ -1034,6 +1038,7 @@ static int _process_switches(int *argc, char ***argv)
{"major", 1, &ind, MAJOR_ARG}, {"major", 1, &ind, MAJOR_ARG},
{"minor", 1, &ind, MINOR_ARG}, {"minor", 1, &ind, MINOR_ARG},
{"noheadings", 0, &ind, NOHEADINGS_ARG}, {"noheadings", 0, &ind, NOHEADINGS_ARG},
{"nolockfs", 0, &ind, NOLOCKFS_ARG},
{"noopencount", 0, &ind, NOOPENCOUNT_ARG}, {"noopencount", 0, &ind, NOOPENCOUNT_ARG},
{"notable", 0, &ind, NOTABLE_ARG}, {"notable", 0, &ind, NOTABLE_ARG},
{"options", 1, &ind, OPTIONS_ARG}, {"options", 1, &ind, OPTIONS_ARG},
@ -1125,6 +1130,8 @@ static int _process_switches(int *argc, char ***argv)
} }
if ((ind == NOHEADINGS_ARG)) if ((ind == NOHEADINGS_ARG))
_switches[NOHEADINGS_ARG]++; _switches[NOHEADINGS_ARG]++;
if ((ind == NOLOCKFS_ARG))
_switches[NOLOCKFS_ARG]++;
if ((ind == NOOPENCOUNT_ARG)) if ((ind == NOOPENCOUNT_ARG))
_switches[NOOPENCOUNT_ARG]++; _switches[NOOPENCOUNT_ARG]++;
if ((ind == VERSION_ARG)) if ((ind == VERSION_ARG))