linux/fs/ecryptfs/file.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * eCryptfs: Linux filesystem encryption layer
 *
 * Copyright (C) 1997-2004 Erez Zadok
 * Copyright (C) 2001-2004 Stony Brook University
 * Copyright (C) 2004-2007 International Business Machines Corp.
 *   Author(s): Michael A. Halcrow <[email protected]>
 *   		Michael C. Thompson <[email protected]>
 */

#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
#include <linux/security.h>
#include <linux/compat.h>
#include <linux/fs_stack.h>
#include "ecryptfs_kernel.h"

/*
 * ecryptfs_read_update_atime
 *
 * generic_file_read updates the atime of upper layer inode.  But, it
 * doesn't give us a chance to update the atime of the lower layer
 * inode.  This function is a wrapper to generic_file_read.  It
 * updates the atime of the lower level inode if generic_file_read
 * returns without any errors. This is to be used only for file reads.
 * The function to be used for directory reads is ecryptfs_read.
 */
static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
				struct iov_iter *to)
{}

/*
 * ecryptfs_splice_read_update_atime
 *
 * filemap_splice_read updates the atime of upper layer inode.  But, it
 * doesn't give us a chance to update the atime of the lower layer inode.  This
 * function is a wrapper to generic_file_read.  It updates the atime of the
 * lower level inode if generic_file_read returns without any errors. This is
 * to be used only for file reads.  The function to be used for directory reads
 * is ecryptfs_read.
 */
static ssize_t ecryptfs_splice_read_update_atime(struct file *in, loff_t *ppos,
						 struct pipe_inode_info *pipe,
						 size_t len, unsigned int flags)
{}

struct ecryptfs_getdents_callback {};

/* Inspired by generic filldir in fs/readdir.c */
static bool
ecryptfs_filldir(struct dir_context *ctx, const char *lower_name,
		 int lower_namelen, loff_t offset, u64 ino, unsigned int d_type)
{}

/**
 * ecryptfs_readdir
 * @file: The eCryptfs directory file
 * @ctx: The actor to feed the entries to
 */
static int ecryptfs_readdir(struct file *file, struct dir_context *ctx)
{}

struct kmem_cache *ecryptfs_file_info_cache;

static int read_or_initialize_metadata(struct dentry *dentry)
{}

static int ecryptfs_mmap(struct file *file, struct vm_area_struct *vma)
{}

/**
 * ecryptfs_open
 * @inode: inode specifying file to open
 * @file: Structure to return filled in
 *
 * Opens the file specified by inode.
 *
 * Returns zero on success; non-zero otherwise
 */
static int ecryptfs_open(struct inode *inode, struct file *file)
{}

/**
 * ecryptfs_dir_open
 * @inode: inode specifying file to open
 * @file: Structure to return filled in
 *
 * Opens the file specified by inode.
 *
 * Returns zero on success; non-zero otherwise
 */
static int ecryptfs_dir_open(struct inode *inode, struct file *file)
{}

static int ecryptfs_flush(struct file *file, fl_owner_t td)
{}

static int ecryptfs_release(struct inode *inode, struct file *file)
{}

static int ecryptfs_dir_release(struct inode *inode, struct file *file)
{}

static loff_t ecryptfs_dir_llseek(struct file *file, loff_t offset, int whence)
{}

static int
ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{}

static int ecryptfs_fasync(int fd, struct file *file, int flag)
{}

static long
ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}

#ifdef CONFIG_COMPAT
static long
ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}
#endif

const struct file_operations ecryptfs_dir_fops =;

const struct file_operations ecryptfs_main_fops =;