Header - Filesystem, implementation. More...
#include <errno.h>
#include <fcntl.h>
#include <fuse.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
Go to the source code of this file.
Functions | |
int | fuse_impl_getattr (const char *path, struct stat *attr) |
file attributes | |
int | fuse_impl_unlink (const char *path) |
remove a file | |
int | fuse_impl_rename (const char *path, const char *newname) |
rename a file | |
int | fuse_impl_truncate (const char *path, off_t newsize) |
change the size of a file | |
int | fuse_impl_open (const char *path, struct fuse_file_info *filedata) |
open a file | |
int | fuse_impl_read (const char *path, char *data, size_t size, off_t offset, struct fuse_file_info *filedata) |
read data from an open file | |
int | fuse_impl_write (const char *path, const char *data, size_t size, off_t offset, struct fuse_file_info *filedata) |
write data to an open file | |
int | fuse_impl_statfs (const char *path, struct statvfs *stat) |
get file system statistics | |
int | fuse_impl_flush (const char *path, struct fuse_file_info *filedata) |
flush cached data | |
int | fuse_impl_readdir (const char *path, void *data, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *filedata) |
read directory | |
void * | fuse_impl_init (struct fuse_conn_info *fs_attr) |
initialize filesystem | |
void | fuse_impl_destroy (void *data) |
clean up filesystem | |
int | fuse_impl_create (const char *path, mode_t mode, struct fuse_file_info *filedata) |
create and open a file | |
int | fuse_impl_utimens (const char *path, const struct timespec tv[2]) |
change the access and modification times | |
int | fuse_impl_fsync (const char *path, int inode, struct fuse_file_info *filedata) |
flush opened file (sync data) | |
Variables | |
const char * | fuse_device |
the mounted point - utf8 |
Header - Filesystem, implementation.
Definition in file fuse_implementation.h.
int fuse_impl_create | ( | const char * | path, | |
mode_t | mode, | |||
struct fuse_file_info * | filedata | |||
) |
create and open a file
path | file - utf8 | |
mode | file mode | |
filedata | file information |
Definition at line 122 of file fuse_implementation.c.
References add_log(), ADDLOG_DUMP, ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_exists(), db5_insert(), db5_localfile(), ESUCCESS, file_remove_headslash(), and log_dump().
void fuse_impl_destroy | ( | void * | data | ) |
clean up filesystem
data | (not used) |
Definition at line 106 of file fuse_implementation.c.
References add_log(), ADDLOG_DEBUG, ADDLOG_OPERATION, close_log(), db5_free(), db5_index(), and fuse_device.
int fuse_impl_flush | ( | const char * | path, | |
struct fuse_file_info * | filedata | |||
) |
flush cached data
path | file - utf8 | |
filedata | file information |
Definition at line 581 of file fuse_implementation.c.
References add_log(), ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_RECOVER, check, db5_update(), ESUCCESS, and file_remove_headslash().
int fuse_impl_fsync | ( | const char * | path, | |
int | inode, | |||
struct fuse_file_info * | filedata | |||
) |
flush opened file (sync data)
path | file - utf8 | |
inode | file's inode | |
filedata | file information |
Definition at line 649 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, check, and ESUCCESS.
int fuse_impl_getattr | ( | const char * | path, | |
struct stat * | attr | |||
) |
file attributes
path | file - utf8 | |
attr | attributes to return |
Definition at line 213 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_count(), db5_localfile(), ESUCCESS, file_remove_headslash(), and log_dump().
void* fuse_impl_init | ( | struct fuse_conn_info * | fs_attr | ) |
initialize filesystem
fs_attr | (not used) |
Definition at line 77 of file fuse_implementation.c.
References add_log(), ADDLOG_CRITICAL, ADDLOG_DEBUG, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, check, db5_init(), file_set_context(), fuse_device, LOG_ERR, and open_log().
int fuse_impl_open | ( | const char * | path, | |
struct fuse_file_info * | filedata | |||
) |
open a file
path | file - utf8 | |
filedata | file information |
Definition at line 433 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_localfile(), ESUCCESS, and file_remove_headslash().
int fuse_impl_read | ( | const char * | path, | |
char * | data, | |||
size_t | size, | |||
off_t | offset, | |||
struct fuse_file_info * | filedata | |||
) |
read data from an open file
path | file - utf8 | |
data | data | |
size | data size | |
offset | offset in file | |
filedata | file information |
Definition at line 465 of file fuse_implementation.c.
References add_log(), ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, and check.
int fuse_impl_readdir | ( | const char * | path, | |
void * | data, | |||
fuse_fill_dir_t | filler, | |||
off_t | offset, | |||
struct fuse_file_info * | filedata | |||
) |
read directory
path | diretory - utf8 | |
data | (not used) | |
filler | callback function to list files | |
offset | (not used) | |
filedata | file information |
Definition at line 602 of file fuse_implementation.c.
References add_log(), ADDLOG_DEBUG, ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_select_filename(), and ESUCCESS.
int fuse_impl_rename | ( | const char * | path, | |
const char * | newname | |||
) |
rename a file
path | file - utf8 | |
newname | the new name of the file - utf8 |
Definition at line 323 of file fuse_implementation.c.
References add_log(), ADDLOG_DEBUG, ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_delete(), db5_exists(), db5_insert(), db5_localfile(), db5_update(), ESUCCESS, file_remove_headslash(), and log_dump().
int fuse_impl_statfs | ( | const char * | path, | |
struct statvfs * | stat | |||
) |
get file system statistics
path | file - utf8 | |
stat | structure for returning information |
Definition at line 559 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, check, CONFIG_DB5_DATA_DIR, and ESUCCESS.
int fuse_impl_truncate | ( | const char * | path, | |
off_t | newsize | |||
) |
change the size of a file
path | file - utf8 | |
newsize | the new size of file |
Definition at line 403 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_localfile(), ESUCCESS, file_remove_headslash(), and log_dump().
int fuse_impl_unlink | ( | const char * | path | ) |
remove a file
path | file - utf8 |
Definition at line 289 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_RECOVER, ADDLOG_USER_ERROR, check, db5_delete(), db5_localfile(), ESUCCESS, file_remove_headslash(), and log_dump().
int fuse_impl_utimens | ( | const char * | path, | |
const struct timespec | tv[2] | |||
) |
change the access and modification times
path | file - utf8 | |
tv | new time |
Definition at line 176 of file fuse_implementation.c.
References add_log(), ADDLOG_FAIL, ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, check, db5_localfile(), ESUCCESS, file_remove_headslash(), and log_dump().
int fuse_impl_write | ( | const char * | path, | |
const char * | data, | |||
size_t | size, | |||
off_t | offset, | |||
struct fuse_file_info * | filedata | |||
) |
write data to an open file
path | file - utf8 | |
data | data | |
size | data size | |
offset | offset in file | |
filedata | file information |
Definition at line 512 of file fuse_implementation.c.
References add_log(), ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, and check.