rpm  5.4.15
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
iosm.h File Reference

File state machine to handle archive I/O and system call's. More...

#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmsw.h>
Include dependency graph for iosm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hardLink_s
 Keeps track of the set of all hard links to a file in an archive. More...
 
struct  iosmIterator_s
 Iterator across package file info, forward on install, backward on erase. More...
 
struct  iosm_s
 File name and stat information. More...
 

Macros

#define _IOSM_INTERNAL   /* XXX expose internals for unit tests. */
 
#define IOSMERR_CHECK_ERRNO   0x00008000
 
#define IOSM_VERBOSE   0x8000
 
#define IOSM_INTERNAL   0x4000
 
#define IOSM_SYSCALL   0x2000
 
#define IOSM_DEAD   0x1000
 
#define _fv(_a)   ((_a) | IOSM_VERBOSE)
 
#define _fi(_a)   ((_a) | IOSM_INTERNAL)
 
#define _fs(_a)   ((_a) | (IOSM_INTERNAL | IOSM_SYSCALL))
 
#define _fd(_a)   ((_a) | (IOSM_INTERNAL | IOSM_DEAD))
 

Typedefs

typedef struct iosm_sIOSM_t
 File state machine data. More...
 
typedef enum iosmFileAction_e iosmFileAction
 File disposition(s) during package install/erase processing. More...
 
typedef enum iosmMapFlags_e iosmMapFlags
 
typedef enum iosmFileStage_e iosmFileStage
 
typedef struct iosmIterator_sIOSMI_t
 Iterator across package file info, forward on install, backward on erase. More...
 

Enumerations

enum  iosmFileAction_e {
  FA_UNKNOWN = 0, FA_CREATE, FA_COPYIN, FA_COPYOUT,
  FA_BACKUP, FA_SAVE, FA_SKIP, FA_ALTNAME,
  FA_ERASE, FA_SKIPNSTATE, FA_SKIPNETSHARED, FA_SKIPCOLOR
}
 File disposition(s) during package install/erase processing. More...
 
enum  iosmMapFlags_e {
  IOSM_MAP_PATH = (1 << 0), IOSM_MAP_MODE = (1 << 1), IOSM_MAP_UID = (1 << 2), IOSM_MAP_GID = (1 << 3),
  IOSM_FOLLOW_SYMLINKS = (1 << 4), IOSM_MAP_ABSOLUTE = (1 << 5), IOSM_MAP_ADDDOT = (1 << 6), IOSM_ALL_HARDLINKS = (1 << 7),
  IOSM_MAP_TYPE = (1 << 8), IOSM_SBIT_CHECK = (1 << 9), IOSM_PAYLOAD_LIST = (1 << 10), IOSM_PAYLOAD_EXTRACT = (1 << 11),
  IOSM_PAYLOAD_CREATE = (1 << 12)
}
 
enum  iosmErrorReturns_e {
  IOSMERR_BAD_MAGIC = (2 ), IOSMERR_BAD_HEADER = (3 ), IOSMERR_OPEN_FAILED = (4 | 0x00008000 ), IOSMERR_CHMOD_FAILED = (5 | 0x00008000 ),
  IOSMERR_CHOWN_FAILED = (6 | 0x00008000 ), IOSMERR_WRITE_FAILED = (7 | 0x00008000 ), IOSMERR_UTIME_FAILED = (8 | 0x00008000 ), IOSMERR_UNLINK_FAILED = (9 | 0x00008000 ),
  IOSMERR_RENAME_FAILED = (10 | 0x00008000 ), IOSMERR_SYMLINK_FAILED = (11 | 0x00008000 ), IOSMERR_STAT_FAILED = (12 | 0x00008000 ), IOSMERR_LSTAT_FAILED = (13 | 0x00008000 ),
  IOSMERR_MKDIR_FAILED = (14 | 0x00008000 ), IOSMERR_RMDIR_FAILED = (15 | 0x00008000 ), IOSMERR_MKNOD_FAILED = (16 | 0x00008000 ), IOSMERR_MKFIFO_FAILED = (17 | 0x00008000 ),
  IOSMERR_LINK_FAILED = (18 | 0x00008000 ), IOSMERR_READLINK_FAILED = (19 | 0x00008000 ), IOSMERR_READ_FAILED = (20 | 0x00008000 ), IOSMERR_COPY_FAILED = (21 | 0x00008000 ),
  IOSMERR_LSETFCON_FAILED = (22 | 0x00008000 ), IOSMERR_HDR_SIZE = (23 ), IOSMERR_HDR_TRAILER = (24 ), IOSMERR_UNKNOWN_FILETYPE = (25 ),
  IOSMERR_MISSING_HARDLINK = (26 ), IOSMERR_DIGEST_MISMATCH = (27 ), IOSMERR_INTERNAL = (28 ), IOSMERR_UNMAPPED_FILE = (29 ),
  IOSMERR_ENOENT = (30 ), IOSMERR_ENOTEMPTY = (31 )
}
 
enum  iosmFileStage_e {
  IOSM_UNKNOWN = 0, IOSM_INIT = (( 1 ) | ( 0x4000 | 0x1000 )), IOSM_PRE = (( 2 ) | ( 0x4000 | 0x1000 )), IOSM_PROCESS = (( 3 ) | 0x8000 ),
  IOSM_POST = (( 4 ) | ( 0x4000 | 0x1000 )), IOSM_UNDO = 5, IOSM_FINI = 6, IOSM_PKGINSTALL = (( 7 ) | ( 0x4000 | 0x1000 )),
  IOSM_PKGERASE = (( 8 ) | ( 0x4000 | 0x1000 )), IOSM_PKGBUILD = (( 9 ) | ( 0x4000 | 0x1000 )), IOSM_PKGCOMMIT = (( 10 ) | ( 0x4000 | 0x1000 )), IOSM_PKGUNDO = (( 11 ) | ( 0x4000 | 0x1000 )),
  IOSM_CREATE = (( 17 ) | ( 0x4000 | 0x1000 )), IOSM_MAP = (( 18 ) | ( 0x4000 | 0x1000 )), IOSM_MKDIRS = (( 19 ) | 0x4000 ), IOSM_RMDIRS = (( 20 ) | 0x4000 ),
  IOSM_MKLINKS = (( 21 ) | 0x4000 ), IOSM_NOTIFY = (( 22 ) | ( 0x4000 | 0x1000 )), IOSM_DESTROY = (( 23 ) | ( 0x4000 | 0x1000 )), IOSM_VERIFY = (( 24 ) | ( 0x4000 | 0x1000 )),
  IOSM_COMMIT = (( 25 ) | ( 0x4000 | 0x1000 )), IOSM_UNLINK = (( 33 ) | ( 0x4000 | 0x2000 )), IOSM_RENAME = (( 34 ) | ( 0x4000 | 0x2000 )), IOSM_MKDIR = (( 35 ) | ( 0x4000 | 0x2000 )),
  IOSM_RMDIR = (( 36 ) | ( 0x4000 | 0x2000 )), IOSM_LSETFCON = (( 39 ) | ( 0x4000 | 0x2000 )), IOSM_CHOWN = (( 40 ) | ( 0x4000 | 0x2000 )), IOSM_LCHOWN = (( 41 ) | ( 0x4000 | 0x2000 )),
  IOSM_CHMOD = (( 42 ) | ( 0x4000 | 0x2000 )), IOSM_UTIME = (( 43 ) | ( 0x4000 | 0x2000 )), IOSM_SYMLINK = (( 44 ) | ( 0x4000 | 0x2000 )), IOSM_LINK = (( 45 ) | ( 0x4000 | 0x2000 )),
  IOSM_MKFIFO = (( 46 ) | ( 0x4000 | 0x2000 )), IOSM_MKNOD = (( 47 ) | ( 0x4000 | 0x2000 )), IOSM_LSTAT = (( 48 ) | ( 0x4000 | 0x2000 )), IOSM_STAT = (( 49 ) | ( 0x4000 | 0x2000 )),
  IOSM_READLINK = (( 50 ) | ( 0x4000 | 0x2000 )), IOSM_CHROOT = (( 51 ) | ( 0x4000 | 0x2000 )), IOSM_NEXT = (( 65 ) | ( 0x4000 | 0x1000 )), IOSM_EAT = (( 66 ) | ( 0x4000 | 0x1000 )),
  IOSM_POS = (( 67 ) | ( 0x4000 | 0x1000 )), IOSM_PAD = (( 68 ) | ( 0x4000 | 0x1000 )), IOSM_TRAILER = (( 69 ) | ( 0x4000 | 0x1000 )), IOSM_HREAD = (( 70 ) | ( 0x4000 | 0x1000 )),
  IOSM_HWRITE = (( 71 ) | ( 0x4000 | 0x1000 )), IOSM_DREAD = (( 72 ) | ( 0x4000 | 0x2000 )), IOSM_DWRITE = (( 73 ) | ( 0x4000 | 0x2000 )), IOSM_ROPEN = (( 129 ) | ( 0x4000 | 0x2000 )),
  IOSM_READ = (( 130 ) | ( 0x4000 | 0x2000 )), IOSM_RCLOSE = (( 131 ) | ( 0x4000 | 0x2000 )), IOSM_WOPEN = (( 132 ) | ( 0x4000 | 0x2000 )), IOSM_WRITE = (( 133 ) | ( 0x4000 | 0x2000 )),
  IOSM_WCLOSE = (( 134 ) | ( 0x4000 | 0x2000 ))
}
 

Functions

const char * iosmFileStageString (iosmFileStage a)
 Return formatted string representation of file stages. More...
 
const char * iosmFileActionString (iosmFileAction a)
 Return formatted string representation of file disposition. More...
 
char * iosmStrerror (int rc)
 Return formatted error message on payload handling failure. More...
 
IOSM_t newIOSM (void)
 Create I/O state machine instance. More...
 
IOSM_t freeIOSM (IOSM_t iosm)
 Destroy I/O state machine instance. More...
 
int iosmSetup (IOSM_t iosm, iosmFileStage goal, const char *afmt, const void *_ts, const void *_fi, FD_t cfd, unsigned int *archiveSize, const char **failedFile)
 Load external data into I/O state machine. More...
 
int iosmTeardown (IOSM_t iosm)
 Clean I/O state machine. More...
 
void * iosmGetTs (const IOSM_t iosm)
 Retrieve transaction set from I/O state machine iterator. More...
 
void * iosmGetFi (const IOSM_t iosm)
 Retrieve transaction element file info from I/O state machine iterator. More...
 
int iosmMapPath (IOSM_t iosm)
 Map next file path and action. More...
 
int iosmMapAttrs (IOSM_t iosm)
 Map file stat(2) info. More...
 
int iosmFileActionSkipped (iosmFileAction action)
 Is the file going to be skipped? More...
 
int iosmNext (IOSM_t iosm, iosmFileStage nstage)
 File state machine driver. More...
 
int iosmStage (IOSM_t iosm, iosmFileStage stage)
 File state machine driver. More...
 

Variables

int _iosm_debug
 
int(* _iosmNext )(IOSM_t iosm, iosmFileStage nstage)
 Vector to iosmNext. More...
 

Detailed Description

File state machine to handle archive I/O and system call's.

Definition in file iosm.h.

Macro Definition Documentation

#define _fd (   _a)    ((_a) | (IOSM_INTERNAL | IOSM_DEAD))

Definition at line 113 of file iosm.h.

#define _fi (   _a)    ((_a) | IOSM_INTERNAL)

Definition at line 111 of file iosm.h.

#define _fs (   _a)    ((_a) | (IOSM_INTERNAL | IOSM_SYSCALL))

Definition at line 112 of file iosm.h.

#define _fv (   _a)    ((_a) | IOSM_VERBOSE)

Definition at line 110 of file iosm.h.

#define _IOSM_INTERNAL   /* XXX expose internals for unit tests. */

Definition at line 9 of file iosm.h.

#define IOSM_DEAD   0x1000

Definition at line 108 of file iosm.h.

Referenced by fsmStage(), and iosmStage().

#define IOSM_INTERNAL   0x4000

Definition at line 106 of file iosm.h.

Referenced by fsmStage(), and iosmStage().

#define IOSM_SYSCALL   0x2000

Definition at line 107 of file iosm.h.

Referenced by fsmStage(), and iosmStage().

#define IOSM_VERBOSE   0x8000

Definition at line 105 of file iosm.h.

Referenced by fsmStage(), and iosmStage().

#define IOSMERR_CHECK_ERRNO   0x00008000
Note
IOSM_CHECK_ERRNO bit is set only if errno is valid.

Definition at line 64 of file iosm.h.

Referenced by iosmStrerror().

Typedef Documentation

typedef struct iosm_s* IOSM_t

File state machine data.

Definition at line 17 of file iosm.h.

File disposition(s) during package install/erase processing.

typedef struct iosmIterator_s* IOSMI_t

Iterator across package file info, forward on install, backward on erase.

Definition at line 184 of file iosm.h.

Enumeration Type Documentation

Enumerator
IOSMERR_BAD_MAGIC 
IOSMERR_BAD_HEADER 
IOSMERR_OPEN_FAILED 
IOSMERR_CHMOD_FAILED 
IOSMERR_CHOWN_FAILED 
IOSMERR_WRITE_FAILED 
IOSMERR_UTIME_FAILED 
IOSMERR_UNLINK_FAILED 
IOSMERR_RENAME_FAILED 
IOSMERR_SYMLINK_FAILED 
IOSMERR_STAT_FAILED 
IOSMERR_LSTAT_FAILED 
IOSMERR_MKDIR_FAILED 
IOSMERR_RMDIR_FAILED 
IOSMERR_MKNOD_FAILED 
IOSMERR_MKFIFO_FAILED 
IOSMERR_LINK_FAILED 
IOSMERR_READLINK_FAILED 
IOSMERR_READ_FAILED 
IOSMERR_COPY_FAILED 
IOSMERR_LSETFCON_FAILED 
IOSMERR_HDR_SIZE 
IOSMERR_HDR_TRAILER 
IOSMERR_UNKNOWN_FILETYPE 
IOSMERR_MISSING_HARDLINK 
IOSMERR_DIGEST_MISMATCH 
IOSMERR_INTERNAL 
IOSMERR_UNMAPPED_FILE 
IOSMERR_ENOENT 
IOSMERR_ENOTEMPTY 

Definition at line 68 of file iosm.h.

File disposition(s) during package install/erase processing.

Enumerator
FA_UNKNOWN 

initial action for file ...

FA_CREATE 

... copy in from payload.

FA_COPYIN 

... copy in from payload.

FA_COPYOUT 

... copy out to payload.

FA_BACKUP 

... renamed with ".rpmorig" extension.

FA_SAVE 

... renamed with ".rpmsave" extension.

FA_SKIP 

... already replaced, don't remove.

FA_ALTNAME 

... create with ".rpmnew" extension.

FA_ERASE 

... to be removed.

FA_SKIPNSTATE 

... untouched, state "not installed".

FA_SKIPNETSHARED 

... untouched, state "netshared".

FA_SKIPCOLOR 

... untouched, state "wrong color".

Definition at line 27 of file iosm.h.

Enumerator
IOSM_UNKNOWN 
IOSM_INIT 
IOSM_PRE 
IOSM_PROCESS 
IOSM_POST 
IOSM_UNDO 
IOSM_FINI 
IOSM_PKGINSTALL 
IOSM_PKGERASE 
IOSM_PKGBUILD 
IOSM_PKGCOMMIT 
IOSM_PKGUNDO 
IOSM_CREATE 
IOSM_MAP 
IOSM_MKDIRS 
IOSM_RMDIRS 
IOSM_MKLINKS 
IOSM_NOTIFY 
IOSM_DESTROY 
IOSM_VERIFY 
IOSM_COMMIT 
IOSM_UNLINK 
IOSM_RENAME 
IOSM_MKDIR 
IOSM_RMDIR 
IOSM_LSETFCON 
IOSM_CHOWN 
IOSM_LCHOWN 
IOSM_CHMOD 
IOSM_UTIME 
IOSM_SYMLINK 
IOSM_LINK 
IOSM_MKFIFO 
IOSM_MKNOD 
IOSM_LSTAT 
IOSM_STAT 
IOSM_READLINK 
IOSM_CHROOT 
IOSM_NEXT 
IOSM_EAT 
IOSM_POS 
IOSM_PAD 
IOSM_TRAILER 
IOSM_HREAD 
IOSM_HWRITE 
IOSM_DREAD 
IOSM_DWRITE 
IOSM_ROPEN 
IOSM_READ 
IOSM_RCLOSE 
IOSM_WOPEN 
IOSM_WRITE 
IOSM_WCLOSE 

Definition at line 115 of file iosm.h.

Enumerator
IOSM_MAP_PATH 
IOSM_MAP_MODE 
IOSM_MAP_UID 
IOSM_MAP_GID 
IOSM_FOLLOW_SYMLINKS 

only for building.

IOSM_MAP_ABSOLUTE 
IOSM_MAP_ADDDOT 
IOSM_ALL_HARDLINKS 

fail if hardlinks are missing.

IOSM_MAP_TYPE 

only for building.

IOSM_SBIT_CHECK 
IOSM_PAYLOAD_LIST 
IOSM_PAYLOAD_EXTRACT 
IOSM_PAYLOAD_CREATE 

Definition at line 44 of file iosm.h.

Function Documentation

IOSM_t freeIOSM ( IOSM_t  iosm)

Destroy I/O state machine instance.

Parameters
iosmI/O state machine
Returns
always NULL

Definition at line 580 of file iosm.c.

References _free(), iosm_s::dnlx, freeHardLink(), iosm_s::iter, iosm_s::ldn, iosm_s::li, iosm_s::links, mapFreeIterator(), hardLink_s::next, and iosm_s::path.

int iosmFileActionSkipped ( iosmFileAction  action)

Is the file going to be skipped?

Parameters
actionfile action
Returns
Is file to be skipped?

Definition at line 2678 of file iosm.c.

References IOSM_SKIPPING.

Referenced by dnlInitIterator(), fsmCommitLinks(), fsmMakeLinks(), fsmStage(), handleInstInstalledFile(), handleOverlappedFiles(), iosmCommitLinks(), iosmMakeLinks(), iosmStage(), rpmtsAddFingerprints(), rpmtsSkipFiles(), and saveHardLink().

const char* iosmFileActionString ( iosmFileAction  a)

Return formatted string representation of file disposition.

Parameters
afile disposition
Returns
formatted string

Definition at line 2683 of file iosm.c.

References FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, and FA_UNKNOWN.

const char* iosmFileStageString ( iosmFileStage  a)
void* iosmGetFi ( const IOSM_t  iosm)

Retrieve transaction element file info from I/O state machine iterator.

Parameters
iosmI/O state machine
Returns
transaction element file info

Definition at line 97 of file iosm.c.

References iosmIterator_s::fi, and iosm_s::iter.

Referenced by dnlInitIterator(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmStage(), saveHardLink(), and writeFile().

void* iosmGetTs ( const IOSM_t  iosm)

Retrieve transaction set from I/O state machine iterator.

Parameters
iosmI/O state machine
Returns
transaction set

Referenced by iosmStage(), and iosmTeardown().

int iosmMapAttrs ( IOSM_t  iosm)
int iosmMapPath ( IOSM_t  iosm)
int iosmNext ( IOSM_t  iosm,
iosmFileStage  nstage 
)

File state machine driver.

Parameters
iosmI/O state machine
nstagenext stage
Returns
0 on success

Definition at line 461 of file iosm.c.

References iosmStage(), iosm_s::multithreaded, iosm_s::nstage, rpmsqJoin(), and rpmsqThread().

Referenced by extractRegular(), iosmCommitLinks(), iosmMakeLinks(), iosmMkdirs(), iosmRmdirs(), iosmSetup(), iosmStage(), saveHardLink(), writeFile(), and writeLinkedFile().

int iosmSetup ( IOSM_t  iosm,
iosmFileStage  goal,
const char *  afmt,
const void *  _ts,
const void *  _fi,
FD_t  cfd,
unsigned int *  archiveSize,
const char **  failedFile 
)
int iosmStage ( IOSM_t  iosm,
iosmFileStage  stage 
)

File state machine driver.

Parameters
iosmI/O state machine
stagenext stage
Returns
0 on success

Definition at line 1638 of file iosm.c.

References _, _fafilter, _free(), iosm_s::action, alloca(), iosm_s::astriplen, iosm_s::blksize, iosm_s::cfd, Chmod(), Chown(), iosm_s::commit, CPIO_TRAILER, hardLink_s::createdPath, iosm_s::debug, iosm_s::diskchecked, iosm_s::dnlx, errno, iosm_s::exists, extractRegular(), FA_ERASE, FA_UNKNOWN, Fadvise(), iosm_s::failedFile, Fclose(), iosm_s::fcontext, fdGetCpioPos(), fdSetCpioPos(), FDSTAT_DIGEST, fdstat_op(), Ferror(), iosm_s::fflags, fi, hardLink_s::filex, Fopen(), Fread(), freeHardLink(), Fwrite(), iosm_s::goal, iosm_s::headerRead, iosm_s::headerWrite, i, IOSM_ALL_HARDLINKS, IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DEAD, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_FOLLOW_SYMLINKS, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_INTERNAL, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PAYLOAD_EXTRACT, IOSM_PAYLOAD_LIST, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_SBIT_CHECK, IOSM_STAT, IOSM_SYMLINK, IOSM_SYSCALL, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERBOSE, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, iosmCommitLinks(), IOSMERR_CHMOD_FAILED, IOSMERR_CHOWN_FAILED, IOSMERR_ENOENT, IOSMERR_ENOTEMPTY, IOSMERR_HDR_TRAILER, IOSMERR_LINK_FAILED, IOSMERR_LSETFCON_FAILED, IOSMERR_LSTAT_FAILED, IOSMERR_MISSING_HARDLINK, IOSMERR_MKDIR_FAILED, IOSMERR_MKFIFO_FAILED, IOSMERR_MKNOD_FAILED, IOSMERR_OPEN_FAILED, IOSMERR_READ_FAILED, IOSMERR_READLINK_FAILED, IOSMERR_RENAME_FAILED, IOSMERR_RMDIR_FAILED, IOSMERR_STAT_FAILED, IOSMERR_SYMLINK_FAILED, IOSMERR_UNKNOWN_FILETYPE, IOSMERR_UNLINK_FAILED, IOSMERR_UNMAPPED_FILE, IOSMERR_UTIME_FAILED, IOSMERR_WRITE_FAILED, iosmFileActionSkipped(), iosmFileStageString(), iosmFsPath(), iosmGetFi(), iosmGetTs(), iosmMakeLinks(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmNext(), iosmRmdirs(), iosmUNSAFE, IS_DEV_LOG, iosm_s::iter, iosm_s::ix, j, Lchown(), iosm_s::ldn, iosm_s::ldnalloc, iosm_s::ldnlen, iosm_s::li, Link(), hardLink_s::linkIndex, iosm_s::links, hardLink_s::linksLeft, iosm_s::lpath, Lstat(), mapFind(), iosm_s::mapFlags, mapNextIterator(), Mkdir(), iosm_s::mkdirsdone, Mkfifo(), Mknod(), hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::op_digest, iosm_s::opath, iosm_s::osb, iosm_s::osuffix, iosm_s::path, iosm_s::postpone, iosm_s::rc, iosm_s::rdb, iosm_s::rdbuf, iosm_s::rdlen, iosm_s::rdnb, iosm_s::rdsize, Readlink(), Rename(), iosm_s::repackaged, iosm_s::rfd, Rmdir(), RPMCALLBACK_INST_PROGRESS, RPMFILE_GHOST, RPMFILE_MISSINGOK, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmswAdd(), rpmsxLsetfilecon(), rpmtsNotify(), S_ISLNK, S_ISSOCK, saveHardLink(), hardLink_s::sb, iosm_s::sb, iosm_s::stage, Stat(), stpcpy(), iosm_s::strict_erasures, iosm_s::subdir, iosm_s::sufbuf, iosm_s::suffix, Symlink(), iosm_s::trailerWrite, Unlink(), urlPath(), Utime(), iosm_s::wfd, iosm_s::wrb, iosm_s::wrbuf, writeFile(), writeLinkedFile(), iosm_s::wrlen, iosm_s::wrnb, iosm_s::wrsize, xmalloc, and xstrdup().

Referenced by fsmStage(), and iosmNext().

char* iosmStrerror ( int  rc)
int iosmTeardown ( IOSM_t  iosm)

Clean I/O state machine.

Parameters
iosmI/O state machine
Returns
0 on success

Definition at line 802 of file iosm.c.

References _free(), iosm_s::cfd, iosm_s::debug, iosm_s::failedFile, fdFree(), IOSM_DESTROY, iosmGetTs(), iosmUNSAFE, iosm_s::iter, iosm_s::lmtab, mapFreeIterator(), iosm_s::op_digest, iosm_s::rc, rpmswAdd(), RPMTS_OP_DIGEST, rpmtsFree(), rpmtsOp(), and iosmIterator_s::ts.

IOSM_t newIOSM ( void  )

Create I/O state machine instance.

Returns
I/O state machine

Definition at line 574 of file iosm.c.

References xcalloc().

Variable Documentation

int _iosm_debug

Definition at line 75 of file iosm.c.

int(* _iosmNext)(IOSM_t iosm, iosmFileStage nstage)