From: "Takashi Sato" <sho@tnes.nec.co.jp>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: "linux-ext4" <linux-ext4@vger.kernel.org>
Subject: Re: Online defragmentation
Date: Thu, 31 May 2007 13:05:06 +0900 [thread overview]
Message-ID: <00c201c7a338$e238ae50$4168010a@bsd.tnes.nec.co.jp> (raw)
In-Reply-To: 465D2C37.9080905@linux.vnet.ibm.com
Hi,
>> I was looking at online defrag code and found that the tmp_inode is created with
>> tmp_inode->i_nlink equal to zero. Now i am not sure whether i understand the code
>> correctly, but AFAIU we allocate contiguous block using this tmp_inode. That means
>> tmp_inode have extent details corresponding to the blocks. Now we are mapping the file
>> data found in the original inode to this new blocks. Towards the end we does a iput. In
>> iput since we have i_nlink as zero it will go ahead and call generic_delete_inode which
>> will cause these data blocks to be marked free (right ?)
>>
>
> Looking at the code again i guess for defragmentation it is okey. I guess what actually
> happens is the blocks that is corresponding to the original inode get accounted under
> tmp_inode. (it actually does a swap of blocks ) So doing a iput with i_nlink = 0 is the
> correct approach.
>
> Correct me if i am wrong.
Your understanding is right.
The iput() is called to free the old blocks which were in the original
inode.
Cheers, Takashi
next prev parent reply other threads:[~2007-05-31 4:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-30 7:04 Online defragmentation Aneesh Kumar K.V
2007-05-30 7:48 ` Aneesh Kumar K.V
2007-05-31 4:05 ` Takashi Sato [this message]
2007-05-30 14:10 ` Andreas Dilger
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='00c201c7a338$e238ae50$4168010a@bsd.tnes.nec.co.jp' \
--to=sho@tnes.nec.co.jp \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
/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