Fix IdList and implement statfs()
This commit is contained in:
parent
708ca7b1d6
commit
3b376aa048
|
@ -14,15 +14,6 @@ using fusepp::path;
|
|||
|
||||
namespace cryfs {
|
||||
|
||||
namespace {
|
||||
int errcode_map(int exit_status) {
|
||||
if (exit_status < 0) {
|
||||
return -errno;
|
||||
}
|
||||
return exit_status;
|
||||
}
|
||||
}
|
||||
|
||||
CryFuse::CryFuse(CryDevice *device)
|
||||
:_device(device) {
|
||||
}
|
||||
|
@ -235,10 +226,13 @@ int CryFuse::write(const path &path, const char *buf, size_t size, off_t offset,
|
|||
|
||||
//TODO
|
||||
int CryFuse::statfs(const path &path, struct statvfs *fsstat) {
|
||||
printf("HALF-IMPLEMENTED: statfs(%s, _)\n", path.c_str());
|
||||
auto real_path = _device->RootDir() / path;
|
||||
int retstat = ::statvfs(real_path.c_str(), fsstat);
|
||||
return errcode_map(retstat);
|
||||
//printf("statfs(%s, _)\n", path.c_str());
|
||||
try {
|
||||
_device->statfs(path, fsstat);
|
||||
return 0;
|
||||
} catch (CryErrnoException &e) {
|
||||
return -e.getErrno();
|
||||
}
|
||||
}
|
||||
|
||||
//TODO
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace bf = boost::filesystem;
|
|||
using namespace fusepp;
|
||||
|
||||
#define FUSE_OBJ ((Fuse *) fuse_get_context()->private_data)
|
||||
#define UNUSED(obj) (void)obj
|
||||
|
||||
namespace {
|
||||
int fusepp_getattr(const char *path, struct stat *stbuf) {
|
||||
|
@ -131,6 +132,7 @@ void* fusepp_init(fuse_conn_info *conn) {
|
|||
void fusepp_destroy(void *userdata) {
|
||||
auto f = FUSE_OBJ;
|
||||
assert(userdata == f);
|
||||
UNUSED(userdata); //In the Release build, the assert doesn't run
|
||||
f->destroy();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue