Welcome! Log In Create A New Profile

About the last page of file reading in the user space

Posted by Kenokanza 
About the last page of file reading in the user space
June 07, 2009 07:23PM
1. If some file's size is 5000 Bytes, then the first 4096 Bytes are read by the first page, the remaining 4 Bytes are read by the second page. What is fetched in the left 4092 Bytes in the second page space?

2. How can I check the offset of the data (eg. the remaining 4 Bytes's location)
I found there is a macro named "bio_offset", but it's parameter is bio, not page.

3. When reading files, how can I check where each page is from (the file path and the file name)
Can the file name be found through struct file->f_dentry->d_name.name?

4. in function mpage_end_io_read,
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
so pointer bvec is pointed to the last "bio_vec",then "--bvec", and I don't why doing it reversely?
Author:

Your Email:


Subject:


Message: