linux/fs/fat/file.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  linux/fs/fat/file.c
 *
 *  Written 1992,1993 by Werner Almesberger
 *
 *  regular file handling primitives for fat-based filesystems
 */

#include <linux/capability.h>
#include <linux/module.h>
#include <linux/compat.h>
#include <linux/mount.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/fsnotify.h>
#include <linux/security.h>
#include <linux/falloc.h>
#include "fat.h"

static long fat_fallocate(struct file *file, int mode,
			  loff_t offset, loff_t len);

static int fat_ioctl_get_attributes(struct inode *inode, u32 __user *user_attr)
{}

static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
{}

static int fat_ioctl_get_volume_id(struct inode *inode, u32 __user *user_attr)
{}

static int fat_ioctl_fitrim(struct inode *inode, unsigned long arg)
{}

long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{}

static int fat_file_release(struct inode *inode, struct file *filp)
{}

int fat_file_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
{}


const struct file_operations fat_file_operations =;

static int fat_cont_expand(struct inode *inode, loff_t size)
{}

/*
 * Preallocate space for a file. This implements fat's fallocate file
 * operation, which gets called from sys_fallocate system call. User
 * space requests len bytes at offset. If FALLOC_FL_KEEP_SIZE is set
 * we just allocate clusters without zeroing them out. Otherwise we
 * allocate and zero out clusters via an expanding truncate.
 */
static long fat_fallocate(struct file *file, int mode,
			  loff_t offset, loff_t len)
{}

/* Free all clusters after the skip'th cluster. */
static int fat_free(struct inode *inode, int skip)
{}

void fat_truncate_blocks(struct inode *inode, loff_t offset)
{}

int fat_getattr(struct mnt_idmap *idmap, const struct path *path,
		struct kstat *stat, u32 request_mask, unsigned int flags)
{}
EXPORT_SYMBOL_GPL();

static int fat_sanitize_mode(const struct msdos_sb_info *sbi,
			     struct inode *inode, umode_t *mode_ptr)
{}

static int fat_allow_set_time(struct mnt_idmap *idmap,
			      struct msdos_sb_info *sbi, struct inode *inode)
{}

#define TIMES_SET_FLAGS
/* valid file mode bits */
#define FAT_VALID_MODE

int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
		struct iattr *attr)
{}
EXPORT_SYMBOL_GPL();

const struct inode_operations fat_file_inode_operations =;