mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-26 01:44:31 +00:00
scoutfs: add basic file page cache read and write
Add basic file data support by implementing the address space file and page read and write methods. This passis basic read/write tests but is only the seed of a final implementation. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+18
-2
@@ -21,6 +21,7 @@
|
||||
#include "inode.h"
|
||||
#include "segment.h"
|
||||
#include "dir.h"
|
||||
#include "filerw.h"
|
||||
|
||||
/*
|
||||
* XXX
|
||||
@@ -68,10 +69,25 @@ void scoutfs_destroy_inode(struct inode *inode)
|
||||
static void set_inode_ops(struct inode *inode)
|
||||
{
|
||||
switch (inode->i_mode & S_IFMT) {
|
||||
/*
|
||||
* I guess we add a reg.c for regular files? Or pagecache.c?
|
||||
* I guess that makes more sense.
|
||||
*
|
||||
* - page dirtying makes sure there's a dirty item
|
||||
* - sync writes back page cache pages
|
||||
* - writepage copies to dirty item
|
||||
* - crc calculated after copying
|
||||
* - pages can be pretty large
|
||||
* - tail items can be partial?
|
||||
* - tracing all over the place
|
||||
* - maybe just less than 4k is the answer?
|
||||
* - so allocation pulls the value back
|
||||
* - probably leave some overhead for header growth
|
||||
*/
|
||||
case S_IFREG:
|
||||
// inode->i_mapping->a_ops = &scoutfs_file_aops;
|
||||
inode->i_mapping->a_ops = &scoutfs_file_aops;
|
||||
// inode->i_op = &scoutfs_file_iops;
|
||||
// inode->i_fop = &scoutfs_file_fops;
|
||||
inode->i_fop = &scoutfs_file_fops;
|
||||
break;
|
||||
case S_IFDIR:
|
||||
inode->i_op = &scoutfs_dir_iops;
|
||||
|
||||
Reference in New Issue
Block a user