linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: 조완근 <jowkju@postech.ac.kr>
To: linux-lvm@redhat.com
Subject: [linux-lvm] In LVM, problem with memory allocation to a new data structure...
Date: Fri, 23 Jun 2006 02:31:29 +0900 (KST)	[thread overview]
Message-ID: <27933104.1150997489270.JavaMail.root@mail1> (raw)

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]





In my work with LVM source code,&nbsp;I made a new data structure "struct 
extent" in lib/metadata/metadata.h file, and then I added new member variables 
in&nbsp;"struct physical_volume".&nbsp;One of&nbsp;the new 
member&nbsp;variables&nbsp;is a&nbsp;pointer variable to an array of "struct 
extent" objects.&nbsp;I got the memory allocated to the pointer by using just 
malloc() function.


&nbsp;


The source is compiled without any errors. But in execution, when the new 
array of "struct extent" objects is allocated, it works well. But later, when I 
access the physical volume object again, the new members have all zeros, instead 
of the values I gave before. Where have the values gone??


&nbsp;


My question is


&nbsp;(1) How can I add new member variables in the metadata data 
structures?


&nbsp;(2) and&nbsp;What&nbsp;do&nbsp;I have to use for memory allocation to 
the new variables?


&nbsp;


I'm very happy that there are you guys who can answer to my questions. Thank 
you!!






[-- Attachment #2: Type: text/html, Size: 1506 bytes --]

                 reply	other threads:[~2006-06-22 17:31 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=27933104.1150997489270.JavaMail.root@mail1 \
    --to=jowkju@postech.ac.kr \
    --cc=linux-lvm@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).