Exemple #1
0
/*
 * Remove file
 */
void timeshift_filemgr_remove
  ( timeshift_t *ts, timeshift_file_t *tsf, int force )
{
  if (tsf->fd != -1)
    close(tsf->fd);
  TAILQ_REMOVE(&ts->files, tsf, link);
  timeshift_reaper_remove(tsf);
}
Exemple #2
0
/*
 * Remove file
 */
void timeshift_filemgr_remove
  ( timeshift_t *ts, timeshift_file_t *tsf, int force )
{
  if (tsf->fd != -1)
    close(tsf->fd);
  tvhlog(LOG_DEBUG, "timeshift", "ts %d remove %s", ts->id, tsf->path);
  TAILQ_REMOVE(&ts->files, tsf, link);
  atomic_add_u64(&timeshift_total_size, -tsf->size);
  timeshift_reaper_remove(tsf);
}
/*
 * Remove file
 */
void timeshift_filemgr_remove
  ( timeshift_t *ts, timeshift_file_t *tsf, int force )
{
  if (tsf->wfd >= 0)
    close(tsf->wfd);
  assert(tsf->rfd < 0);
  if (tvhtrace_enabled()) {
    if (tsf->path)
      tvhdebug("timeshift", "ts %d remove %s", ts->id, tsf->path);
    else
      tvhdebug("timeshift", "ts %d RAM segment remove time %li", ts->id, (long)tsf->time);
  }
  TAILQ_REMOVE(&ts->files, tsf, link);
  atomic_dec_u64(&timeshift_total_size, tsf->size);
  if (tsf->ram)
    atomic_dec_u64(&timeshift_total_ram_size, tsf->size);
  timeshift_reaper_remove(tsf);
}