#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <pthread.h>
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | jfsck_result |
The result of a jfsck() run. More... | |
Defines | |
#define | J_NOLOCK 1 |
Don't lock the file before operating on it. | |
#define | J_NOROLLBACK 2 |
No need to read rollback information. | |
#define | J_LINGER 4 |
Use lingering transactions. | |
#define | J_RDONLY 512 |
Marks a file as read-only. | |
#define | J_COMMITTED 1024 |
Marks a transaction as committed. | |
#define | J_ROLLBACKED 2048 |
Marks a transaction as rollbacked. | |
#define | J_ROLLBACKING 4096 |
Marks a transaction as rollbacking. | |
#define | J_CLEANUP 1 |
Perform a journal cleanup. | |
Typedefs | |
typedef struct jfs | jfs_t |
An open file, similar to a file descriptor. | |
typedef struct jtrans | jtrans_t |
A single transaction. | |
Enumerations | |
enum | jfsck_return { J_ESUCCESS = 0, J_ENOENT = -1, J_ENOJOURNAL = -2, J_ENOMEM = -3, J_ECLEANUP = -4, J_EIO = -5 } |
jfsck() return values. More... | |
Functions | |
jfs_t * | jopen (const char *name, int flags, int mode, unsigned int jflags) |
Open a file. | |
int | jclose (jfs_t *fs) |
Close a file opened with jopen(). | |
int | jsync (jfs_t *fs) |
Sync a file. | |
jtrans_t * | jtrans_new (jfs_t *fs, unsigned int flags) |
Create a new transaction. | |
int | jtrans_add_w (jtrans_t *ts, const void *buf, size_t count, off_t offset) |
Add a write operation to a transaction. | |
int | jtrans_add_r (jtrans_t *ts, void *buf, size_t count, off_t offset) |
Add a read operation to a transaction. | |
ssize_t | jtrans_commit (jtrans_t *ts) |
Commit a transaction. | |
ssize_t | jtrans_rollback (jtrans_t *ts) |
Rollback a transaction. | |
void | jtrans_free (jtrans_t *ts) |
Free a transaction structure. | |
int | jmove_journal (jfs_t *fs, const char *newpath) |
Change the location of the journal directory. | |
int | jfs_autosync_start (jfs_t *fs, time_t max_sec, size_t max_bytes) |
Start an autosync thread. | |
int | jfs_autosync_stop (jfs_t *fs) |
Stop an autosync thread that was started using jfs_autosync_start(fs). | |
enum jfsck_return | jfsck (const char *name, const char *jdir, struct jfsck_result *res, unsigned int flags) |
Check and repair the given path. | |
ssize_t | jread (jfs_t *fs, void *buf, size_t count) |
Read from the file. | |
ssize_t | jpread (jfs_t *fs, void *buf, size_t count, off_t offset) |
Read from the file at the given offset. | |
ssize_t | jreadv (jfs_t *fs, const struct iovec *vector, int count) |
Read from the file into multiple buffers. | |
ssize_t | jwrite (jfs_t *fs, const void *buf, size_t count) |
Write to the file. | |
ssize_t | jpwrite (jfs_t *fs, const void *buf, size_t count, off_t offset) |
Write to the file at the given offset. | |
ssize_t | jwritev (jfs_t *fs, const struct iovec *vector, int count) |
Write to the file from multiple buffers. | |
int | jtruncate (jfs_t *fs, off_t length) |
Truncates the file to the given length. | |
off_t | jlseek (jfs_t *fs, off_t offset, int whence) |
Reposition read/write file offset. | |
jfs_t * | jfopen (const char *path, const char *mode) |
int | jfclose (jfs_t *stream) |
jfs_t * | jfreopen (const char *path, const char *mode, jfs_t *stream) |
size_t | jfread (void *ptr, size_t size, size_t nmemb, jfs_t *stream) |
size_t | jfwrite (const void *ptr, size_t size, size_t nmemb, jfs_t *stream) |
int | jfileno (jfs_t *stream) |
int | jfeof (jfs_t *stream) |
void | jclearerr (jfs_t *stream) |
int | jferror (jfs_t *stream) |
int | jfseek (jfs_t *stream, long offset, int whence) |
long | jftell (jfs_t *stream) |
void | jrewind (jfs_t *stream) |
FILE * | jfsopen (jfs_t *stream, const char *mode) |
#define J_RDONLY 512 |
#define J_ROLLBACKED 2048 |
#define J_ROLLBACKING 4096 |
typedef struct jfs jfs_t |
jfs_t* jfopen | ( | const char * | path, | |
const char * | mode | |||
) |
int jfclose | ( | jfs_t * | stream | ) |
size_t jfread | ( | void * | ptr, | |
size_t | size, | |||
size_t | nmemb, | |||
jfs_t * | stream | |||
) |
size_t jfwrite | ( | const void * | ptr, | |
size_t | size, | |||
size_t | nmemb, | |||
jfs_t * | stream | |||
) |
int jfileno | ( | jfs_t * | stream | ) |
int jfeof | ( | jfs_t * | stream | ) |
void jclearerr | ( | jfs_t * | stream | ) |
int jferror | ( | jfs_t * | stream | ) |
int jfseek | ( | jfs_t * | stream, | |
long | offset, | |||
int | whence | |||
) |
long jftell | ( | jfs_t * | stream | ) |
void jrewind | ( | jfs_t * | stream | ) |
FILE* jfsopen | ( | jfs_t * | stream, | |
const char * | mode | |||
) |