Rename FuseFile -> File and so on
This commit is contained in:
parent
70dbe8108a
commit
3f318281ec
@ -21,7 +21,7 @@ CryDevice::CryDevice(const bf::path &root_path): _root_path(root_path) {
|
|||||||
CryDevice::~CryDevice() {
|
CryDevice::~CryDevice() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<fusepp::FuseNode> CryDevice::Load(const bf::path &path) {
|
unique_ptr<fusepp::Node> CryDevice::Load(const bf::path &path) {
|
||||||
auto real_path = RootDir() / path;
|
auto real_path = RootDir() / path;
|
||||||
if(bf::is_directory(real_path)) {
|
if(bf::is_directory(real_path)) {
|
||||||
return make_unique<CryDir>(this, path);
|
return make_unique<CryDir>(this, path);
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
#define CRYFS_LIB_CRYDEVICE_H_
|
#define CRYFS_LIB_CRYDEVICE_H_
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <fusepp/fs_interface/Device.h>
|
||||||
|
|
||||||
#include "fusepp/fs_interface/FuseDevice.h"
|
|
||||||
#include "fusepp/utils/macros.h"
|
#include "fusepp/utils/macros.h"
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
namespace bf = boost::filesystem;
|
namespace bf = boost::filesystem;
|
||||||
|
|
||||||
class CryDevice: public fusepp::FuseDevice {
|
class CryDevice: public fusepp::Device {
|
||||||
public:
|
public:
|
||||||
CryDevice(const bf::path &rootdir);
|
CryDevice(const bf::path &rootdir);
|
||||||
virtual ~CryDevice();
|
virtual ~CryDevice();
|
||||||
@ -20,7 +20,7 @@ public:
|
|||||||
|
|
||||||
const bf::path &RootDir() const;
|
const bf::path &RootDir() const;
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<fusepp::FuseNode> Load(const bf::path &path) override;
|
std::unique_ptr<fusepp::Node> Load(const bf::path &path) override;
|
||||||
|
|
||||||
const bf::path _root_path;
|
const bf::path _root_path;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ CryDir::CryDir(CryDevice *device, const bf::path &path)
|
|||||||
CryDir::~CryDir() {
|
CryDir::~CryDir() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<fusepp::FuseFile> CryDir::createFile(const string &name, mode_t mode) {
|
unique_ptr<fusepp::File> CryDir::createFile(const string &name, mode_t mode) {
|
||||||
auto file_path = base_path() / name;
|
auto file_path = base_path() / name;
|
||||||
//Create file
|
//Create file
|
||||||
int fd = ::creat(file_path.c_str(), mode);
|
int fd = ::creat(file_path.c_str(), mode);
|
||||||
@ -38,7 +38,7 @@ unique_ptr<fusepp::FuseFile> CryDir::createFile(const string &name, mode_t mode)
|
|||||||
return make_unique<CryFile>(device(), path() / name);
|
return make_unique<CryFile>(device(), path() / name);
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<fusepp::FuseDir> CryDir::createDir(const string &name, mode_t mode) {
|
unique_ptr<fusepp::Dir> CryDir::createDir(const string &name, mode_t mode) {
|
||||||
auto dir_path = base_path() / name;
|
auto dir_path = base_path() / name;
|
||||||
//Create dir
|
//Create dir
|
||||||
int retval = ::mkdir(dir_path.c_str(), mode);
|
int retval = ::mkdir(dir_path.c_str(), mode);
|
||||||
|
@ -2,19 +2,19 @@
|
|||||||
#ifndef CRYFS_LIB_CRYDIR_H_
|
#ifndef CRYFS_LIB_CRYDIR_H_
|
||||||
#define CRYFS_LIB_CRYDIR_H_
|
#define CRYFS_LIB_CRYDIR_H_
|
||||||
|
|
||||||
#include "fusepp/fs_interface/FuseDir.h"
|
#include <fusepp/fs_interface/Dir.h>
|
||||||
#include "CryNode.h"
|
#include "CryNode.h"
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
class CryDir: public fusepp::FuseDir, CryNode {
|
class CryDir: public fusepp::Dir, CryNode {
|
||||||
public:
|
public:
|
||||||
CryDir(CryDevice *device, const bf::path &path);
|
CryDir(CryDevice *device, const bf::path &path);
|
||||||
virtual ~CryDir();
|
virtual ~CryDir();
|
||||||
|
|
||||||
//TODO return type variance to CryFile/CryDir?
|
//TODO return type variance to CryFile/CryDir?
|
||||||
std::unique_ptr<fusepp::FuseFile> createFile(const std::string &name, mode_t mode) override;
|
std::unique_ptr<fusepp::File> createFile(const std::string &name, mode_t mode) override;
|
||||||
std::unique_ptr<fusepp::FuseDir> createDir(const std::string &name, mode_t mode) override;
|
std::unique_ptr<fusepp::Dir> createDir(const std::string &name, mode_t mode) override;
|
||||||
void rmdir() override;
|
void rmdir() override;
|
||||||
|
|
||||||
std::unique_ptr<std::vector<std::string>> children() const override;
|
std::unique_ptr<std::vector<std::string>> children() const override;
|
||||||
|
@ -22,7 +22,7 @@ CryFile::CryFile(CryDevice *device, const bf::path &path)
|
|||||||
CryFile::~CryFile() {
|
CryFile::~CryFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<fusepp::FuseOpenFile> CryFile::open(int flags) const {
|
unique_ptr<fusepp::OpenFile> CryFile::open(int flags) const {
|
||||||
return make_unique<CryOpenFile>(device(), path(), flags);
|
return make_unique<CryOpenFile>(device(), path(), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
#ifndef CRYFS_LIB_CRYFILE_H_
|
#ifndef CRYFS_LIB_CRYFILE_H_
|
||||||
#define CRYFS_LIB_CRYFILE_H_
|
#define CRYFS_LIB_CRYFILE_H_
|
||||||
|
|
||||||
|
#include <fusepp/fs_interface/File.h>
|
||||||
#include "CryNode.h"
|
#include "CryNode.h"
|
||||||
#include "fusepp/fs_interface/FuseFile.h"
|
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
class CryFile: public fusepp::FuseFile, CryNode {
|
class CryFile: public fusepp::File, CryNode {
|
||||||
public:
|
public:
|
||||||
CryFile(CryDevice *device, const boost::filesystem::path &path);
|
CryFile(CryDevice *device, const boost::filesystem::path &path);
|
||||||
virtual ~CryFile();
|
virtual ~CryFile();
|
||||||
|
|
||||||
std::unique_ptr<fusepp::FuseOpenFile> open(int flags) const override;
|
std::unique_ptr<fusepp::OpenFile> open(int flags) const override;
|
||||||
void truncate(off_t size) const override;
|
void truncate(off_t size) const override;
|
||||||
void unlink() override;
|
void unlink() override;
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#ifndef CRYFS_LIB_CRYNODE_H_
|
#ifndef CRYFS_LIB_CRYNODE_H_
|
||||||
#define CRYFS_LIB_CRYNODE_H_
|
#define CRYFS_LIB_CRYNODE_H_
|
||||||
|
|
||||||
#include "fusepp/fs_interface/FuseNode.h"
|
#include <fusepp/fs_interface/Node.h>
|
||||||
#include "fusepp/utils/macros.h"
|
#include "fusepp/utils/macros.h"
|
||||||
|
|
||||||
#include "CryDevice.h"
|
#include "CryDevice.h"
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
class CryNode: public virtual fusepp::FuseNode {
|
class CryNode: public virtual fusepp::Node {
|
||||||
public:
|
public:
|
||||||
CryNode(CryDevice *device, const boost::filesystem::path &path);
|
CryNode(CryDevice *device, const boost::filesystem::path &path);
|
||||||
virtual ~CryNode();
|
virtual ~CryNode();
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#ifndef CRYFS_LIB_CRYOPENFILE_H_
|
#ifndef CRYFS_LIB_CRYOPENFILE_H_
|
||||||
#define CRYFS_LIB_CRYOPENFILE_H_
|
#define CRYFS_LIB_CRYOPENFILE_H_
|
||||||
|
|
||||||
#include "fusepp/fs_interface/FuseOpenFile.h"
|
#include <fusepp/fs_interface/OpenFile.h>
|
||||||
#include "fusepp/utils/macros.h"
|
#include "fusepp/utils/macros.h"
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
class CryDevice;
|
class CryDevice;
|
||||||
|
|
||||||
class CryOpenFile: public fusepp::FuseOpenFile {
|
class CryOpenFile: public fusepp::OpenFile {
|
||||||
public:
|
public:
|
||||||
CryOpenFile(const CryDevice *device, const boost::filesystem::path &path, int flags);
|
CryOpenFile(const CryDevice *device, const boost::filesystem::path &path, int flags);
|
||||||
virtual ~CryOpenFile();
|
virtual ~CryOpenFile();
|
||||||
|
22
src/fusepp/fs_interface/Device.h
Normal file
22
src/fusepp/fs_interface/Device.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef FUSEPP_DEVICE_H_
|
||||||
|
#define FUSEPP_DEVICE_H_
|
||||||
|
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <memory>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
|
||||||
|
namespace fusepp {
|
||||||
|
class Node;
|
||||||
|
|
||||||
|
class Device {
|
||||||
|
public:
|
||||||
|
virtual ~Device() {}
|
||||||
|
|
||||||
|
virtual void statfs(const boost::filesystem::path &path, struct ::statvfs *fsstat) = 0;
|
||||||
|
virtual std::unique_ptr<Node> Load(const boost::filesystem::path &path) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* FUSEPP_DEVICE_H_ */
|
26
src/fusepp/fs_interface/Dir.h
Normal file
26
src/fusepp/fs_interface/Dir.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef FUSEPP_DIR_H_
|
||||||
|
#define FUSEPP_DIR_H_
|
||||||
|
|
||||||
|
#include <fusepp/fs_interface/Node.h>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace fusepp {
|
||||||
|
class Device;
|
||||||
|
class File;
|
||||||
|
|
||||||
|
class Dir: public virtual Node {
|
||||||
|
public:
|
||||||
|
virtual ~Dir() {}
|
||||||
|
|
||||||
|
virtual std::unique_ptr<File> createFile(const std::string &name, mode_t mode) = 0;
|
||||||
|
virtual std::unique_ptr<Dir> createDir(const std::string &name, mode_t mode) = 0;
|
||||||
|
virtual void rmdir() = 0;
|
||||||
|
|
||||||
|
virtual std::unique_ptr<std::vector<std::string>> children() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace fusepp */
|
||||||
|
|
||||||
|
#endif /* FUSEPP_DIR_H_ */
|
23
src/fusepp/fs_interface/File.h
Normal file
23
src/fusepp/fs_interface/File.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef FUSEPP_FILE_H_
|
||||||
|
#define FUSEPP_FILE_H_
|
||||||
|
|
||||||
|
#include <fusepp/fs_interface/Node.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace fusepp {
|
||||||
|
class Device;
|
||||||
|
class OpenFile;
|
||||||
|
|
||||||
|
class File: public virtual Node {
|
||||||
|
public:
|
||||||
|
virtual ~File() {}
|
||||||
|
|
||||||
|
virtual std::unique_ptr<OpenFile> open(int flags) const = 0;
|
||||||
|
virtual void truncate(off_t size) const = 0;
|
||||||
|
virtual void unlink() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace fusepp */
|
||||||
|
|
||||||
|
#endif /* FUSEPP_FILE_H_ */
|
@ -1,22 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#ifndef FUSEPP_FUSEDEVICE_H_
|
|
||||||
#define FUSEPP_FUSEDEVICE_H_
|
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include <memory>
|
|
||||||
#include <sys/statvfs.h>
|
|
||||||
|
|
||||||
namespace fusepp {
|
|
||||||
class FuseNode;
|
|
||||||
|
|
||||||
class FuseDevice {
|
|
||||||
public:
|
|
||||||
virtual ~FuseDevice() {}
|
|
||||||
|
|
||||||
virtual void statfs(const boost::filesystem::path &path, struct ::statvfs *fsstat) = 0;
|
|
||||||
virtual std::unique_ptr<FuseNode> Load(const boost::filesystem::path &path) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* FUSEPP_FUSEDEVICE_H_ */
|
|
@ -1,26 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#ifndef FUSEPP_FUSEDIR_H_
|
|
||||||
#define FUSEPP_FUSEDIR_H_
|
|
||||||
|
|
||||||
#include "FuseNode.h"
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace fusepp {
|
|
||||||
class FuseDevice;
|
|
||||||
class FuseFile;
|
|
||||||
|
|
||||||
class FuseDir: public virtual FuseNode {
|
|
||||||
public:
|
|
||||||
virtual ~FuseDir() {}
|
|
||||||
|
|
||||||
virtual std::unique_ptr<FuseFile> createFile(const std::string &name, mode_t mode) = 0;
|
|
||||||
virtual std::unique_ptr<FuseDir> createDir(const std::string &name, mode_t mode) = 0;
|
|
||||||
virtual void rmdir() = 0;
|
|
||||||
|
|
||||||
virtual std::unique_ptr<std::vector<std::string>> children() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
} /* namespace fusepp */
|
|
||||||
|
|
||||||
#endif /* FUSEPP_FUSEDIR_H_ */
|
|
@ -1,23 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#ifndef FUSEPP_FUSEFILE_H_
|
|
||||||
#define FUSEPP_FUSEFILE_H_
|
|
||||||
|
|
||||||
#include "FuseNode.h"
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace fusepp {
|
|
||||||
class FuseDevice;
|
|
||||||
class FuseOpenFile;
|
|
||||||
|
|
||||||
class FuseFile: public virtual FuseNode {
|
|
||||||
public:
|
|
||||||
virtual ~FuseFile() {}
|
|
||||||
|
|
||||||
virtual std::unique_ptr<FuseOpenFile> open(int flags) const = 0;
|
|
||||||
virtual void truncate(off_t size) const = 0;
|
|
||||||
virtual void unlink() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
} /* namespace fusepp */
|
|
||||||
|
|
||||||
#endif /* FUSEPP_FUSEFILE_H_ */
|
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifndef FUSEPP_FUSENODE_H_
|
#ifndef FUSEPP_NODE_H_
|
||||||
#define FUSEPP_FUSENODE_H_
|
#define FUSEPP_NODE_H_
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
namespace fusepp {
|
namespace fusepp {
|
||||||
|
|
||||||
class FuseNode {
|
class Node {
|
||||||
public:
|
public:
|
||||||
virtual ~FuseNode() {}
|
virtual ~Node() {}
|
||||||
|
|
||||||
virtual void stat(struct ::stat *result) const = 0;
|
virtual void stat(struct ::stat *result) const = 0;
|
||||||
virtual void access(int mask) const = 0;
|
virtual void access(int mask) const = 0;
|
||||||
@ -20,4 +20,4 @@ public:
|
|||||||
|
|
||||||
} /* namespace fusepp */
|
} /* namespace fusepp */
|
||||||
|
|
||||||
#endif /* FUSEPP_FUSENODE_H_ */
|
#endif /* FUSEPP_NODE_H_ */
|
@ -1,16 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifndef FUSEPP_FUSEOPENFILE_H_
|
#ifndef FUSEPP_OPENFILE_H_
|
||||||
#define FUSEPP_FUSEOPENFILE_H_
|
#define FUSEPP_OPENFILE_H_
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
namespace fusepp {
|
namespace fusepp {
|
||||||
class FuseDevice;
|
class Device;
|
||||||
|
|
||||||
class FuseOpenFile {
|
class OpenFile {
|
||||||
public:
|
public:
|
||||||
virtual ~FuseOpenFile() {}
|
virtual ~OpenFile() {}
|
||||||
|
|
||||||
virtual void stat(struct ::stat *result) const = 0;
|
virtual void stat(struct ::stat *result) const = 0;
|
||||||
virtual void truncate(off_t size) const = 0;
|
virtual void truncate(off_t size) const = 0;
|
||||||
@ -22,4 +22,4 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FUSEPP_FUSEOPENFILE_H_ */
|
#endif /* FUSEPP_OPENFILE_H_ */
|
@ -11,7 +11,7 @@
|
|||||||
#include "../utils/macros.h"
|
#include "../utils/macros.h"
|
||||||
|
|
||||||
namespace fusepp {
|
namespace fusepp {
|
||||||
class FuseDevice;
|
class Device;
|
||||||
class FilesystemImpl;
|
class FilesystemImpl;
|
||||||
|
|
||||||
namespace fusebindings {
|
namespace fusebindings {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <fusepp/fs_interface/Device.h>
|
||||||
|
#include <fusepp/fs_interface/Dir.h>
|
||||||
|
|
||||||
#include "fusepp/fs_interface/FuseDevice.h"
|
|
||||||
#include "fusepp/fs_interface/FuseDir.h"
|
|
||||||
#include "FuseErrnoException.h"
|
#include "FuseErrnoException.h"
|
||||||
#include "fusepp/fs_interface/FuseFile.h"
|
#include "fusepp/fs_interface/File.h"
|
||||||
|
|
||||||
|
|
||||||
#include "fusepp/utils/pointer.h"
|
#include "fusepp/utils/pointer.h"
|
||||||
@ -20,25 +20,25 @@ using std::string;
|
|||||||
|
|
||||||
namespace bf = boost::filesystem;
|
namespace bf = boost::filesystem;
|
||||||
|
|
||||||
FilesystemImpl::FilesystemImpl(FuseDevice *device)
|
FilesystemImpl::FilesystemImpl(Device *device)
|
||||||
:_device(device), _open_files() {
|
:_device(device), _open_files() {
|
||||||
}
|
}
|
||||||
|
|
||||||
FilesystemImpl::~FilesystemImpl() {
|
FilesystemImpl::~FilesystemImpl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<FuseFile> FilesystemImpl::LoadFile(const bf::path &path) {
|
unique_ptr<File> FilesystemImpl::LoadFile(const bf::path &path) {
|
||||||
auto node = _device->Load(path);
|
auto node = _device->Load(path);
|
||||||
auto file = dynamic_pointer_move<FuseFile>(node);
|
auto file = dynamic_pointer_move<File>(node);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw FuseErrnoException(EISDIR);
|
throw FuseErrnoException(EISDIR);
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
unique_ptr<FuseDir> FilesystemImpl::LoadDir(const bf::path &path) {
|
unique_ptr<Dir> FilesystemImpl::LoadDir(const bf::path &path) {
|
||||||
auto node = _device->Load(path);
|
auto node = _device->Load(path);
|
||||||
auto dir = dynamic_pointer_move<FuseDir>(node);
|
auto dir = dynamic_pointer_move<Dir>(node);
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
throw FuseErrnoException(ENOTDIR);
|
throw FuseErrnoException(ENOTDIR);
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ int FilesystemImpl::openFile(const bf::path &path, int flags) {
|
|||||||
return openFile(*file, flags);
|
return openFile(*file, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int FilesystemImpl::openFile(const FuseFile &file, int flags) {
|
int FilesystemImpl::openFile(const File &file, int flags) {
|
||||||
return _open_files.open(file, flags);
|
return _open_files.open(file, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
#include "fusepp/utils/macros.h"
|
#include "fusepp/utils/macros.h"
|
||||||
|
|
||||||
namespace fusepp {
|
namespace fusepp {
|
||||||
class FuseNode;
|
class Node;
|
||||||
class FuseFile;
|
class File;
|
||||||
class FuseOpenFile;
|
class OpenFile;
|
||||||
class FuseDir;
|
class Dir;
|
||||||
|
|
||||||
class FilesystemImpl {
|
class FilesystemImpl {
|
||||||
public:
|
public:
|
||||||
FilesystemImpl(FuseDevice *device);
|
FilesystemImpl(Device *device);
|
||||||
virtual ~FilesystemImpl();
|
virtual ~FilesystemImpl();
|
||||||
|
|
||||||
int openFile(const boost::filesystem::path &path, int flags);
|
int openFile(const boost::filesystem::path &path, int flags);
|
||||||
@ -42,11 +42,11 @@ public:
|
|||||||
void statfs(const boost::filesystem::path &path, struct statvfs *fsstat);
|
void statfs(const boost::filesystem::path &path, struct statvfs *fsstat);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<FuseFile> LoadFile(const boost::filesystem::path &path);
|
std::unique_ptr<File> LoadFile(const boost::filesystem::path &path);
|
||||||
std::unique_ptr<FuseDir> LoadDir(const boost::filesystem::path &path);
|
std::unique_ptr<Dir> LoadDir(const boost::filesystem::path &path);
|
||||||
int openFile(const FuseFile &file, int flags);
|
int openFile(const File &file, int flags);
|
||||||
|
|
||||||
FuseDevice *_device;
|
Device *_device;
|
||||||
FuseOpenFileList _open_files;
|
FuseOpenFileList _open_files;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(FilesystemImpl);
|
DISALLOW_COPY_AND_ASSIGN(FilesystemImpl);
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
#ifndef FUSEPP_FUSEOPENFILELIST_H_
|
#ifndef FUSEPP_FUSEOPENFILELIST_H_
|
||||||
#define FUSEPP_FUSEOPENFILELIST_H_
|
#define FUSEPP_FUSEOPENFILELIST_H_
|
||||||
|
|
||||||
|
#include <fusepp/fs_interface/File.h>
|
||||||
|
#include <fusepp/fs_interface/OpenFile.h>
|
||||||
#include "fusepp/utils/macros.h"
|
#include "fusepp/utils/macros.h"
|
||||||
#include "IdList.h"
|
#include "IdList.h"
|
||||||
#include "fusepp/fs_interface/FuseFile.h"
|
|
||||||
#include "fusepp/fs_interface/FuseOpenFile.h"
|
|
||||||
|
|
||||||
namespace fusepp {
|
namespace fusepp {
|
||||||
|
|
||||||
@ -14,12 +14,12 @@ public:
|
|||||||
FuseOpenFileList();
|
FuseOpenFileList();
|
||||||
virtual ~FuseOpenFileList();
|
virtual ~FuseOpenFileList();
|
||||||
|
|
||||||
int open(const FuseFile &rhs, int flags);
|
int open(const File &rhs, int flags);
|
||||||
FuseOpenFile *get(int descriptor);
|
OpenFile *get(int descriptor);
|
||||||
void close(int descriptor);
|
void close(int descriptor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IdList<FuseOpenFile> _open_files;
|
IdList<OpenFile> _open_files;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(FuseOpenFileList);
|
DISALLOW_COPY_AND_ASSIGN(FuseOpenFileList);
|
||||||
};
|
};
|
||||||
@ -28,11 +28,11 @@ inline FuseOpenFileList::FuseOpenFileList()
|
|||||||
:_open_files() {
|
:_open_files() {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int FuseOpenFileList::open(const FuseFile &file, int flags) {
|
inline int FuseOpenFileList::open(const File &file, int flags) {
|
||||||
return _open_files.add(file.open(flags));
|
return _open_files.add(file.open(flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline FuseOpenFile *FuseOpenFileList::get(int descriptor) {
|
inline OpenFile *FuseOpenFileList::get(int descriptor) {
|
||||||
return _open_files.get(descriptor);
|
return _open_files.get(descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user