Re: [RFC PATCH 05/10] ftrfs: add file operations

Matthew Wilcox
2026-04-13T15:09:18Z

On Mon, Apr 13, 2026 at 04:23:51PM +0200, Aurelien DESBRIERES wrote:
> From: Aurélien DESBRIERES <aurelien@hackers.camp>
>
> Implement basic file read/write using generic VFS helpers:
>
> - ftrfs_file_operations: generic_file_read_iter, generic_file_write_iter
> - ftrfs_file_inode_operations: getattr via simple_getattr
> - ftrfs_address_space_operations: readpage via block_read_full_folio,
> writepage via block_write_full_folio, bmap via generic_block_bmap

... where is this? I only see file_operations and inode_operations. I
don't see address_space_operations anywhere.

> Read path delegates to the page cache via generic helpers.
> Write path is wired but depends on the block allocator (alloc.c)
> and write_inode (namei.c) for persistence.
>
> Signed-off-by: Aurélien DESBRIERES <aurelien@hackers.camp>
> ---
> fs/ftrfs/file.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
> create mode 100644 fs/ftrfs/file.c
>
> diff --git a/fs/ftrfs/file.c b/fs/ftrfs/file.c
> new file mode 100644
> index 000000000..ef121359b
> --- /dev/null
> +++ b/fs/ftrfs/file.c
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * FTRFS — File operations (skeleton)
> + * Author: roastercode - Aurelien DESBRIERES <aurelien@hackers.camp>
> + *
> + * NOTE: read/write use generic_file_* for now.
> + * The EDAC/RS layer will intercept at the block I/O level (next iteration).
> + */
> +
> +#include <linux/fs.h>
> +#include <linux/mm.h>
> +#include "ftrfs.h"
> +
> +const struct file_operations ftrfs_file_operations = {
> + .llseek = generic_file_llseek,
> + .read_iter = generic_file_read_iter,
> + .write_iter = generic_file_write_iter,
> + .mmap = generic_file_mmap,
> + .fsync = generic_file_fsync,
> + .splice_read = filemap_splice_read,
> +};
> +
> +const struct inode_operations ftrfs_file_inode_operations = {
> + .getattr = simple_getattr,
> +};
> --
> 2.52.0
>
>