Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
void DirEntryList::updateModificationTimestampForChild(const blockstore::Key &key) {
    auto found = _findByKey(key);
    found->setLastModificationTime(cpputils::time::now());
}
Esempio n. 4
0
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());
}
Esempio n. 5
0
void DirEntryList::setAccessTimes(const blockstore::Key &key, timespec lastAccessTime, timespec lastModificationTime) {
    auto found = _findByKey(key);
    found->setLastAccessTime(lastAccessTime);
    found->setLastModificationTime(lastModificationTime);
}
Esempio n. 6
0
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);
}