Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

o Show base dir that is mounted.

  • Loading branch information...
commit 0aee3bb162246023398da5ad9043e6dc7339fab9 1 parent 0e5e63d
@hzeller authored
View
13 convolver-filesystem.h
@@ -25,10 +25,11 @@
class ConvolverFilesystem {
public:
ConvolverFilesystem(const char *version_info,
- const char *zita_config_dir,
- int cache_size);
+ const char *underlying_dir,
+ const char *zita_config_dir);
- // Create a new filter given the open filedescriptor and the path.
+ // Create a new filter given the filesystem path and the underlying
+ // path.
// Returns NULL, if it cannot be created.
FileHandler *CreateHandler(const char *fs_path,
const char *underlying_path);
@@ -40,13 +41,17 @@ class ConvolverFilesystem {
// errno value on failure.
void Close(const char *fs_path);
- const std::string &version() { return version_info_; }
+ const std::string &version() const { return version_info_; }
+ const std::string &underlying_dir() const { return underlying_dir_; }
FileHandlerCache *handler_cache() { return &open_file_cache_; }
+
+ // Some stats.
int total_file_openings() { return total_file_openings_; }
int total_file_reopen() { return total_file_reopen_; }
private:
const std::string version_info_;
+ const std::string underlying_dir_;
FileHandlerCache open_file_cache_;
int total_file_openings_;
int total_file_reopen_;
View
9 convolver.cc
@@ -34,6 +34,8 @@
#include "zita-config.h"
static bool global_debug = false;
+
+// TODO(hzeller): don't make this global.
const char *global_zita_config_dir = NULL;
#define LOGF if (!global_debug) {} else fprintf
@@ -492,9 +494,10 @@ void ConvolverFilesystem::Close(const char *fs_path) {
}
ConvolverFilesystem::ConvolverFilesystem(const char *version_info,
- const char *zita_config_dir,
- int cache_size)
- : version_info_(version_info), open_file_cache_(cache_size),
+ const char *unerlying_dir,
+ const char *zita_config_dir)
+ : version_info_(version_info), underlying_dir_(unerlying_dir),
+ open_file_cache_(3),
total_file_openings_(0), total_file_reopen_(0) {
global_zita_config_dir = zita_config_dir;
}
View
3  fuse-convolve.cc
@@ -60,6 +60,7 @@ static char *concat_path(char *buf, const char *a, const char *b) {
// Given a relative path from the root of the mounted file-system, get the
// original file from the source filesystem.
+// TODO(hzeller): move the ogg.fuse.flac logic into convolver-filesystem.
static const char *assemble_orig_path(char *buf, const char *path) {
char *result = concat_path(buf, orig_dir, path);
static const char magic_ogg_rewrite[] = ".ogg.fuse.flac";
@@ -181,7 +182,7 @@ int main(int argc, char *argv[]) {
argc -=2;
argv += 2;
convolver_fs = new ConvolverFilesystem(FUSE_CONVOLVE_VERSION_INFO,
- config_dir, 3);
+ orig_dir, config_dir);
// TODO(hzeller): make this configurable
StatusServer *statusz = new StatusServer(convolver_fs);
View
5 status-server.cc
@@ -163,8 +163,9 @@ void StatusServer::CreatePage(const char **buffer, size_t *size) {
current_page_.clear();
current_page_.append(kHtmlHeader);
current_page_.append("<body style='font-family:Helvetica;'>\n");
- current_page_.append("<center>Welcome to fuse convolve ")
- .append(filesystem_->version()).append("</center>");
+ Appendf(&current_page_, "<center>Welcome to Fuse Convolve %s</center>"
+ "Convolving files from <code>%s</code><br/>\n",
+ filesystem_->version().c_str(), filesystem_->underlying_dir().c_str());
std::vector<HandlerStats> stat_list;
filesystem_->handler_cache()->GetStats(&stat_list);
Please sign in to comment.
Something went wrong with that request. Please try again.