linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: yue <ooolinux@163.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] what is writed on raw disk,
Date: Mon, 13 Sep 2010 11:48:21 +0200	[thread overview]
Message-ID: <4C8DF365.3020804@redhat.com> (raw)
In-Reply-To: <4f6023.1288b.12afc599754.Coremail.ooolinux@163.com>

Dne 10.9.2010 17:53, yue napsal(a):
> i want to know lvm2 on source-code level.
> and  kernel device-mapper??
> just analysis source code is hard, can you give me some function-call stream.
> and whole blueprint.


If you really want to know 'in-depth' detail - I may suggest to use tools like
kcachegrind to get flow-control.

It's in fact not so easy to describe lvm2 functionality in few lines and it's
also 'moving' target as some call flow changes over the time.

Very slight overview might look like this:

- read config
- scan available block devices according config (changes quite a lot with udev
integration and cache usage)
- create internal structures and do some action according to given command

- some of commands are changing dm table - so internal dm tree structure is
generated - this abstraction is hidden in libdm

- activation/deactivation is executed - note - as lvm2 supports clusters -
this is somewhat more complex and unless you plan to have a very deep look
inside  you probably don't want to know all the magic behind - lots of limits
apply - very tight memory rules needs to be preserved to avoid deadlocks...

If you plan to add new 'target' - you may look into lib/striped subdir - there
is very some simple example.

Some sort of 'virtual' methods calls are used - unfortunately this call flow
is far from complete so target usually needs few quirks here and there over
the whole code base for now and usually knows a long depth knowledge of this
process - far from perfect, but that's current status...

Zdenek

      reply	other threads:[~2010-09-13  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 15:00 [linux-lvm] what is writed on raw disk, yue
2010-09-10 15:47 ` Zdenek Kabelac
2010-09-10 15:53 ` yue
2010-09-13  9:48   ` Zdenek Kabelac [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=4C8DF365.3020804@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=ooolinux@163.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).