From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 2/7][retry remove] Add "--retry" option to dmsetup to enable "retry remove" logic
Date: Tue, 20 Sep 2011 14:56:08 +0200 [thread overview]
Message-ID: <4E788D68.2050705@redhat.com> (raw)
tools/dmsetup.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index fbdbc6a..f35c8a5 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -140,6 +140,7 @@ enum {
NOUDEVSYNC_ARG,
OPTIONS_ARG,
READAHEAD_ARG,
+ RETRY_ARG,
ROWS_ARG,
SEPARATOR_ARG,
SETUUID_ARG,
@@ -1279,6 +1280,9 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display)
if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, udev_flags))
goto out;
+ if (_switches[RETRY_ARG] && task == DM_DEVICE_REMOVE)
+ dm_task_retry_remove(dmt);
+
r = dm_task_run(dmt);
out:
@@ -2805,7 +2809,7 @@ static void _usage(FILE *out)
" [--checks] [-v|--verbose [-v|--verbose ...]]\n"
" [-r|--readonly] [--noopencount] [--nolockfs] [--inactive]\n"
" [--udevcookie [cookie]] [--noudevrules] [--noudevsync] [--verifyudev]\n"
- " [-y|--yes] [--readahead [+]<sectors>|auto|none]\n"
+ " [-y|--yes] [--readahead [+]<sectors>|auto|none] [--retry]\n"
" [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]\n"
" [--nameprefixes] [--noheadings] [--separator <separator>]\n\n");
for (i = 0; _commands[i].name; i++)
@@ -3178,6 +3182,7 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
{"noudevsync", 0, &ind, NOUDEVSYNC_ARG},
{"options", 1, &ind, OPTIONS_ARG},
{"readahead", 1, &ind, READAHEAD_ARG},
+ {"retry", 0, &ind, RETRY_ARG},
{"rows", 0, &ind, ROWS_ARG},
{"separator", 1, &ind, SEPARATOR_ARG},
{"setuuid", 0, &ind, SETUUID_ARG},
@@ -3362,6 +3367,8 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
}
}
}
+ if ((ind == RETRY_ARG))
+ _switches[RETRY_ARG]++;
if ((ind == ROWS_ARG))
_switches[ROWS_ARG]++;
if ((ind == SETUUID_ARG))
reply other threads:[~2011-09-20 12:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E788D68.2050705@redhat.com \
--to=prajnoha@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.