dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
fsys.h File Reference

(6c394a4c7)

#include <stdio.h>
#include <dpkg/file.h>
Include dependency graph for fsys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  file_ondisk_id
 Stores information to uniquely identify an on-disk file. More...
 
struct  fsys_namenode
 
struct  fsys_namenode_list
 
struct  fsys_namenode_queue
 Queue of fsys_namenode entries. More...
 
struct  fsys_diversion
 When we deal with an ‘overridden’ file, every package except the overriding one is considered to contain the other file instead. More...
 
struct  fsys_hash_rev_iter
 

Functions

struct fsys_node_pkgs_iterfsys_node_pkgs_iter_new (struct fsys_namenode *fnn)
 
struct pkginfofsys_node_pkgs_iter_next (struct fsys_node_pkgs_iter *iter)
 
void fsys_node_pkgs_iter_free (struct fsys_node_pkgs_iter *iter)
 
void fsys_hash_init (void)
 
void fsys_hash_reset (void)
 
void fsys_hash_report (FILE *file)
 
int fsys_hash_entries (void)
 
struct fsys_hash_iterfsys_hash_iter_new (void)
 
struct fsys_namenodefsys_hash_iter_next (struct fsys_hash_iter *iter)
 
void fsys_hash_iter_free (struct fsys_hash_iter *iter)
 
struct fsys_namenodefsys_hash_find_node (const char *filename, enum fsys_hash_find_flags flags)
 
void fsys_hash_rev_iter_init (struct fsys_hash_rev_iter *iter, struct fsys_namenode_list *files)
 
struct fsys_namenodefsys_hash_rev_iter_next (struct fsys_hash_rev_iter *iter)
 
void fsys_hash_rev_iter_abort (struct fsys_hash_rev_iter *iter)
 
const char * dpkg_fsys_set_dir (const char *dir)
 Set current on-disk filesystem root directory.
 
const char * dpkg_fsys_get_dir (void)
 Get current on-disk filesystem root directory.
 
char * dpkg_fsys_get_path (const char *pathpart)
 Get a pathname to the current on-disk filesystem root directory.
 

Variables

enum DPKG_ATTR_ENUM_FLAGS fsys_hash_find_flags
 Flags to fsys_hash_find_node().
 
 FHFF_NONE = 0
 No flags.
 
 FHFF_NO_COPY = DPKG_BIT(0)
 Do not need to copy filename.
 
 FHFF_NO_NEW = DPKG_BIT(1)
 Do not insert the item if it is not found, and return NULL.
 
enum DPKG_ATTR_ENUM_FLAGS fsys_namenode_flags
 
 FNNF_NONE = 0
 No flags.
 
 FNNF_NEW_CONFF = DPKG_BIT(0)
 In the newconffiles list.
 
 FNNF_NEW_INARCHIVE = DPKG_BIT(1)
 In the new filesystem archive.
 
 FNNF_OLD_CONFF = DPKG_BIT(2)
 In the old package's conffiles list.
 
 FNNF_OBS_CONFF = DPKG_BIT(3)
 Obsolete conffile.
 
 FNNF_ELIDE_OTHER_LISTS = DPKG_BIT(4)
 Must remove from other packages' lists.
 
 FNNF_NO_ATOMIC_OVERWRITE = DPKG_BIT(5)
 >= 1 instance is a dir, cannot rename over.
 
 FNNF_PLACED_ON_DISK = DPKG_BIT(6)
 New file has been placed on the disk.
 
 FNNF_DEFERRED_FSYNC = DPKG_BIT(7)
 
 FNNF_DEFERRED_RENAME = DPKG_BIT(8)
 
 FNNF_FILTERED = DPKG_BIT(9)
 Path being filtered.
 
 FNNF_RM_CONFF_ON_UPGRADE = DPKG_BIT(10)
 Conffile removal requested by upgrade.
 

Function Documentation

◆ dpkg_fsys_get_dir()

const char * dpkg_fsys_get_dir ( void  )

Get current on-disk filesystem root directory.

This function will take care of initializing the directory if it has not been initialized before.

Returns
The current filesystem root directory.

Referenced by archivefiles(), conffderef(), dpkg_fsys_get_path(), and main().

Here is the caller graph for this function:

◆ dpkg_fsys_get_path()

char * dpkg_fsys_get_path ( const char *  pathpart)

Get a pathname to the current on-disk filesystem root directory.

This function returns an allocated string, which should be freed with free(2).

Parameters
pathpartThe pathpart to append to the new pathname.
Returns
The newly allocated pathname.

References dpkg_fsys_get_dir(), path_skip_slash_dotslash(), and str_fmt().

Referenced by set_root().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpkg_fsys_set_dir()

const char * dpkg_fsys_set_dir ( const char *  dir)

Set current on-disk filesystem root directory.

This function can be used to set the directory to a new value, or to reset it to a default value if dir is NULL.

Parameters
dirThe new filesystem root directory, or NULL to set to default.
Returns
The new filesystem root directory.

References m_strdup(), and path_trim_slash_slashdot().

Referenced by set_instdir(), and set_root().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fsys_hash_entries()

int fsys_hash_entries ( void  )

Referenced by ensure_allinstfiles_available().

Here is the caller graph for this function:

◆ fsys_hash_find_node()

struct fsys_namenode * fsys_hash_find_node ( const char *  filename,
enum fsys_hash_find_flags  flags 
)

References BINS, FHFF_NO_COPY, FHFF_NO_NEW, fsys_namenode::flags, internerr, fsys_namenode::name, fsys_namenode::next, nfmalloc(), path_skip_slash_dotslash(), and str_fnv_hash().

Referenced by ensure_diversions(), ensure_statoverrides(), pkg_conffiles_mark_old(), and tarobject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fsys_hash_init()

void fsys_hash_init ( void  )

References BINS, fsys_namenode::file_ondisk_id, fsys_namenode::flags, fsys_namenode::newhash, fsys_namenode::next, and fsys_namenode::oldhash.

Referenced by deferred_remove(), and process_archive().

Here is the caller graph for this function:

◆ fsys_hash_iter_free()

void fsys_hash_iter_free ( struct fsys_hash_iter iter)

Referenced by ensure_statoverrides().

Here is the caller graph for this function:

◆ fsys_hash_iter_new()

struct fsys_hash_iter * fsys_hash_iter_new ( void  )

References m_malloc(), fsys_hash_iter::namenode, and fsys_hash_iter::nbinn.

Referenced by ensure_statoverrides().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fsys_hash_iter_next()

struct fsys_namenode * fsys_hash_iter_next ( struct fsys_hash_iter iter)

References BINS, fsys_hash_iter::namenode, fsys_hash_iter::nbinn, and fsys_namenode::next.

Referenced by ensure_statoverrides().

Here is the caller graph for this function:

◆ fsys_hash_report()

void fsys_hash_report ( FILE *  file)

References BINS, m_malloc(), m_output(), and fsys_namenode::next.

Here is the call graph for this function:

◆ fsys_hash_reset()

void fsys_hash_reset ( void  )

Referenced by commandfd().

Here is the caller graph for this function:

◆ fsys_hash_rev_iter_abort()

void fsys_hash_rev_iter_abort ( struct fsys_hash_rev_iter iter)

References fsys_hash_rev_iter_next().

Here is the call graph for this function:

◆ fsys_hash_rev_iter_init()

void fsys_hash_rev_iter_init ( struct fsys_hash_rev_iter iter,
struct fsys_namenode_list files 
)

References m_malloc(), fsys_namenode_list::namenode, fsys_namenode_list::next, and fsys_hash_rev_iter::todo.

Here is the call graph for this function:

◆ fsys_hash_rev_iter_next()

struct fsys_namenode * fsys_hash_rev_iter_next ( struct fsys_hash_rev_iter iter)

References fsys_namenode_list::namenode, fsys_namenode::next, fsys_namenode_list::next, and fsys_hash_rev_iter::todo.

Referenced by fsys_hash_rev_iter_abort().

Here is the caller graph for this function:

◆ fsys_node_pkgs_iter_free()

void fsys_node_pkgs_iter_free ( struct fsys_node_pkgs_iter iter)

Referenced by dir_is_used_by_others(), filesavespackage(), and tarobject().

Here is the caller graph for this function:

◆ fsys_node_pkgs_iter_new()

struct fsys_node_pkgs_iter * fsys_node_pkgs_iter_new ( struct fsys_namenode fnn)

References m_malloc(), fsys_namenode::packages, and fsys_node_pkgs_iter::pkg_node.

Referenced by dir_is_used_by_others(), filesavespackage(), and tarobject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fsys_node_pkgs_iter_next()

struct pkginfo * fsys_node_pkgs_iter_next ( struct fsys_node_pkgs_iter iter)

References pkg_list::next, pkg_list::pkg, and fsys_node_pkgs_iter::pkg_node.

Referenced by dir_is_used_by_others(), filesavespackage(), and tarobject().

Here is the caller graph for this function:

Variable Documentation

◆ FHFF_NO_COPY

FHFF_NO_COPY = DPKG_BIT(0)

Do not need to copy filename.

Referenced by fsys_hash_find_node().

◆ FHFF_NO_NEW

FHFF_NO_NEW = DPKG_BIT(1)

Do not insert the item if it is not found, and return NULL.

Referenced by fsys_hash_find_node().

◆ FHFF_NONE

FHFF_NONE = 0

◆ FNNF_DEFERRED_FSYNC

FNNF_DEFERRED_FSYNC = DPKG_BIT(7)

Referenced by tar_deferred_extract().

◆ FNNF_DEFERRED_RENAME

FNNF_DEFERRED_RENAME = DPKG_BIT(8)

Referenced by tar_deferred_extract(), and tarobject().

◆ FNNF_ELIDE_OTHER_LISTS

FNNF_ELIDE_OTHER_LISTS = DPKG_BIT(4)

Must remove from other packages' lists.

Referenced by tar_deferred_extract(), and tarobject().

◆ FNNF_FILTERED

FNNF_FILTERED = DPKG_BIT(9)

Path being filtered.

Referenced by tarobject().

◆ FNNF_NEW_CONFF

FNNF_NEW_CONFF = DPKG_BIT(0)

In the newconffiles list.

Referenced by cu_installnew(), and tarobject().

◆ FNNF_NEW_INARCHIVE

FNNF_NEW_INARCHIVE = DPKG_BIT(1)

In the new filesystem archive.

Referenced by filesavespackage(), and tarobject().

◆ FNNF_NO_ATOMIC_OVERWRITE

FNNF_NO_ATOMIC_OVERWRITE = DPKG_BIT(5)

>= 1 instance is a dir, cannot rename over.

Referenced by cu_installnew(), and tarobject().

◆ FNNF_NONE

FNNF_NONE = 0

No flags.

◆ FNNF_OBS_CONFF

FNNF_OBS_CONFF = DPKG_BIT(3)

Obsolete conffile.

Referenced by tarobject().

◆ FNNF_OLD_CONFF

FNNF_OLD_CONFF = DPKG_BIT(2)

In the old package's conffiles list.

Referenced by pkg_conffiles_mark_old().

◆ FNNF_PLACED_ON_DISK

FNNF_PLACED_ON_DISK = DPKG_BIT(6)

New file has been placed on the disk.

Referenced by cu_installnew(), tar_deferred_extract(), and tarobject().

◆ FNNF_RM_CONFF_ON_UPGRADE

FNNF_RM_CONFF_ON_UPGRADE = DPKG_BIT(10)

Conffile removal requested by upgrade.

Referenced by tarobject().

◆ fsys_hash_find_flags

enum DPKG_ATTR_ENUM_FLAGS fsys_hash_find_flags

◆ fsys_namenode_flags

enum DPKG_ATTR_ENUM_FLAGS fsys_namenode_flags