#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <asm/byteorder.h>
#include <linux/swap.h>
#include <linux/mpage.h>
#include <linux/quotaops.h>
#include <linux/blkdev.h>
#include <linux/uio.h>
#include <linux/mm.h>
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "alloc.h"
#include "aops.h"
#include "dlmglue.h"
#include "extent_map.h"
#include "file.h"
#include "inode.h"
#include "journal.h"
#include "suballoc.h"
#include "super.h"
#include "symlink.h"
#include "refcounttree.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h"
#include "dir.h"
#include "namei.h"
#include "sysfile.h"
static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{ … }
static int ocfs2_lock_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{ … }
int ocfs2_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{ … }
int ocfs2_read_inline_data(struct inode *inode, struct page *page,
struct buffer_head *di_bh)
{ … }
static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
{ … }
static int ocfs2_read_folio(struct file *file, struct folio *folio)
{ … }
static void ocfs2_readahead(struct readahead_control *rac)
{ … }
static int ocfs2_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{ … }
int walk_page_buffers( handle_t *handle,
struct buffer_head *head,
unsigned from,
unsigned to,
int *partial,
int (*fn)( handle_t *handle,
struct buffer_head *bh))
{ … }
static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
{ … }
static bool ocfs2_release_folio(struct folio *folio, gfp_t wait)
{ … }
static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb,
u32 cpos,
unsigned int *start,
unsigned int *end)
{ … }
static void ocfs2_clear_page_regions(struct page *page,
struct ocfs2_super *osb, u32 cpos,
unsigned from, unsigned to)
{ … }
static int ocfs2_should_read_blk(struct inode *inode, struct folio *folio,
unsigned int block_start)
{ … }
int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
struct inode *inode, unsigned int from,
unsigned int to, int new)
{ … }
#if (PAGE_SIZE >= OCFS2_MAX_CLUSTERSIZE)
#define OCFS2_MAX_CTXT_PAGES …
#else
#define OCFS2_MAX_CTXT_PAGES …
#endif
#define OCFS2_MAX_CLUSTERS_PER_PAGE …
struct ocfs2_unwritten_extent { … };
struct ocfs2_write_cluster_desc { … };
struct ocfs2_write_ctxt { … };
void ocfs2_unlock_and_free_pages(struct page **pages, int num_pages)
{ … }
static void ocfs2_unlock_pages(struct ocfs2_write_ctxt *wc)
{ … }
static void ocfs2_free_unwritten_list(struct inode *inode,
struct list_head *head)
{ … }
static void ocfs2_free_write_ctxt(struct inode *inode,
struct ocfs2_write_ctxt *wc)
{ … }
static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp,
struct ocfs2_super *osb, loff_t pos,
unsigned len, ocfs2_write_type_t type,
struct buffer_head *di_bh)
{ … }
static void ocfs2_zero_new_buffers(struct page *page, unsigned from, unsigned to)
{ … }
static void ocfs2_write_failure(struct inode *inode,
struct ocfs2_write_ctxt *wc,
loff_t user_pos, unsigned user_len)
{ … }
static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
struct ocfs2_write_ctxt *wc,
struct page *page, u32 cpos,
loff_t user_pos, unsigned user_len,
int new)
{ … }
static int ocfs2_grab_pages_for_write(struct address_space *mapping,
struct ocfs2_write_ctxt *wc,
u32 cpos, loff_t user_pos,
unsigned user_len, int new,
struct page *mmap_page)
{ … }
static int ocfs2_write_cluster(struct address_space *mapping,
u32 *phys, unsigned int new,
unsigned int clear_unwritten,
unsigned int should_zero,
struct ocfs2_alloc_context *data_ac,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_write_ctxt *wc, u32 cpos,
loff_t user_pos, unsigned user_len)
{ … }
static int ocfs2_write_cluster_by_desc(struct address_space *mapping,
struct ocfs2_alloc_context *data_ac,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_write_ctxt *wc,
loff_t pos, unsigned len)
{ … }
static void ocfs2_set_target_boundaries(struct ocfs2_super *osb,
struct ocfs2_write_ctxt *wc,
loff_t pos, unsigned len, int alloc)
{ … }
static int ocfs2_unwritten_check(struct inode *inode,
struct ocfs2_write_ctxt *wc,
struct ocfs2_write_cluster_desc *desc)
{ … }
static int ocfs2_populate_write_desc(struct inode *inode,
struct ocfs2_write_ctxt *wc,
unsigned int *clusters_to_alloc,
unsigned int *extents_to_split)
{ … }
static int ocfs2_write_begin_inline(struct address_space *mapping,
struct inode *inode,
struct ocfs2_write_ctxt *wc)
{ … }
int ocfs2_size_fits_inline_data(struct buffer_head *di_bh, u64 new_size)
{ … }
static int ocfs2_try_to_write_inline_data(struct address_space *mapping,
struct inode *inode, loff_t pos,
unsigned len, struct page *mmap_page,
struct ocfs2_write_ctxt *wc)
{ … }
static int ocfs2_expand_nonsparse_inode(struct inode *inode,
struct buffer_head *di_bh,
loff_t pos, unsigned len,
struct ocfs2_write_ctxt *wc)
{ … }
static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh,
loff_t pos)
{ … }
int ocfs2_write_begin_nolock(struct address_space *mapping,
loff_t pos, unsigned len, ocfs2_write_type_t type,
struct folio **foliop, void **fsdata,
struct buffer_head *di_bh, struct page *mmap_page)
{ … }
static int ocfs2_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len,
struct folio **foliop, void **fsdata)
{ … }
static void ocfs2_write_end_inline(struct inode *inode, loff_t pos,
unsigned len, unsigned *copied,
struct ocfs2_dinode *di,
struct ocfs2_write_ctxt *wc)
{ … }
int ocfs2_write_end_nolock(struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied, void *fsdata)
{ … }
static int ocfs2_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct folio *folio, void *fsdata)
{ … }
struct ocfs2_dio_write_ctxt { … };
static struct ocfs2_dio_write_ctxt *
ocfs2_dio_alloc_write_ctx(struct buffer_head *bh, int *alloc)
{ … }
static void ocfs2_dio_free_write_ctx(struct inode *inode,
struct ocfs2_dio_write_ctxt *dwc)
{ … }
static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{ … }
static int ocfs2_dio_end_io_write(struct inode *inode,
struct ocfs2_dio_write_ctxt *dwc,
loff_t offset,
ssize_t bytes)
{ … }
static int ocfs2_dio_end_io(struct kiocb *iocb,
loff_t offset,
ssize_t bytes,
void *private)
{ … }
static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
{ … }
const struct address_space_operations ocfs2_aops = …;