#include <linux/fiemap.h>
#include <linux/fs.h>
#include <linux/minmax.h>
#include <linux/vmalloc.h>
#include "debug.h"
#include "ntfs.h"
#include "ntfs_fs.h"
#ifdef CONFIG_NTFS3_LZX_XPRESS
#include "lib/lib.h"
#endif
static struct mft_inode *ni_ins_mi(struct ntfs_inode *ni, struct rb_root *tree,
CLST ino, struct rb_node *ins)
{ … }
static struct mft_inode *ni_find_mi(struct ntfs_inode *ni, CLST rno)
{ … }
static void ni_add_mi(struct ntfs_inode *ni, struct mft_inode *mi)
{ … }
void ni_remove_mi(struct ntfs_inode *ni, struct mft_inode *mi)
{ … }
struct ATTR_STD_INFO *ni_std(struct ntfs_inode *ni)
{ … }
struct ATTR_STD_INFO5 *ni_std5(struct ntfs_inode *ni)
{ … }
void ni_clear(struct ntfs_inode *ni)
{ … }
int ni_load_mi_ex(struct ntfs_inode *ni, CLST rno, struct mft_inode **mi)
{ … }
int ni_load_mi(struct ntfs_inode *ni, const struct ATTR_LIST_ENTRY *le,
struct mft_inode **mi)
{ … }
struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
struct ATTR_LIST_ENTRY **le_o, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, const CLST *vcn,
struct mft_inode **mi)
{ … }
struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
struct ATTR_LIST_ENTRY **le,
struct mft_inode **mi)
{ … }
struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, CLST vcn,
struct mft_inode **pmi)
{ … }
int ni_load_all_mi(struct ntfs_inode *ni)
{ … }
bool ni_add_subrecord(struct ntfs_inode *ni, CLST rno, struct mft_inode **mi)
{ … }
int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, bool base_only,
const __le16 *id)
{ … }
static struct ATTRIB *
ni_ins_new_attr(struct ntfs_inode *ni, struct mft_inode *mi,
struct ATTR_LIST_ENTRY *le, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, u32 asize, u16 name_off,
CLST svcn, struct ATTR_LIST_ENTRY **ins_le)
{ … }
static int ni_repack(struct ntfs_inode *ni)
{ … }
static int ni_try_remove_attr_list(struct ntfs_inode *ni)
{ … }
int ni_create_attr_list(struct ntfs_inode *ni)
{ … }
static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
enum ATTR_TYPE type, const __le16 *name, u8 name_len,
u32 asize, CLST svcn, u16 name_off, bool force_ext,
struct ATTRIB **ins_attr, struct mft_inode **ins_mi,
struct ATTR_LIST_ENTRY **ins_le)
{ … }
static int ni_insert_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
const __le16 *name, u8 name_len, u32 asize,
u16 name_off, CLST svcn, struct ATTRIB **ins_attr,
struct mft_inode **ins_mi,
struct ATTR_LIST_ENTRY **ins_le)
{ … }
static int ni_expand_mft_list(struct ntfs_inode *ni)
{ … }
int ni_expand_list(struct ntfs_inode *ni)
{ … }
int ni_insert_nonresident(struct ntfs_inode *ni, enum ATTR_TYPE type,
const __le16 *name, u8 name_len,
const struct runs_tree *run, CLST svcn, CLST len,
__le16 flags, struct ATTRIB **new_attr,
struct mft_inode **mi, struct ATTR_LIST_ENTRY **le)
{ … }
int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
enum ATTR_TYPE type, const __le16 *name, u8 name_len,
struct ATTRIB **new_attr, struct mft_inode **mi,
struct ATTR_LIST_ENTRY **le)
{ … }
void ni_remove_attr_le(struct ntfs_inode *ni, struct ATTRIB *attr,
struct mft_inode *mi, struct ATTR_LIST_ENTRY *le)
{ … }
int ni_delete_all(struct ntfs_inode *ni)
{ … }
struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
const struct le_str *uni,
const struct MFT_REF *home_dir,
struct mft_inode **mi,
struct ATTR_LIST_ENTRY **le)
{ … }
struct ATTR_FILE_NAME *ni_fname_type(struct ntfs_inode *ni, u8 name_type,
struct mft_inode **mi,
struct ATTR_LIST_ENTRY **le)
{ … }
int ni_new_attr_flags(struct ntfs_inode *ni, enum FILE_ATTRIBUTE new_fa)
{ … }
enum REPARSE_SIGN ni_parse_reparse(struct ntfs_inode *ni, struct ATTRIB *attr,
struct REPARSE_DATA_BUFFER *buffer)
{ … }
static int fiemap_fill_next_extent_k(struct fiemap_extent_info *fieinfo,
u64 logical, u64 phys, u64 len, u32 flags)
{ … }
int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo,
__u64 vbo, __u64 len)
{ … }
int ni_readpage_cmpr(struct ntfs_inode *ni, struct folio *folio)
{ … }
#ifdef CONFIG_NTFS3_LZX_XPRESS
int ni_decompress_file(struct ntfs_inode *ni)
{ … }
static int decompress_lzx_xpress(struct ntfs_sb_info *sbi, const char *cmpr,
size_t cmpr_size, void *unc, size_t unc_size,
u32 frame_size)
{ … }
#endif
int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
u32 pages_per_frame)
{ … }
int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
u32 pages_per_frame)
{ … }
int ni_remove_name(struct ntfs_inode *dir_ni, struct ntfs_inode *ni,
struct NTFS_DE *de, struct NTFS_DE **de2, int *undo_step)
{ … }
bool ni_remove_name_undo(struct ntfs_inode *dir_ni, struct ntfs_inode *ni,
struct NTFS_DE *de, struct NTFS_DE *de2, int undo_step)
{ … }
int ni_add_name(struct ntfs_inode *dir_ni, struct ntfs_inode *ni,
struct NTFS_DE *de)
{ … }
int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
struct ntfs_inode *ni, struct NTFS_DE *de, struct NTFS_DE *new_de,
bool *is_bad)
{ … }
bool ni_is_dirty(struct inode *inode)
{ … }
static bool ni_update_parent(struct ntfs_inode *ni, struct NTFS_DUP_INFO *dup,
int sync)
{ … }
int ni_write_inode(struct inode *inode, int sync, const char *hint)
{ … }