linux/fs/afs/file.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* AFS filesystem file handling
 *
 * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells ([email protected])
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/writeback.h>
#include <linux/gfp.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/netfs.h>
#include "internal.h"

static int afs_file_mmap(struct file *file, struct vm_area_struct *vma);
static int afs_symlink_read_folio(struct file *file, struct folio *folio);

static ssize_t afs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter);
static ssize_t afs_file_splice_read(struct file *in, loff_t *ppos,
				    struct pipe_inode_info *pipe,
				    size_t len, unsigned int flags);
static void afs_vm_open(struct vm_area_struct *area);
static void afs_vm_close(struct vm_area_struct *area);
static vm_fault_t afs_vm_map_pages(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff);

const struct file_operations afs_file_operations =;

const struct inode_operations afs_file_inode_operations =;

const struct address_space_operations afs_file_aops =;

const struct address_space_operations afs_symlink_aops =;

static const struct vm_operations_struct afs_vm_ops =;

/*
 * Discard a pin on a writeback key.
 */
void afs_put_wb_key(struct afs_wb_key *wbk)
{}

/*
 * Cache key for writeback.
 */
int afs_cache_wb_key(struct afs_vnode *vnode, struct afs_file *af)
{}

/*
 * open an AFS file or directory and attach a key to it
 */
int afs_open(struct inode *inode, struct file *file)
{}

/*
 * release an AFS file or directory and discard its key
 */
int afs_release(struct inode *inode, struct file *file)
{}

/*
 * Allocate a new read record.
 */
struct afs_read *afs_alloc_read(gfp_t gfp)
{}

/*
 * Dispose of a ref to a read record.
 */
void afs_put_read(struct afs_read *req)
{}

static void afs_fetch_data_notify(struct afs_operation *op)
{}

static void afs_fetch_data_success(struct afs_operation *op)
{}

static void afs_fetch_data_put(struct afs_operation *op)
{}

static const struct afs_operation_ops afs_fetch_data_operation =;

/*
 * Fetch file data from the volume.
 */
int afs_fetch_data(struct afs_vnode *vnode, struct afs_read *req)
{}

static void afs_issue_read(struct netfs_io_subrequest *subreq)
{}

static int afs_symlink_read_folio(struct file *file, struct folio *folio)
{}

static int afs_init_request(struct netfs_io_request *rreq, struct file *file)
{}

static int afs_check_write_begin(struct file *file, loff_t pos, unsigned len,
				 struct folio **foliop, void **_fsdata)
{}

static void afs_free_request(struct netfs_io_request *rreq)
{}

static void afs_update_i_size(struct inode *inode, loff_t new_i_size)
{}

static void afs_netfs_invalidate_cache(struct netfs_io_request *wreq)
{}

const struct netfs_request_ops afs_req_ops =;

static void afs_add_open_mmap(struct afs_vnode *vnode)
{}

static void afs_drop_open_mmap(struct afs_vnode *vnode)
{}

/*
 * Handle setting up a memory mapping on an AFS file.
 */
static int afs_file_mmap(struct file *file, struct vm_area_struct *vma)
{}

static void afs_vm_open(struct vm_area_struct *vma)
{}

static void afs_vm_close(struct vm_area_struct *vma)
{}

static vm_fault_t afs_vm_map_pages(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff)
{}

static ssize_t afs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
{}

static ssize_t afs_file_splice_read(struct file *in, loff_t *ppos,
				    struct pipe_inode_info *pipe,
				    size_t len, unsigned int flags)
{}