[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Access content of file via inodes
Hi,
>
> How do I access/read the content of the files via > using inodes
> or blocks that belong to the inode, at sys_link and > vfs_link layer?
> I used bmap to access the blocks that belongs to the > inodes, but
> getting access to the buffer_head's b_data doesn't > seem to help.
>
In struct buffer_head, b_data points to memory region of size 4K containing data of the desired block. So you can memcpy it to your buffer.
Nitin
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/