Commit 82d12284 authored by Marc Vef's avatar Marc Vef
Browse files

create_dentry() no longer returns bool but int

parent 5bee2137
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -78,3 +78,4 @@ Thumbs.db
cmake-build-debug
playground
.fuse_hidden*
configure.hpp
+2 −2
Original line number Diff line number Diff line
@@ -120,10 +120,10 @@ pair<int, fuse_ino_t> do_lookup(const fuse_ino_t p_inode, const string& name) {
 * @param name
 * @return
 */
bool create_dentry(const fuse_ino_t p_inode, const fuse_ino_t inode, const string& name, mode_t mode) {
int create_dentry(const fuse_ino_t p_inode, const fuse_ino_t inode, const string& name, mode_t mode) {
    // XXX check later if we need to check if dentry of father already exists
    // put dentry for key, value
    return db_put_dentry(db_build_dentry_key(p_inode, name), db_build_dentry_value(inode, mode));
    return db_put_dentry(db_build_dentry_key(p_inode, name), db_build_dentry_value(inode, mode)) ? 0 : 1;
}

/**
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ void get_dentries(std::vector<Dentry>& dentries, const fuse_ino_t dir_inode);

std::pair<int, fuse_ino_t> do_lookup(const fuse_ino_t p_inode, const std::string& name);

bool create_dentry(const fuse_ino_t p_inode, const fuse_ino_t inode, const std::string& name, mode_t mode);
int create_dentry(const fuse_ino_t p_inode, const fuse_ino_t inode, const std::string& name, mode_t mode);

std::pair<int, fuse_ino_t> remove_dentry(const fuse_ino_t p_inode, const std::string& name);

+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static hg_return_t rpc_srv_create_dentry(hg_handle_t handle) {
    auto mid = margo_hg_class_to_instance(hgi->hg_class);
    // create new inode number and then the dentry
    auto new_inode = Util::generate_inode_no();
    if (!create_dentry(in.parent_inode, new_inode, in.filename, in.mode)) {
    if (create_dentry(in.parent_inode, new_inode, in.filename, in.mode) != 0) {
        // if putting dentry failed, return invalid inode to indicate failure
        new_inode = INVALID_INODE;
    }