diff --git a/src/filestore.hpp b/src/filestore.hpp index 442b043dd..d5834fcd4 100644 --- a/src/filestore.hpp +++ b/src/filestore.hpp @@ -113,13 +113,13 @@ class FileStore { FsHeader *getHeader(); /** - * Gets the record at the given id. + * Gets the inode at the given id. * @param root the root node to start comparing on * @param id id of the "file" * @param pathLen number of characters in pathLen * @return the requested Inode, if available */ - Inode *getRecord(Inode *root, InodeId_t id); + Inode *getInode(Inode *root, InodeId_t id); /** * Gets an address for a new Inode. @@ -128,14 +128,14 @@ class FileStore { void *alloc(FsSize_t size); /** - * Compresses all of the records into a contiguous space, starting at m_root. + * Compresses all of the inode into a contiguous space, starting at m_root. */ void compress(); /** * Inserts the given insertValue into the tree of the given root. - * If the record already exists, it replaces the old on deletes it. - * @return true if the record was inserted + * If the inode already exists, it replaces the old on deletes it. + * @return true if the inode was inserted */ bool insert(Inode *root, Inode *insertValue); @@ -229,7 +229,7 @@ int FileStore::write(InodeId_t id, void *data, FsSize_t dataLen) { template int FileStore::read(InodeId_t id, void *data, FsSize_t *size) { - auto inode = getRecord(m_root, id); + auto inode = getInode(m_root, id); int retval = 1; if (inode) { if (size) { @@ -243,7 +243,7 @@ int FileStore::read(InodeId_t id, void *data, FsSize_t *size) { template typename FileStore::StatInfo FileStore::stat(InodeId_t id) { - auto inode = getRecord(m_root, id); + auto inode = getInode(m_root, id); StatInfo stat; if (inode) { stat.size = inode->dataLen; @@ -260,16 +260,16 @@ typename FileStore::FsHeader *FileStore::getHeader() { } template -typename FileStore::Inode *FileStore::getRecord(Inode *root, InodeId_t id) { +typename FileStore::Inode *FileStore::getInode(Inode *root, InodeId_t id) { Inode *retval = nullptr; if (root->m_id > id) { if (root->left) { - retval = getRecord(ptr(root->left), id); + retval = getInode(ptr(root->left), id); } } else if (root->m_id < id) { if (root->right) { - retval = getRecord(ptr(root->right), id); + retval = getInode(ptr(root->right), id); } } else if (root->m_id == id) { retval = root; @@ -288,12 +288,12 @@ void *FileStore::alloc(FsSize_t size) { } const auto retval = lastInode()->next; - const auto rec = ptr(retval); - memset(rec, 0, size); - rec->prev = ptr(lastInode()); - rec->next = retval + size; + const auto inode = ptr(retval); + memset(inode, 0, size); + inode->prev = ptr(lastInode()); + inode->next = retval + size; firstInode()->prev = retval; - return rec; + return inode; } template