rem: struct node *node; int err;  pthread_mutex_lock(&cache_lock); node = cache_lookup(path); if (node != NULL) { time_t now = time(NULL); if (node->stat_valid - now >= 0) { *stbuf = node->stat; pthread_mutex_unlock(&cache_lock); return 0; }
add: int err = cache_get_attr(path, stbuf); if (err) { err = next_oper->oper.getattr(path, stbuf); if (!err) cache_add_attr(path, stbuf);
context: static int cache_getattr(const char *path, struct stat *stbuf){    struct node *node;    int err;    pthread_mutex_lock(&cache_lock);    node = cache_lookup(path);    if (node != NULL) {        time_t now = time(NULL);        if (node->stat_valid - now >= 0) {            *stbuf = node->stat;            pthread_mutex_unlock(&cache_lock);            return 0;        }    }    pthread_mutex_unlock(&cache_lock);    err = next_oper->oper.getattr(path, stbuf);    if (!err)        cache_add_attr(path, stbuf);    return err;}