Rezass
Rezass

Reputation: 73

Where does in ext3 source code requests to read an indirect block sent?

i want to find that place and set a flag in that request so i can identify these requests in block io layer. i changed bio structure and add an extra flag and i want to set this flag for all indirect block requests which sent to disk.

Upvotes: 0

Views: 521

Answers (1)

Appleman1234
Appleman1234

Reputation: 16076

I believe what you are looking for is the call to ext3_get_branch in /fs/ext3/inode.c is what you are looking for. which reads the chain of indirect blocks leading to data.

The call trace up to the read syscall is as follows: /fs/ext3/inode.c

ext3_get_branch is called by ext3_get_blocks_handle

ext3_get_blocks_handle is called by ext3_get_block

ext3_get_block is passed as function pointer to be called by mpage_readpage in /fs/mpage.c by ext3_readpage

/mm/filemap.c

ext3_readpage is called by mapping->a_ops->readpage(filp, page); in do_generic_file_read

do_generic_file_read is called by generic_file_aio_read

/fs/read_write.c

generic_file_aio_read is called by ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);`` indo_sync_readwhere filp->f_op->aio_readis the function pointer ofgeneric_file_aio_read` defined in /fs/ext3/inode.c

do_sync_read is mapped to the read system call in the struct definition of generic_ro_fops.

Upvotes: 2

Related Questions