Loading fs/src/fuse_ops/file.cpp +20 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,26 @@ int adafs_mknod(const char* p, mode_t mode, dev_t dev) { * filehandle in the fuse_file_info structure, which will be * passed to all file operations. */ int adafs_open(const char* p, struct fuse_file_info* ffi) { // XXX ignored for now. Will be similar to opendir. Implement when implementing I/O return 0; int adafs_open(const char* p, struct fuse_file_info* fi) { ADAFS_DATA->logger->debug("FUSE: adafs_open() enter"s); // XXX error handling auto path = bfs::path(p); auto md = make_shared<Metadata>(); get_metadata(*md, path); int access = fi->flags & O_ACCMODE; switch (access) { case O_RDONLY: return chk_access(*md, R_OK); case O_WRONLY: return chk_access(*md, W_OK); case O_RDWR: return chk_access(*md, R_OK | W_OK); default: return -EACCES; } } /** Loading fs/src/fuse_ops/sync.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ * Filesystems shouldn't assume that flush will always be called * after some writes, or that if will be called at all. */ int adafs_flush(const char*, struct fuse_file_info*) { // currently a NO-OP in ADA-FS int adafs_flush(const char* p, struct fuse_file_info*) { return 0; } Loading
fs/src/fuse_ops/file.cpp +20 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,26 @@ int adafs_mknod(const char* p, mode_t mode, dev_t dev) { * filehandle in the fuse_file_info structure, which will be * passed to all file operations. */ int adafs_open(const char* p, struct fuse_file_info* ffi) { // XXX ignored for now. Will be similar to opendir. Implement when implementing I/O return 0; int adafs_open(const char* p, struct fuse_file_info* fi) { ADAFS_DATA->logger->debug("FUSE: adafs_open() enter"s); // XXX error handling auto path = bfs::path(p); auto md = make_shared<Metadata>(); get_metadata(*md, path); int access = fi->flags & O_ACCMODE; switch (access) { case O_RDONLY: return chk_access(*md, R_OK); case O_WRONLY: return chk_access(*md, W_OK); case O_RDWR: return chk_access(*md, R_OK | W_OK); default: return -EACCES; } } /** Loading
fs/src/fuse_ops/sync.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ * Filesystems shouldn't assume that flush will always be called * after some writes, or that if will be called at all. */ int adafs_flush(const char*, struct fuse_file_info*) { // currently a NO-OP in ADA-FS int adafs_flush(const char* p, struct fuse_file_info*) { return 0; }