From a299e38810d6618c742444ac278a3f6ae75c3917 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 4 Dec 2001 23:20:27 +0000 Subject: [PATCH] Added more log messages. --- lib/activate/activate.c | 12 ++++++++++++ lib/activate/fs.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index e23f658af..d4eec0e00 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -36,6 +36,7 @@ int lv_info(struct logical_volume *lv, struct dm_info *info) int r = 0; struct dm_task *dmt; + log_very_verbose("Getting device info for %s", lv->name); if (!(dmt = _setup_task(lv, DM_DEVICE_INFO))) { stack; return 0; @@ -67,6 +68,7 @@ int lv_active(struct logical_volume *lv) return r; } + log_very_verbose("%s is%s active", lv->name, info.exists ? "":" not"); return info.exists; } @@ -80,6 +82,7 @@ int lv_open_count(struct logical_volume *lv) return r; } + log_very_verbose("%s is open %d time(s)", lv->name, info.open_count); return info.open_count; } @@ -121,6 +124,11 @@ static int _emit_target(struct dm_task *dmt, struct stripe_segment *seg) } } + log_debug("Adding target: %" PRIu64 " %" PRIu64 " %s %s", + esize * seg->le, esize * seg->len, + stripes == 1 ? "linear" : "striped", + params); + if (!dm_task_add_target(dmt, esize * seg->le, esize * seg->len, stripes == 1 ? "linear" : "striped", params)) { @@ -138,6 +146,7 @@ int _load(struct logical_volume *lv, int task) struct list *segh; struct stripe_segment *seg; + log_very_verbose("Generating devmapper parameters for %s", lv->name); if (!(dmt = _setup_task(lv, task))) { stack; return 0; @@ -168,6 +177,7 @@ int lv_activate(struct logical_volume *lv) if (test_mode()) return 0; + log_very_verbose("Activating %s", lv->name); return _load(lv, DM_DEVICE_CREATE) && fs_add_lv(lv); } @@ -177,6 +187,7 @@ int _suspend(struct logical_volume *lv, int sus) struct dm_task *dmt; int task = sus ? DM_DEVICE_SUSPEND : DM_DEVICE_RESUME; + log_very_verbose("%s %s", sus ? "Suspending" : "Resuming", lv->name); if (!(dmt = _setup_task(lv, task))) { stack; return 0; @@ -217,6 +228,7 @@ int lv_deactivate(struct logical_volume *lv) int r; struct dm_task *dmt; + log_very_verbose("Deactivating %s", lv->name); if (test_mode()) return 0; diff --git a/lib/activate/fs.c b/lib/activate/fs.c index 8b8e9a3fd..795c22d61 100644 --- a/lib/activate/fs.c +++ b/lib/activate/fs.c @@ -43,6 +43,8 @@ static void _mk_dir(struct volume_group *vg) char vg_path[PATH_MAX]; _build_vg_path(vg_path, sizeof(vg_path), vg); + + log_very_verbose("Creating directory %s", vg_path); mkdir(vg_path, 0555); } @@ -51,6 +53,8 @@ static void _rm_dir(struct volume_group *vg) char vg_path[PATH_MAX]; _build_vg_path(vg_path, sizeof(vg_path), vg); + + log_very_verbose("Removing directory %s", vg_path); rmdir(vg_path); } @@ -61,6 +65,7 @@ static int _mk_link(struct logical_volume *lv) _build_lv_path(lv_path, sizeof(lv_path), lv); _build_link_path(link_path, sizeof(link_path), lv); + log_very_verbose("Linking %s to %s", link_path, lv_path); if (symlink(lv_path, link_path) < 0) { log_sys_error("symlink", link_path); return 0; @@ -75,6 +80,7 @@ static int _rm_link(struct logical_volume *lv) _build_link_path(link_path, sizeof(link_path), lv); + log_very_verbose("Removing link %s", link_path); if (unlink(link_path) < 0) { log_sys_error("unlink", link_path); return 0; -- 2.43.5