linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "heming.zhao@suse.com" <heming.zhao@suse.com>
To: linux-lvm@redhat.com
Cc: teigland@sourceware.org, zkabelac@redhat.com
Subject: Re: [linux-lvm] [PATCH] lvs: add -o lv_usable
Date: Sat, 5 Sep 2020 17:17:11 +0800	[thread overview]
Message-ID: <87c506c3-45aa-e279-6bc1-2597072c062e@suse.com> (raw)
In-Reply-To: <1599296786-27353-1-git-send-email-heming.zhao@suse.com>



On 9/5/20 5:06 PM, Zhao Heming wrote:
> report LV is usable for upper layer.
> 
> Signed-off-by: Zhao Heming <heming.zhao@suse.com>
> ---
>   lib/activate/activate.h          |   2 +
>   lib/activate/dev_manager.c       |  67 ++++++++++++++++
>   lib/metadata/metadata-exported.h |   1 +
>   lib/metadata/metadata.c          | 130 +++++++++++++++++++++++++++++++
>   lib/report/columns.h             |   1 +
>   lib/report/properties.c          |   2 +
>   lib/report/report.c              |  13 ++++
>   lib/report/values.h              |   1 +
>   8 files changed, 217 insertions(+)
> 

There are some places need to improve.

1. in lib/activate/dev_manager.c, function lv_mapping_table() & dm_has_lvdev() almost same.
   it may merge into one function.

2. LV device-mapper name need to improve, 

  in lib/metadata/metadata.c  _lv_is_usable()
  I use below ugly code to construct dm name

  ```
  /* format is right: "vgname" + '-' + "lvname" ?? */
  snprintf(lvname, 50, "%s-%s", lv->vg->name, seg_lv(seg, s)->name);
  ... ...
  /* format is right: "vgname" + '-' + "lvname" ?? */
  snprintf(lvname, 50, "%s-%s", lv->vg->name, lv->name);
  ```


Thanks

      parent reply	other threads:[~2020-09-05  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  9:06 [linux-lvm] [PATCH] lvs: add -o lv_usable Zhao Heming
2020-09-05  9:08 ` heming.zhao
2020-09-07 14:32   ` Zdenek Kabelac
2020-09-08  6:40     ` heming.zhao
2020-09-08 17:47       ` David Teigland
2020-09-05  9:17 ` heming.zhao [this message]

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=87c506c3-45aa-e279-6bc1-2597072c062e@suse.com \
    --to=heming.zhao@suse.com \
    --cc=linux-lvm@redhat.com \
    --cc=teigland@sourceware.org \
    --cc=zkabelac@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).