Android-cuttlefish cvd tool
Functions
dir.c File Reference
#include "fsck.h"
#include "node.h"
#include <search.h>
Include dependency graph for dir.c:

Functions

static int room_for_filename (const u8 *bitmap, int slots, int max_slots)
 
void make_dentry_ptr (struct f2fs_dentry_ptr *d, struct f2fs_node *node_blk, void *src, int type)
 
static struct f2fs_dir_entryfind_target_dentry (const u8 *name, unsigned int len, f2fs_hash_t namehash, int *max_slots, struct f2fs_dentry_ptr *d)
 
static struct f2fs_dir_entryfind_in_block (void *block, const u8 *name, int len, f2fs_hash_t namehash, int *max_slots)
 
static int find_in_level (struct f2fs_sb_info *sbi, struct f2fs_node *dir, unsigned int level, struct dentry *de)
 
static int f2fs_find_entry (struct f2fs_sb_info *sbi, struct f2fs_node *dir, struct dentry *de)
 
nid_t f2fs_lookup (struct f2fs_sb_info *sbi, struct f2fs_node *dir, u8 *name, int len)
 
static void f2fs_update_dentry (nid_t ino, int file_type, struct f2fs_dentry_ptr *d, const unsigned char *name, int len, f2fs_hash_t name_hash, unsigned int bit_pos)
 
int f2fs_add_link (struct f2fs_sb_info *sbi, struct f2fs_node *parent, const unsigned char *name, int name_len, nid_t ino, int file_type, block_t *p_blkaddr, int inc_link)
 
static void make_empty_dir (struct f2fs_sb_info *sbi, struct f2fs_node *inode)
 
static void page_symlink (struct f2fs_sb_info *sbi, struct f2fs_node *inode, const char *symname, int symlen)
 
static int is_extension_exist (const char *s, const char *sub)
 
static void set_file_temperature (struct f2fs_sb_info *sbi, struct f2fs_node *node_blk, const unsigned char *name)
 
static void init_inode_block (struct f2fs_sb_info *sbi, struct f2fs_node *node_blk, struct dentry *de)
 
int convert_inline_dentry (struct f2fs_sb_info *sbi, struct f2fs_node *node, block_t *p_blkaddr)
 
static int cmp_from_devino (const void *a, const void *b)
 
struct hardlink_cache_entryf2fs_search_hardlink (struct f2fs_sb_info *sbi, struct dentry *de)
 
int f2fs_create (struct f2fs_sb_info *sbi, struct dentry *de)
 
int f2fs_mkdir (struct f2fs_sb_info *sbi, struct dentry *de)
 
int f2fs_symlink (struct f2fs_sb_info *sbi, struct dentry *de)
 
int f2fs_find_path (struct f2fs_sb_info *sbi, char *path, nid_t *ino)
 

Function Documentation

◆ cmp_from_devino()

static int cmp_from_devino ( const void *  a,
const void *  b 
)
static

◆ convert_inline_dentry()

int convert_inline_dentry ( struct f2fs_sb_info sbi,
struct f2fs_node node,
block_t p_blkaddr 
)

◆ f2fs_add_link()

int f2fs_add_link ( struct f2fs_sb_info sbi,
struct f2fs_node parent,
const unsigned char *  name,
int  name_len,
nid_t  ino,
int  file_type,
block_t p_blkaddr,
int  inc_link 
)

◆ f2fs_create()

int f2fs_create ( struct f2fs_sb_info sbi,
struct dentry de 
)

◆ f2fs_find_entry()

static int f2fs_find_entry ( struct f2fs_sb_info sbi,
struct f2fs_node dir,
struct dentry de 
)
static

◆ f2fs_find_path()

int f2fs_find_path ( struct f2fs_sb_info sbi,
char *  path,
nid_t ino 
)

◆ f2fs_lookup()

nid_t f2fs_lookup ( struct f2fs_sb_info sbi,
struct f2fs_node dir,
u8 name,
int  len 
)

◆ f2fs_mkdir()

int f2fs_mkdir ( struct f2fs_sb_info sbi,
struct dentry de 
)

◆ f2fs_search_hardlink()

struct hardlink_cache_entry * f2fs_search_hardlink ( struct f2fs_sb_info sbi,
struct dentry de 
)

◆ f2fs_symlink()

int f2fs_symlink ( struct f2fs_sb_info sbi,
struct dentry de 
)

◆ f2fs_update_dentry()

static void f2fs_update_dentry ( nid_t  ino,
int  file_type,
struct f2fs_dentry_ptr d,
const unsigned char *  name,
int  len,
f2fs_hash_t  name_hash,
unsigned int  bit_pos 
)
static

◆ find_in_block()

static struct f2fs_dir_entry * find_in_block ( void *  block,
const u8 name,
int  len,
f2fs_hash_t  namehash,
int *  max_slots 
)
static

◆ find_in_level()

static int find_in_level ( struct f2fs_sb_info sbi,
struct f2fs_node dir,
unsigned int  level,
struct dentry de 
)
static

◆ find_target_dentry()

static struct f2fs_dir_entry * find_target_dentry ( const u8 name,
unsigned int  len,
f2fs_hash_t  namehash,
int *  max_slots,
struct f2fs_dentry_ptr d 
)
static

◆ init_inode_block()

static void init_inode_block ( struct f2fs_sb_info sbi,
struct f2fs_node node_blk,
struct dentry de 
)
static

◆ is_extension_exist()

static int is_extension_exist ( const char *  s,
const char *  sub 
)
inlinestatic

◆ make_dentry_ptr()

void make_dentry_ptr ( struct f2fs_dentry_ptr d,
struct f2fs_node node_blk,
void *  src,
int  type 
)

◆ make_empty_dir()

static void make_empty_dir ( struct f2fs_sb_info sbi,
struct f2fs_node inode 
)
static

◆ page_symlink()

static void page_symlink ( struct f2fs_sb_info sbi,
struct f2fs_node inode,
const char *  symname,
int  symlen 
)
static

◆ room_for_filename()

static int room_for_filename ( const u8 bitmap,
int  slots,
int  max_slots 
)
static

dir.c

Many parts of codes are copied from Linux kernel/fs/f2fs.

Copyright (C) 2015 Huawei Ltd. Witten by: Hou Pengyang houpe.nosp@m.ngya.nosp@m.ng@hu.nosp@m.awei.nosp@m..com Liu Shuoran liush.nosp@m.uora.nosp@m.n@hua.nosp@m.wei..nosp@m.com Jaegeuk Kim jaege.nosp@m.uk@k.nosp@m.ernel.nosp@m..org

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

◆ set_file_temperature()

static void set_file_temperature ( struct f2fs_sb_info sbi,
struct f2fs_node node_blk,
const unsigned char *  name 
)
static