struct address_space_operations def_blk_aops = { .readpage = blkdev_readpage,

.writepage = blkdev_writepage,

5If tmpfs, which is implemented on top of shared memory, is enabled, then readpage, write_begin, and write_end are also implemented.

.sync_page = block_sync_page,

.write_begin = blkdev_write_begin,

.write_end = blkdev_write_end,

.writepages = generic_writepages,

.direct_IO = blkdev_direct_IO,

Again, it is clear that a large number of special functions are used to implement the requirements, but they quickly lead to the kernel's standard functions:

Block layer_Standard function_

blkdev_readpage block_read_full_page blkdev_writepage block_write_full_page blkdev_write_begin block_write_begin blkdev_write_end block_write_end blkdev direct IO blockdev direct IO

The implementation of the address space operations for filesystems and raw access to block devices have much in common in the kernel since both share the same helper functions.

Continue reading here: Info

Was this article helpful?

0 0