#include <linux/iomap.h>
#include <linux/fiemap.h>
#include <linux/namei.h>
#include <linux/iversion.h>
#include <linux/sched/mm.h>
#include "ext4_jbd2.h"
#include "ext4.h"
#include "xattr.h"
#include "truncate.h"
#define EXT4_XATTR_SYSTEM_DATA …
#define EXT4_MIN_INLINE_DATA_SIZE …
#define EXT4_INLINE_DOTDOT_OFFSET …
#define EXT4_INLINE_DOTDOT_SIZE …
static int ext4_get_inline_size(struct inode *inode)
{ … }
static int get_max_inline_xattr_value_size(struct inode *inode,
struct ext4_iloc *iloc)
{ … }
int ext4_get_max_inline_size(struct inode *inode)
{ … }
int ext4_find_inline_data_nolock(struct inode *inode)
{ … }
static int ext4_read_inline_data(struct inode *inode, void *buffer,
unsigned int len,
struct ext4_iloc *iloc)
{ … }
static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
void *buffer, loff_t pos, unsigned int len)
{ … }
static int ext4_create_inline_data(handle_t *handle,
struct inode *inode, unsigned len)
{ … }
static int ext4_update_inline_data(handle_t *handle, struct inode *inode,
unsigned int len)
{ … }
static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
unsigned int len)
{ … }
static int ext4_destroy_inline_data_nolock(handle_t *handle,
struct inode *inode)
{ … }
static int ext4_read_inline_folio(struct inode *inode, struct folio *folio)
{ … }
int ext4_readpage_inline(struct inode *inode, struct folio *folio)
{ … }
static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
struct inode *inode)
{ … }
int ext4_try_to_write_inline_data(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
struct folio **foliop)
{ … }
int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
unsigned copied, struct folio *folio)
{ … }
static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
struct inode *inode,
void **fsdata)
{ … }
int ext4_da_write_inline_data_begin(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
struct folio **foliop,
void **fsdata)
{ … }
#ifdef INLINE_DIR_DEBUG
void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,
void *inline_start, int inline_size)
{
int offset;
unsigned short de_len;
struct ext4_dir_entry_2 *de = inline_start;
void *dlimit = inline_start + inline_size;
trace_printk("inode %lu\n", dir->i_ino);
offset = 0;
while ((void *)de < dlimit) {
de_len = ext4_rec_len_from_disk(de->rec_len, inline_size);
trace_printk("de: off %u rlen %u name %.*s nlen %u ino %u\n",
offset, de_len, de->name_len, de->name,
de->name_len, le32_to_cpu(de->inode));
if (ext4_check_dir_entry(dir, NULL, de, bh,
inline_start, inline_size, offset))
BUG();
offset += de_len;
de = (struct ext4_dir_entry_2 *) ((char *) de + de_len);
}
}
#else
#define ext4_show_inline_dir(dir, bh, inline_start, inline_size) …
#endif
static int ext4_add_dirent_to_inline(handle_t *handle,
struct ext4_filename *fname,
struct inode *dir,
struct inode *inode,
struct ext4_iloc *iloc,
void *inline_start, int inline_size)
{ … }
static void *ext4_get_inline_xattr_pos(struct inode *inode,
struct ext4_iloc *iloc)
{ … }
static void ext4_update_final_de(void *de_buf, int old_size, int new_size)
{ … }
static int ext4_update_inline_dir(handle_t *handle, struct inode *dir,
struct ext4_iloc *iloc)
{ … }
static void ext4_restore_inline_data(handle_t *handle, struct inode *inode,
struct ext4_iloc *iloc,
void *buf, int inline_size)
{ … }
static int ext4_finish_convert_inline_dir(handle_t *handle,
struct inode *inode,
struct buffer_head *dir_block,
void *buf,
int inline_size)
{ … }
static int ext4_convert_inline_data_nolock(handle_t *handle,
struct inode *inode,
struct ext4_iloc *iloc)
{ … }
int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname,
struct inode *dir, struct inode *inode)
{ … }
int ext4_inlinedir_to_tree(struct file *dir_file,
struct inode *dir, ext4_lblk_t block,
struct dx_hash_info *hinfo,
__u32 start_hash, __u32 start_minor_hash,
int *has_inline_data)
{ … }
int ext4_read_inline_dir(struct file *file,
struct dir_context *ctx,
int *has_inline_data)
{ … }
void *ext4_read_inline_link(struct inode *inode)
{ … }
struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
struct ext4_dir_entry_2 **parent_de,
int *retval)
{ … }
int ext4_try_create_inline_dir(handle_t *handle, struct inode *parent,
struct inode *inode)
{ … }
struct buffer_head *ext4_find_inline_entry(struct inode *dir,
struct ext4_filename *fname,
struct ext4_dir_entry_2 **res_dir,
int *has_inline_data)
{ … }
int ext4_delete_inline_entry(handle_t *handle,
struct inode *dir,
struct ext4_dir_entry_2 *de_del,
struct buffer_head *bh,
int *has_inline_data)
{ … }
static inline struct ext4_dir_entry_2 *
ext4_get_inline_entry(struct inode *inode,
struct ext4_iloc *iloc,
unsigned int offset,
void **inline_start,
int *inline_size)
{ … }
bool empty_inline_dir(struct inode *dir, int *has_inline_data)
{ … }
int ext4_destroy_inline_data(handle_t *handle, struct inode *inode)
{ … }
int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap)
{ … }
int ext4_inline_data_truncate(struct inode *inode, int *has_inline)
{ … }
int ext4_convert_inline_data(struct inode *inode)
{ … }