linux/fs/backing-file.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Common helpers for stackable filesystems and backing files.
 *
 * Forked from fs/overlayfs/file.c.
 *
 * Copyright (C) 2017 Red Hat, Inc.
 * Copyright (C) 2023 CTERA Networks.
 */

#include <linux/fs.h>
#include <linux/backing-file.h>
#include <linux/splice.h>
#include <linux/mm.h>

#include "internal.h"

/**
 * backing_file_open - open a backing file for kernel internal use
 * @user_path:	path that the user reuqested to open
 * @flags:	open flags
 * @real_path:	path of the backing file
 * @cred:	credentials for open
 *
 * Open a backing file for a stackable filesystem (e.g., overlayfs).
 * @user_path may be on the stackable filesystem and @real_path on the
 * underlying filesystem.  In this case, we want to be able to return the
 * @user_path of the stackable filesystem. This is done by embedding the
 * returned file into a container structure that also stores the stacked
 * file's path, which can be retrieved using backing_file_user_path().
 */
struct file *backing_file_open(const struct path *user_path, int flags,
			       const struct path *real_path,
			       const struct cred *cred)
{}
EXPORT_SYMBOL_GPL();

struct file *backing_tmpfile_open(const struct path *user_path, int flags,
				  const struct path *real_parentpath,
				  umode_t mode, const struct cred *cred)
{}
EXPORT_SYMBOL();

struct backing_aio {};

static struct kmem_cache *backing_aio_cachep;

#define BACKING_IOCB_MASK

static rwf_t iocb_to_rw_flags(int flags)
{}

static void backing_aio_put(struct backing_aio *aio)
{}

static void backing_aio_cleanup(struct backing_aio *aio, long res)
{}

static void backing_aio_rw_complete(struct kiocb *iocb, long res)
{}

static void backing_aio_complete_work(struct work_struct *work)
{}

static void backing_aio_queue_completion(struct kiocb *iocb, long res)
{}

static int backing_aio_init_wq(struct kiocb *iocb)
{}


ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
			       struct kiocb *iocb, int flags,
			       struct backing_file_ctx *ctx)
{}
EXPORT_SYMBOL_GPL();

ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
				struct kiocb *iocb, int flags,
				struct backing_file_ctx *ctx)
{}
EXPORT_SYMBOL_GPL();

ssize_t backing_file_splice_read(struct file *in, loff_t *ppos,
				 struct pipe_inode_info *pipe, size_t len,
				 unsigned int flags,
				 struct backing_file_ctx *ctx)
{}
EXPORT_SYMBOL_GPL();

ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
				  struct file *out, loff_t *ppos, size_t len,
				  unsigned int flags,
				  struct backing_file_ctx *ctx)
{}
EXPORT_SYMBOL_GPL();

int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
		      struct backing_file_ctx *ctx)
{}
EXPORT_SYMBOL_GPL();

static int __init backing_aio_init(void)
{}
fs_initcall(backing_aio_init);