void * hTabFindByKey (hTab * h, int key, const void *pkey, int (*compare) (const void *, const void *)) { const hashtItem *item; if ((item = _findByKey (h, key, pkey, compare))) return item->item; return NULL; }
bool DirEntryList::setUidGid(const Key &key, uid_t uid, gid_t gid) { auto found = _findByKey(key); bool changed = false; if (uid != (uid_t)-1) { found->setUid(uid); changed = true; } if (gid != (gid_t)-1) { found->setGid(gid); changed = true; } return changed; }
void DirEntryList::updateModificationTimestampForChild(const blockstore::Key &key) { auto found = _findByKey(key); found->setLastModificationTime(cpputils::time::now()); }
void DirEntryList::updateAccessTimestampForChild(const blockstore::Key &key) { auto found = _findByKey(key); // TODO Think about implementing relatime behavior. Currently, CryFS follows strictatime. found->setLastAccessTime(cpputils::time::now()); }
void DirEntryList::setAccessTimes(const blockstore::Key &key, timespec lastAccessTime, timespec lastModificationTime) { auto found = _findByKey(key); found->setLastAccessTime(lastAccessTime); found->setLastModificationTime(lastModificationTime); }
void DirEntryList::setMode(const Key &key, mode_t mode) { auto found = _findByKey(key); ASSERT ((S_ISREG(mode) && S_ISREG(found->mode())) || (S_ISDIR(mode) && S_ISDIR(found->mode())) || (S_ISLNK(mode)), "Unknown mode in entry"); found->setMode(mode); }