netfs: Provide readahead and readpage netfs helpers
Add a pair of helper functions: (*) netfs_readahead() (*) netfs_readpage() to do the work of handling a readahead or a readpage, where the page(s) that form part of the request may be split between the local cache, the server or just require clearing, and may be single pages and transparent huge pages. This is all handled within the helper. Note that while both will read from the cache if there is data present, only netfs_readahead() will expand the request beyond what it was asked to do, and only netfs_readahead() will write back to the cache. netfs_readpage(), on the other hand, is synchronous and only fetches the page (which might be a THP) it is asked for. The netfs gives the helper parameters from the VM, the cache cookie it wants to use (or NULL) and a table of operations (only one of which is mandatory): (*) expand_readahead() [optional] Called to allow the netfs to request an expansion of a readahead request to meet its own a...
Showing
- fs/Kconfig 1 addition, 0 deletionsfs/Kconfig
- fs/Makefile 1 addition, 0 deletionsfs/Makefile
- fs/netfs/Makefile 6 additions, 0 deletionsfs/netfs/Makefile
- fs/netfs/internal.h 61 additions, 0 deletionsfs/netfs/internal.h
- fs/netfs/read_helper.c 725 additions, 0 deletionsfs/netfs/read_helper.c
- include/linux/netfs.h 83 additions, 0 deletionsinclude/linux/netfs.h
Please register or sign in to comment