inc/fuse_implementation.h File Reference

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

Detailed Description

Header - Filesystem, implementation.

Author:
Julien Blitte
Version:
0.1

Definition in file fuse_implementation.h.


Function Documentation

int fuse_impl_create ( const char *  path,
mode_t  mode,
struct fuse_file_info *  filedata 
)

create and open a file

Parameters:
path file - utf8
mode file mode
filedata file information
Returns:
error code, 0 if successfull

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

Parameters:
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

Parameters:
path file - utf8
filedata file information
Returns:
error code, 0 if successfull

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)

Parameters:
path file - utf8
inode file's inode
filedata file information
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
attr attributes to return
Returns:
error code, 0 if successfull

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

Parameters:
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

Parameters:
path file - utf8
filedata file information
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
data data
size data size
offset offset in file
filedata file information
Returns:
error code, 0 if successfull

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

Parameters:
path diretory - utf8
data (not used)
filler callback function to list files
offset (not used)
filedata file information
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
newname the new name of the file - utf8
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
stat structure for returning information
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
newsize the new size of file
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
tv new time
Returns:
error code, 0 if successfull

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

Parameters:
path file - utf8
data data
size data size
offset offset in file
filedata file information
Returns:
error code, 0 if successfull

Definition at line 512 of file fuse_implementation.c.

References add_log(), ADDLOG_OP_SUCCESS, ADDLOG_OPERATION, ADDLOG_USER_ERROR, and check.

 All Classes Files Functions Variables Typedefs Defines

Generated on Mon Jan 11 00:15:07 2010 for db5fuse by  doxygen 1.6.1