- Subject: Changing i_blocks field from ext4_inode.
- From: Ganesh Patil <patil.ganesh170@xxxxxxxxx>
- Date: Wed, 28 Mar 2012 01:59:52 +0530
Can we change both the fields(struct ext4_extent_header and struct ext4_extent) from i_blocks[..] of any file manually?
from i_block I got header & first extent of file as follows.
struct ext4_extent_header *eeh = (struct ext4_extent_header *)EXT4_I(d_inode1)->i_data;
struct ext4_extent *eex = EXT_FIRST_EXTENT(eeh);
from extent I got physical block numbers of file as follows.
printk(KERN_INFO "high 16 bits of physical block=%d",eex->ee_start_hi);
printk(KERN_INFO "low 32 bits of physical block=%d", eex->ee_start_lo);
Now,I have to change this whole structure of i_blocks[..] so that new structure of i_blocks[..] contains new header as well as new physical blocks. I have tried in following way:
where myeeh is the old ext4_extent_header from which I have to copy fields in to new header i.e in eeh which contains the current header of file.
**for ext4_extent :
where myeex is the old ext4_extent from which I have to copy fields in to new extent i.e in eex which contain the current extent of file.
I have done above code by writing my own module but it is not directly making change in files ext4_inode i.e file content does not change even though I have changed physical block numbers. If above method is wrong then what is the correct way?
Kernelnewbies mailing list
[Linux Kernel Development]