libjio.h   libjio.h 
skipping to change at line 26 skipping to change at line 26
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* logical structures */ /* logical structures */
/* the main file structure */ /* the main file structure */
struct jfs { struct jfs {
int fd; /* main file descriptor */ int fd; /* main file descriptor */
char *name; /* and its name */ char *name; /* and its name */
int jdirfd; /* journal directory file descriptor */
int jfd; /* journal's lock file descriptor */ int jfd; /* journal's lock file descriptor */
int *jmap; /* journal's lock file mmap area */
int flags; /* journal flags */ int flags; /* journal flags */
struct jlinger *ltrans; /* lingered transactions */
pthread_mutex_t lock; /* a soft lock used in some operations */ pthread_mutex_t lock; /* a soft lock used in some operations */
}; };
/* a single operation */ /* a single operation */
struct joper { struct joper {
int locked; /* is the region is locked? */ int locked; /* is the region is locked? */
off_t offset; /* operation's offset */ off_t offset; /* operation's offset */
size_t len; /* data length */ size_t len; /* data length */
void *buf; /* data */ void *buf; /* data */
size_t plen; /* previous data length */ size_t plen; /* previous data length */
skipping to change at line 54 skipping to change at line 57
struct jtrans { struct jtrans {
struct jfs *fs; /* journal file structure to operate on */ struct jfs *fs; /* journal file structure to operate on */
char *name; /* name of the transaction file */ char *name; /* name of the transaction file */
int id; /* transaction id */ int id; /* transaction id */
int flags; /* misc flags */ int flags; /* misc flags */
unsigned int numops; /* quantity of operations in the list */ unsigned int numops; /* quantity of operations in the list */
pthread_mutex_t lock; /* used to modify the operation list */ pthread_mutex_t lock; /* used to modify the operation list */
struct joper *op; /* list of operations */ struct joper *op; /* list of operations */
}; };
/* lingered transaction */
struct jlinger {
int id; /* transaction id */
char *name; /* name of the transaction file */
struct jlinger *next;
};
struct jfsck_result { struct jfsck_result {
int total; /* total transactions files we looked at */ int total; /* total transactions files we looked at */
int invalid; /* invalid files in the journal directory */ int invalid; /* invalid files in the journal directory */
int in_progress; /* transactions in progress */ int in_progress; /* transactions in progress */
int broken; /* transactions broken */ int broken; /* transactions broken */
int corrupt; /* corrupt transactions */
int apply_error; /* errors applying the transaction */ int apply_error; /* errors applying the transaction */
int rollbacked; /* transactions that were rollbacked */ int reapplied; /* transactions that were reapplied */
}; };
/* on-disk structures */ /* on-disk structures */
/* header (fixed length, defined below) */ /* header (fixed length, defined below) */
struct disk_header { struct disk_header {
uint32_t id; /* id */ uint32_t id; /* id */
uint32_t flags; /* flags about this transaction */ uint32_t flags; /* flags about this transaction */
uint32_t numops; /* number of operations */ uint32_t numops; /* number of operations */
}; };
skipping to change at line 87 skipping to change at line 98
char *prevdata; /* previous data for rollback */ char *prevdata; /* previous data for rollback */
}; };
/* core functions */ /* core functions */
int jopen(struct jfs *fs, const char *name, int flags, int mode, int jflags ); int jopen(struct jfs *fs, const char *name, int flags, int mode, int jflags );
void jtrans_init(struct jfs *fs, struct jtrans *ts); void jtrans_init(struct jfs *fs, struct jtrans *ts);
int jtrans_add(struct jtrans *ts, const void *buf, size_t count, off_t offs et); int jtrans_add(struct jtrans *ts, const void *buf, size_t count, off_t offs et);
int jtrans_commit(struct jtrans *ts); int jtrans_commit(struct jtrans *ts);
int jtrans_rollback(struct jtrans *ts); int jtrans_rollback(struct jtrans *ts);
void jtrans_free(struct jtrans *ts); void jtrans_free(struct jtrans *ts);
int jsync(struct jfs *fs);
int jclose(struct jfs *fs); int jclose(struct jfs *fs);
/* journal checker */ /* journal checker */
int jfsck(const char *name, struct jfsck_result *res); int jfsck(const char *name, struct jfsck_result *res);
int jfsck_cleanup(const char *name); int jfsck_cleanup(const char *name);
/* UNIX API wrappers */ /* UNIX API wrappers */
ssize_t jread(struct jfs *fs, void *buf, size_t count); ssize_t jread(struct jfs *fs, void *buf, size_t count);
ssize_t jpread(struct jfs *fs, void *buf, size_t count, off_t offset); ssize_t jpread(struct jfs *fs, void *buf, size_t count, off_t offset);
ssize_t jreadv(struct jfs *fs, struct iovec *vector, int count); ssize_t jreadv(struct jfs *fs, struct iovec *vector, int count);
skipping to change at line 119 skipping to change at line 131
int jfeof(struct jfs *stream); int jfeof(struct jfs *stream);
void jclearerr(struct jfs *stream); void jclearerr(struct jfs *stream);
int jferror(struct jfs *stream); int jferror(struct jfs *stream);
int jfseek(struct jfs *stream, long offset, int whence); int jfseek(struct jfs *stream, long offset, int whence);
int jftell(struct jfs *stream); int jftell(struct jfs *stream);
void frewind(struct jfs *stream); void frewind(struct jfs *stream);
FILE *jfsopen(struct jfs *stream, const char *mode); FILE *jfsopen(struct jfs *stream, const char *mode);
/* jfs constants */ /* jfs constants */
#define J_NOLOCK 1 /* don't lock the file before operating on i t */ #define J_NOLOCK 1 /* don't lock the file before operating on i t */
#define J_NOROLLBACK 2 /* no need to read rollback information */
#define J_LINGER 3 /* use lingering transactions */
/* jtrans constants */ /* jtrans constants */
#define J_COMMITED 1 /* mark a transaction as commited */ #define J_COMMITED 1 /* mark a transaction as commited */
#define J_ROLLBACKED 2 /* mark a transaction as rollbacked */ #define J_ROLLBACKED 2 /* mark a transaction as rollbacked */
/* disk constants */ /* disk constants */
#define J_DISKHEADSIZE 12 /* length of disk_header */ #define J_DISKHEADSIZE 12 /* length of disk_header */
#define J_DISKOPHEADSIZE 16 /* length of disk_operation header */ #define J_DISKOPHEADSIZE 16 /* length of disk_operation header */
/* jfsck constants (return values) */ /* jfsck constants (return values) */
 End of changes. 8 change blocks. 
1 lines changed or deleted 15 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/