xref: /openbmc/linux/fs/omfs/file.c (revision 4d8cbf6d)
159bd9dedSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
28f09e987SBob Copeland /*
38f09e987SBob Copeland  * OMFS (as used by RIO Karma) file operations.
48f09e987SBob Copeland  * Copyright (C) 2005 Bob Copeland <me@bobcopeland.com>
58f09e987SBob Copeland  */
68f09e987SBob Copeland 
78f09e987SBob Copeland #include <linux/module.h>
88f09e987SBob Copeland #include <linux/fs.h>
98f09e987SBob Copeland #include <linux/buffer_head.h>
108f09e987SBob Copeland #include <linux/mpage.h>
118f09e987SBob Copeland #include "omfs.h"
128f09e987SBob Copeland 
omfs_max_extents(struct omfs_sb_info * sbi,int offset)139419fc1cSBob Copeland static u32 omfs_max_extents(struct omfs_sb_info *sbi, int offset)
149419fc1cSBob Copeland {
159419fc1cSBob Copeland 	return (sbi->s_sys_blocksize - offset -
169419fc1cSBob Copeland 		sizeof(struct omfs_extent)) /
17*4d8cbf6dSGustavo A. R. Silva 		sizeof(struct omfs_extent_entry);
189419fc1cSBob Copeland }
199419fc1cSBob Copeland 
omfs_make_empty_table(struct buffer_head * bh,int offset)208f09e987SBob Copeland void omfs_make_empty_table(struct buffer_head *bh, int offset)
218f09e987SBob Copeland {
228f09e987SBob Copeland 	struct omfs_extent *oe = (struct omfs_extent *) &bh->b_data[offset];
238f09e987SBob Copeland 
24d406f66dSHarvey Harrison 	oe->e_next = ~cpu_to_be64(0ULL);
258f09e987SBob Copeland 	oe->e_extent_count = cpu_to_be32(1),
268f09e987SBob Copeland 	oe->e_fill = cpu_to_be32(0x22),
27*4d8cbf6dSGustavo A. R. Silva 	oe->e_entry[0].e_cluster = ~cpu_to_be64(0ULL);
28*4d8cbf6dSGustavo A. R. Silva 	oe->e_entry[0].e_blocks = ~cpu_to_be64(0ULL);
298f09e987SBob Copeland }
308f09e987SBob Copeland 
omfs_shrink_inode(struct inode * inode)318f09e987SBob Copeland int omfs_shrink_inode(struct inode *inode)
328f09e987SBob Copeland {
338f09e987SBob Copeland 	struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
348f09e987SBob Copeland 	struct omfs_extent *oe;
358f09e987SBob Copeland 	struct omfs_extent_entry *entry;
368f09e987SBob Copeland 	struct buffer_head *bh;
378f09e987SBob Copeland 	u64 next, last;
388f09e987SBob Copeland 	u32 extent_count;
399419fc1cSBob Copeland 	u32 max_extents;
408f09e987SBob Copeland 	int ret;
418f09e987SBob Copeland 
428f09e987SBob Copeland 	/* traverse extent table, freeing each entry that is greater
438f09e987SBob Copeland 	 * than inode->i_size;
448f09e987SBob Copeland 	 */
458f09e987SBob Copeland 	next = inode->i_ino;
468f09e987SBob Copeland 
478f09e987SBob Copeland 	/* only support truncate -> 0 for now */
488f09e987SBob Copeland 	ret = -EIO;
498f09e987SBob Copeland 	if (inode->i_size != 0)
508f09e987SBob Copeland 		goto out;
518f09e987SBob Copeland 
52f068272cSBob Copeland 	bh = omfs_bread(inode->i_sb, next);
538f09e987SBob Copeland 	if (!bh)
548f09e987SBob Copeland 		goto out;
558f09e987SBob Copeland 
568f09e987SBob Copeland 	oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]);
579419fc1cSBob Copeland 	max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START);
588f09e987SBob Copeland 
598f09e987SBob Copeland 	for (;;) {
608f09e987SBob Copeland 
619419fc1cSBob Copeland 		if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next))
629419fc1cSBob Copeland 			goto out_brelse;
638f09e987SBob Copeland 
648f09e987SBob Copeland 		extent_count = be32_to_cpu(oe->e_extent_count);
659419fc1cSBob Copeland 
669419fc1cSBob Copeland 		if (extent_count > max_extents)
679419fc1cSBob Copeland 			goto out_brelse;
689419fc1cSBob Copeland 
698f09e987SBob Copeland 		last = next;
708f09e987SBob Copeland 		next = be64_to_cpu(oe->e_next);
71*4d8cbf6dSGustavo A. R. Silva 		entry = oe->e_entry;
728f09e987SBob Copeland 
738f09e987SBob Copeland 		/* ignore last entry as it is the terminator */
748f09e987SBob Copeland 		for (; extent_count > 1; extent_count--) {
758f09e987SBob Copeland 			u64 start, count;
768f09e987SBob Copeland 			start = be64_to_cpu(entry->e_cluster);
778f09e987SBob Copeland 			count = be64_to_cpu(entry->e_blocks);
788f09e987SBob Copeland 
798f09e987SBob Copeland 			omfs_clear_range(inode->i_sb, start, (int) count);
808f09e987SBob Copeland 			entry++;
818f09e987SBob Copeland 		}
828f09e987SBob Copeland 		omfs_make_empty_table(bh, (char *) oe - bh->b_data);
838f09e987SBob Copeland 		mark_buffer_dirty(bh);
848f09e987SBob Copeland 		brelse(bh);
858f09e987SBob Copeland 
868f09e987SBob Copeland 		if (last != inode->i_ino)
878f09e987SBob Copeland 			omfs_clear_range(inode->i_sb, last, sbi->s_mirrors);
888f09e987SBob Copeland 
898f09e987SBob Copeland 		if (next == ~0)
908f09e987SBob Copeland 			break;
918f09e987SBob Copeland 
92f068272cSBob Copeland 		bh = omfs_bread(inode->i_sb, next);
938f09e987SBob Copeland 		if (!bh)
948f09e987SBob Copeland 			goto out;
958f09e987SBob Copeland 		oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]);
969419fc1cSBob Copeland 		max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT);
978f09e987SBob Copeland 	}
988f09e987SBob Copeland 	ret = 0;
998f09e987SBob Copeland out:
1008f09e987SBob Copeland 	return ret;
1019419fc1cSBob Copeland out_brelse:
1029419fc1cSBob Copeland 	brelse(bh);
1039419fc1cSBob Copeland 	return ret;
1048f09e987SBob Copeland }
1058f09e987SBob Copeland 
omfs_truncate(struct inode * inode)1068f09e987SBob Copeland static void omfs_truncate(struct inode *inode)
1078f09e987SBob Copeland {
1088f09e987SBob Copeland 	omfs_shrink_inode(inode);
1098f09e987SBob Copeland 	mark_inode_dirty(inode);
1108f09e987SBob Copeland }
1118f09e987SBob Copeland 
1128f09e987SBob Copeland /*
1138f09e987SBob Copeland  * Add new blocks to the current extent, or create new entries/continuations
1148f09e987SBob Copeland  * as necessary.
1158f09e987SBob Copeland  */
omfs_grow_extent(struct inode * inode,struct omfs_extent * oe,u64 * ret_block)1168f09e987SBob Copeland static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
1178f09e987SBob Copeland 			u64 *ret_block)
1188f09e987SBob Copeland {
1198f09e987SBob Copeland 	struct omfs_extent_entry *terminator;
120*4d8cbf6dSGustavo A. R. Silva 	struct omfs_extent_entry *entry = oe->e_entry;
1218f09e987SBob Copeland 	struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
1228f09e987SBob Copeland 	u32 extent_count = be32_to_cpu(oe->e_extent_count);
1238f09e987SBob Copeland 	u64 new_block = 0;
1248f09e987SBob Copeland 	u32 max_count;
1258f09e987SBob Copeland 	int new_count;
1268f09e987SBob Copeland 	int ret = 0;
1278f09e987SBob Copeland 
1288f09e987SBob Copeland 	/* reached the end of the extent table with no blocks mapped.
1298f09e987SBob Copeland 	 * there are three possibilities for adding: grow last extent,
1308f09e987SBob Copeland 	 * add a new extent to the current extent table, and add a
1318f09e987SBob Copeland 	 * continuation inode.  in last two cases need an allocator for
1328f09e987SBob Copeland 	 * sbi->s_cluster_size
1338f09e987SBob Copeland 	 */
1348f09e987SBob Copeland 
1358f09e987SBob Copeland 	/* TODO: handle holes */
1368f09e987SBob Copeland 
1378f09e987SBob Copeland 	/* should always have a terminator */
1388f09e987SBob Copeland 	if (extent_count < 1)
1398f09e987SBob Copeland 		return -EIO;
1408f09e987SBob Copeland 
1418f09e987SBob Copeland 	/* trivially grow current extent, if next block is not taken */
1428f09e987SBob Copeland 	terminator = entry + extent_count - 1;
1438f09e987SBob Copeland 	if (extent_count > 1) {
1448f09e987SBob Copeland 		entry = terminator-1;
1458f09e987SBob Copeland 		new_block = be64_to_cpu(entry->e_cluster) +
1468f09e987SBob Copeland 			be64_to_cpu(entry->e_blocks);
1478f09e987SBob Copeland 
1488f09e987SBob Copeland 		if (omfs_allocate_block(inode->i_sb, new_block)) {
149c99b6841SWei Yongjun 			be64_add_cpu(&entry->e_blocks, 1);
1508f09e987SBob Copeland 			terminator->e_blocks = ~(cpu_to_be64(
1518f09e987SBob Copeland 				be64_to_cpu(~terminator->e_blocks) + 1));
1528f09e987SBob Copeland 			goto out;
1538f09e987SBob Copeland 		}
1548f09e987SBob Copeland 	}
1559419fc1cSBob Copeland 	max_count = omfs_max_extents(sbi, OMFS_EXTENT_START);
1568f09e987SBob Copeland 
1578f09e987SBob Copeland 	/* TODO: add a continuation block here */
1588f09e987SBob Copeland 	if (be32_to_cpu(oe->e_extent_count) > max_count-1)
1598f09e987SBob Copeland 		return -EIO;
1608f09e987SBob Copeland 
1618f09e987SBob Copeland 	/* try to allocate a new cluster */
1628f09e987SBob Copeland 	ret = omfs_allocate_range(inode->i_sb, 1, sbi->s_clustersize,
1638f09e987SBob Copeland 		&new_block, &new_count);
1648f09e987SBob Copeland 	if (ret)
1658f09e987SBob Copeland 		goto out_fail;
1668f09e987SBob Copeland 
1678f09e987SBob Copeland 	/* copy terminator down an entry */
1688f09e987SBob Copeland 	entry = terminator;
1698f09e987SBob Copeland 	terminator++;
1708f09e987SBob Copeland 	memcpy(terminator, entry, sizeof(struct omfs_extent_entry));
1718f09e987SBob Copeland 
1728f09e987SBob Copeland 	entry->e_cluster = cpu_to_be64(new_block);
1738f09e987SBob Copeland 	entry->e_blocks = cpu_to_be64((u64) new_count);
1748f09e987SBob Copeland 
1758f09e987SBob Copeland 	terminator->e_blocks = ~(cpu_to_be64(
1768f09e987SBob Copeland 		be64_to_cpu(~terminator->e_blocks) + (u64) new_count));
1778f09e987SBob Copeland 
1788f09e987SBob Copeland 	/* write in new entry */
179c99b6841SWei Yongjun 	be32_add_cpu(&oe->e_extent_count, 1);
1808f09e987SBob Copeland 
1818f09e987SBob Copeland out:
1828f09e987SBob Copeland 	*ret_block = new_block;
1838f09e987SBob Copeland out_fail:
1848f09e987SBob Copeland 	return ret;
1858f09e987SBob Copeland }
1868f09e987SBob Copeland 
1878f09e987SBob Copeland /*
1888f09e987SBob Copeland  * Scans across the directory table for a given file block number.
1898f09e987SBob Copeland  * If block not found, return 0.
1908f09e987SBob Copeland  */
find_block(struct inode * inode,struct omfs_extent_entry * ent,sector_t block,int count,int * left)1918f09e987SBob Copeland static sector_t find_block(struct inode *inode, struct omfs_extent_entry *ent,
1928f09e987SBob Copeland 			sector_t block, int count, int *left)
1938f09e987SBob Copeland {
1948f09e987SBob Copeland 	/* count > 1 because of terminator */
1958f09e987SBob Copeland 	sector_t searched = 0;
1968f09e987SBob Copeland 	for (; count > 1; count--) {
1978f09e987SBob Copeland 		int numblocks = clus_to_blk(OMFS_SB(inode->i_sb),
1988f09e987SBob Copeland 			be64_to_cpu(ent->e_blocks));
1998f09e987SBob Copeland 
2008f09e987SBob Copeland 		if (block >= searched  &&
2018f09e987SBob Copeland 		    block < searched + numblocks) {
2028f09e987SBob Copeland 			/*
2038f09e987SBob Copeland 			 * found it at cluster + (block - searched)
2048f09e987SBob Copeland 			 * numblocks - (block - searched) is remainder
2058f09e987SBob Copeland 			 */
2068f09e987SBob Copeland 			*left = numblocks - (block - searched);
2078f09e987SBob Copeland 			return clus_to_blk(OMFS_SB(inode->i_sb),
2088f09e987SBob Copeland 				be64_to_cpu(ent->e_cluster)) +
2098f09e987SBob Copeland 				block - searched;
2108f09e987SBob Copeland 		}
2118f09e987SBob Copeland 		searched += numblocks;
2128f09e987SBob Copeland 		ent++;
2138f09e987SBob Copeland 	}
2148f09e987SBob Copeland 	return 0;
2158f09e987SBob Copeland }
2168f09e987SBob Copeland 
omfs_get_block(struct inode * inode,sector_t block,struct buffer_head * bh_result,int create)2178f09e987SBob Copeland static int omfs_get_block(struct inode *inode, sector_t block,
2188f09e987SBob Copeland 			  struct buffer_head *bh_result, int create)
2198f09e987SBob Copeland {
2208f09e987SBob Copeland 	struct buffer_head *bh;
2218f09e987SBob Copeland 	sector_t next, offset;
2228f09e987SBob Copeland 	int ret;
2233f649ab7SKees Cook 	u64 new_block;
2249419fc1cSBob Copeland 	u32 max_extents;
2258f09e987SBob Copeland 	int extent_count;
2268f09e987SBob Copeland 	struct omfs_extent *oe;
2278f09e987SBob Copeland 	struct omfs_extent_entry *entry;
2288f09e987SBob Copeland 	struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
2298f09e987SBob Copeland 	int max_blocks = bh_result->b_size >> inode->i_blkbits;
2308f09e987SBob Copeland 	int remain;
2318f09e987SBob Copeland 
2328f09e987SBob Copeland 	ret = -EIO;
233f068272cSBob Copeland 	bh = omfs_bread(inode->i_sb, inode->i_ino);
2348f09e987SBob Copeland 	if (!bh)
2358f09e987SBob Copeland 		goto out;
2368f09e987SBob Copeland 
2378f09e987SBob Copeland 	oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]);
2389419fc1cSBob Copeland 	max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START);
2398f09e987SBob Copeland 	next = inode->i_ino;
2408f09e987SBob Copeland 
2418f09e987SBob Copeland 	for (;;) {
2428f09e987SBob Copeland 
2438f09e987SBob Copeland 		if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next))
2448f09e987SBob Copeland 			goto out_brelse;
2458f09e987SBob Copeland 
2468f09e987SBob Copeland 		extent_count = be32_to_cpu(oe->e_extent_count);
2478f09e987SBob Copeland 		next = be64_to_cpu(oe->e_next);
248*4d8cbf6dSGustavo A. R. Silva 		entry = oe->e_entry;
2498f09e987SBob Copeland 
2509419fc1cSBob Copeland 		if (extent_count > max_extents)
2519419fc1cSBob Copeland 			goto out_brelse;
2529419fc1cSBob Copeland 
2538f09e987SBob Copeland 		offset = find_block(inode, entry, block, extent_count, &remain);
2548f09e987SBob Copeland 		if (offset > 0) {
2558f09e987SBob Copeland 			ret = 0;
2568f09e987SBob Copeland 			map_bh(bh_result, inode->i_sb, offset);
2578f09e987SBob Copeland 			if (remain > max_blocks)
2588f09e987SBob Copeland 				remain = max_blocks;
2598f09e987SBob Copeland 			bh_result->b_size = (remain << inode->i_blkbits);
2608f09e987SBob Copeland 			goto out_brelse;
2618f09e987SBob Copeland 		}
2628f09e987SBob Copeland 		if (next == ~0)
2638f09e987SBob Copeland 			break;
2648f09e987SBob Copeland 
2658f09e987SBob Copeland 		brelse(bh);
266f068272cSBob Copeland 		bh = omfs_bread(inode->i_sb, next);
2678f09e987SBob Copeland 		if (!bh)
2688f09e987SBob Copeland 			goto out;
2698f09e987SBob Copeland 		oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]);
2709419fc1cSBob Copeland 		max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT);
2718f09e987SBob Copeland 	}
2728f09e987SBob Copeland 	if (create) {
2738f09e987SBob Copeland 		ret = omfs_grow_extent(inode, oe, &new_block);
2748f09e987SBob Copeland 		if (ret == 0) {
2758f09e987SBob Copeland 			mark_buffer_dirty(bh);
2768f09e987SBob Copeland 			mark_inode_dirty(inode);
2778f09e987SBob Copeland 			map_bh(bh_result, inode->i_sb,
2788f09e987SBob Copeland 					clus_to_blk(sbi, new_block));
2798f09e987SBob Copeland 		}
2808f09e987SBob Copeland 	}
2818f09e987SBob Copeland out_brelse:
2828f09e987SBob Copeland 	brelse(bh);
2838f09e987SBob Copeland out:
2848f09e987SBob Copeland 	return ret;
2858f09e987SBob Copeland }
2868f09e987SBob Copeland 
omfs_read_folio(struct file * file,struct folio * folio)2872c69e205SMatthew Wilcox (Oracle) static int omfs_read_folio(struct file *file, struct folio *folio)
2888f09e987SBob Copeland {
2892c69e205SMatthew Wilcox (Oracle) 	return block_read_full_folio(folio, omfs_get_block);
2908f09e987SBob Copeland }
2918f09e987SBob Copeland 
omfs_readahead(struct readahead_control * rac)292d4388340SMatthew Wilcox (Oracle) static void omfs_readahead(struct readahead_control *rac)
2938f09e987SBob Copeland {
294d4388340SMatthew Wilcox (Oracle) 	mpage_readahead(rac, omfs_get_block);
2958f09e987SBob Copeland }
2968f09e987SBob Copeland 
2978f09e987SBob Copeland static int
omfs_writepages(struct address_space * mapping,struct writeback_control * wbc)2988f09e987SBob Copeland omfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
2998f09e987SBob Copeland {
3008f09e987SBob Copeland 	return mpage_writepages(mapping, wbc, omfs_get_block);
3018f09e987SBob Copeland }
3028f09e987SBob Copeland 
omfs_write_failed(struct address_space * mapping,loff_t to)303a8f5293aSMarco Stornelli static void omfs_write_failed(struct address_space *mapping, loff_t to)
304a8f5293aSMarco Stornelli {
305a8f5293aSMarco Stornelli 	struct inode *inode = mapping->host;
306a8f5293aSMarco Stornelli 
307a8f5293aSMarco Stornelli 	if (to > inode->i_size) {
3087caef267SKirill A. Shutemov 		truncate_pagecache(inode, inode->i_size);
309a8f5293aSMarco Stornelli 		omfs_truncate(inode);
310a8f5293aSMarco Stornelli 	}
311a8f5293aSMarco Stornelli }
312a8f5293aSMarco Stornelli 
omfs_write_begin(struct file * file,struct address_space * mapping,loff_t pos,unsigned len,struct page ** pagep,void ** fsdata)3138f09e987SBob Copeland static int omfs_write_begin(struct file *file, struct address_space *mapping,
3149d6b0cd7SMatthew Wilcox (Oracle) 			loff_t pos, unsigned len,
3158f09e987SBob Copeland 			struct page **pagep, void **fsdata)
3168f09e987SBob Copeland {
317155130a4SChristoph Hellwig 	int ret;
318155130a4SChristoph Hellwig 
319b3992d1eSMatthew Wilcox (Oracle) 	ret = block_write_begin(mapping, pos, len, pagep, omfs_get_block);
320a8f5293aSMarco Stornelli 	if (unlikely(ret))
321a8f5293aSMarco Stornelli 		omfs_write_failed(mapping, pos + len);
322155130a4SChristoph Hellwig 
323155130a4SChristoph Hellwig 	return ret;
3248f09e987SBob Copeland }
3258f09e987SBob Copeland 
omfs_bmap(struct address_space * mapping,sector_t block)3268f09e987SBob Copeland static sector_t omfs_bmap(struct address_space *mapping, sector_t block)
3278f09e987SBob Copeland {
3288f09e987SBob Copeland 	return generic_block_bmap(mapping, block, omfs_get_block);
3298f09e987SBob Copeland }
3308f09e987SBob Copeland 
331828c0950SAlexey Dobriyan const struct file_operations omfs_file_operations = {
3328f09e987SBob Copeland 	.llseek = generic_file_llseek,
333aad4f8bbSAl Viro 	.read_iter = generic_file_read_iter,
3348174202bSAl Viro 	.write_iter = generic_file_write_iter,
3358f09e987SBob Copeland 	.mmap = generic_file_mmap,
3361b061d92SChristoph Hellwig 	.fsync = generic_file_fsync,
3372cb1e089SDavid Howells 	.splice_read = filemap_splice_read,
3388f09e987SBob Copeland };
3398f09e987SBob Copeland 
omfs_setattr(struct mnt_idmap * idmap,struct dentry * dentry,struct iattr * attr)340c1632a0fSChristian Brauner static int omfs_setattr(struct mnt_idmap *idmap,
341549c7297SChristian Brauner 			struct dentry *dentry, struct iattr *attr)
342d39aae9eSChristoph Hellwig {
3432b0143b5SDavid Howells 	struct inode *inode = d_inode(dentry);
344d39aae9eSChristoph Hellwig 	int error;
345d39aae9eSChristoph Hellwig 
346c1632a0fSChristian Brauner 	error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
347d39aae9eSChristoph Hellwig 	if (error)
348d39aae9eSChristoph Hellwig 		return error;
3491025774cSChristoph Hellwig 
3501025774cSChristoph Hellwig 	if ((attr->ia_valid & ATTR_SIZE) &&
3511025774cSChristoph Hellwig 	    attr->ia_size != i_size_read(inode)) {
352a8f5293aSMarco Stornelli 		error = inode_newsize_ok(inode, attr->ia_size);
3531025774cSChristoph Hellwig 		if (error)
3541025774cSChristoph Hellwig 			return error;
355a8f5293aSMarco Stornelli 		truncate_setsize(inode, attr->ia_size);
356a8f5293aSMarco Stornelli 		omfs_truncate(inode);
3571025774cSChristoph Hellwig 	}
3581025774cSChristoph Hellwig 
359c1632a0fSChristian Brauner 	setattr_copy(&nop_mnt_idmap, inode, attr);
3601025774cSChristoph Hellwig 	mark_inode_dirty(inode);
3611025774cSChristoph Hellwig 	return 0;
362d39aae9eSChristoph Hellwig }
363d39aae9eSChristoph Hellwig 
3646e1d5dccSAlexey Dobriyan const struct inode_operations omfs_file_inops = {
365d39aae9eSChristoph Hellwig 	.setattr = omfs_setattr,
3668f09e987SBob Copeland };
3678f09e987SBob Copeland 
3687f09410bSAlexey Dobriyan const struct address_space_operations omfs_aops = {
369e621900aSMatthew Wilcox (Oracle) 	.dirty_folio = block_dirty_folio,
3707ba13abbSMatthew Wilcox (Oracle) 	.invalidate_folio = block_invalidate_folio,
3712c69e205SMatthew Wilcox (Oracle) 	.read_folio = omfs_read_folio,
372d4388340SMatthew Wilcox (Oracle) 	.readahead = omfs_readahead,
3738f09e987SBob Copeland 	.writepages = omfs_writepages,
3748f09e987SBob Copeland 	.write_begin = omfs_write_begin,
3758f09e987SBob Copeland 	.write_end = generic_write_end,
3768f09e987SBob Copeland 	.bmap = omfs_bmap,
3771bda9dadSChristoph Hellwig 	.migrate_folio = buffer_migrate_folio,
3788f09e987SBob Copeland };
3798f09e987SBob Copeland 
380