janatorial changes

This commit is contained in:
Fufu Fang 2021-08-08 15:50:35 +01:00
parent 9b23b69df2
commit 5f86703f17
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
5 changed files with 24 additions and 14 deletions

14
.gitignore vendored
View File

@ -1,7 +1,15 @@
*.o
*.kate-swp
# Binaries
httpdirfs
sonicfs
# Intermediates
*.o
.depend
doc/html
# Documentation
doc
# Editor related
.vscode
httpdirfs.code-workspace
*.kate-swp

View File

@ -901,7 +901,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = CALLOC exit_failure
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include

View File

@ -113,14 +113,23 @@ static int fs_open(const char *path, struct fuse_file_info *fi)
return 0;
}
/** \brief read the directory indicated by the path*/
/**
* \brief read the directory indicated by the path
* \note
* - releasedir() is not implemented, because I don't see why anybody want
* the LinkTables to be evicted from the memory during the runtime of this
* program. If you want to evict LinkTables, just unmount the filesystem.
* - There is no real need to associate the LinkTable with the fi of each
* directory data structure. If you want a deep level directory, you need to
* generate the LinkTables for previous level directories. We might
* as well maintain our own tree structure.
*/
static int fs_readdir(const char *path, void *buf, fuse_fill_dir_t dir_add,
off_t offset, struct fuse_file_info *fi)
{
(void) offset;
(void) fi;
Link *link;
LinkTable *linktbl;
if (!strcmp(path, "/")) {
@ -136,7 +145,7 @@ static int fs_readdir(const char *path, void *buf, fuse_fill_dir_t dir_add,
dir_add(buf, ".", NULL, 0);
dir_add(buf, "..", NULL, 0);
for (int i = 1; i < linktbl->num; i++) {
link = linktbl->links[i];
Link *link = linktbl->links[i];
if (link->type != LINK_INVALID) {
dir_add(buf, link->linkname, NULL, 0);
}

View File

@ -86,8 +86,6 @@ void Config_init(void)
CONFIG.max_segbc = DEFAULT_MAX_SEGBC;
/*-------------- Sonic related -------------*/
CONFIG.sonic_mode = 0;
CONFIG.sonic_username = NULL;
CONFIG.sonic_password = NULL;

View File

@ -26,11 +26,6 @@
*/
#define DEFAULT_USER_AGENT "HTTPDirFS-" VERSION
/**
* \brief configuration data structure
* \note The opening curly bracket should be at line 39, so the code belong