Issue 27: Copying Data Blocks
Project Member Reported by imreckless@gmail.com, Jan 9, 2009
While relocating a file, we are allocating data blocks in target 
tier and copying the data blocks of source inode to newly 
allocated blocks.

We have two possibilities.

1. We allocate a target inode and copy the data blocks from source inode
   and update the directory entry of source file.
2. We allocate a target inode and copy the data blocks from source inode
   and update the source inode with new blocks and release target inode.


Jan 11, 2009
Project Member #1 sandeepksinha
Refer http://kerneltrap.org/mailarchive/linux-kernel-newbies/2009/1/6/4610084

Also, using mutex to take a lock on the inode while copying the data blocks should
work fine for us.


Jan 14, 2009
Project Member #2 sandeepksinha
(No comment was entered for this change.)
Cc: -fscops -sandeepksinha -sneha.hendre -bharati.alatgi -rohitvashist2kk3 -checkout.vineet -postrishi
Jan 23, 2009
Project Member #3 imreckless@gmail.com
We have developed our own Tricky Copy And Swap algorithm
for relocation.

We have three methods.
1. By using Memcopy
2. By page swap
3. By changing the blocknr in buffer head.

Out of these we have selected Page swap method.

Tricky Copy And Swap Algo:

  Allocate a ghost inode. (dest)
  Get the source inode.(src)
  Allocate a data block for ghost
  Read the block into buffer head 1 
  Read the source block into buffer head 2
  Change the page no. of dest buffer = page no. of src buffer.
  Flush the page
  Now ghost inode has exact data from source
  Swap source i_data with ghost i_data
  Finally source inode has new data blocks
  so mark it dirty and delete the ghost inode. 



Labels: -Priority-Critical Priority-Medium
Jan 30, 2009
#4 postri...@gmail.com
So we are going with the Page Flip Algorithm
Status: Done