Commit 2a94a368 authored by Sebastian Oeste's avatar Sebastian Oeste
Browse files

fix: minor changes

* use const ref when iterating over dir entries.
* use type alias bfs:: is more convinient
* replace a last c-style cast by static_cast
parent 120ff84e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ int adafs_readdir(const char* p, void* buf, fuse_fill_dir_t filler, off_t offset
    // visualizing current and parent dir
    filler(buf, ".", nullptr, 0, FUSE_FILL_DIR_PLUS);
    filler(buf, "..", nullptr, 0, FUSE_FILL_DIR_PLUS);
    for (auto& dentry : *dentries) {
    for (const auto& dentry : *dentries) {
        // XXX I have no idea what the last parameter really does...
        ADAFS_DATA->logger->debug("readdir entries: dentry: {}", dentry);
        filler(buf, dentry.c_str(), nullptr, 0, FUSE_FILL_DIR_PLUS);
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ struct adafs_data {
#define ADAFS_ROOT_INODE 1

namespace util {
    boost::filesystem::path adafs_fullpath(const std::string& path);
    bfs::path adafs_fullpath(const std::string& path);

    int init_inode_no();

+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ namespace util {

    ino_t generate_inode_no() {
        std::lock_guard<std::mutex> inode_lock(ADAFS_DATA->inode_mutex);
        return (ino_t) ++ADAFS_DATA->inode_count;
        return static_cast<ino_t>(++ADAFS_DATA->inode_count);
    }

    // XXX error handling