X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=store.cc;h=bfeb18a77ceadcaaeca8f555283430847a4fa24e;hp=00d08780007dde3a8b2617ceb7e89d5d75afd5cd;hb=dd553bb0b2ac2fe7a1904d2f2670f37e3bb25ae6;hpb=52df48ca169e07caa5c726d51ed4ed83aed748a5 diff --git a/store.cc b/store.cc index 00d0878..bfeb18a 100644 --- a/store.cc +++ b/store.cc @@ -1,13 +1,31 @@ -/* LBS: An LFS-inspired filesystem backup system - * Copyright (C) 2008 Michael Vrable +/* Cumulus: Smart Filesystem Backup to Dumb Servers * - * Backup data is stored in a collection of objects, which are grouped together + * Copyright (C) 2008 The Regents of the University of California + * Written by Michael Vrable + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* Backup data is stored in a collection of objects, which are grouped together * into segments for storage purposes. This implementation of the object store * represents segments as TAR files and objects as files within them. */ #include #include #include +#include #include #include #include @@ -25,6 +43,7 @@ #include "store.h" #include "ref.h" +#include "util.h" using std::max; using std::list; @@ -37,16 +56,6 @@ using std::string; const char *filter_program = "bzip2 -c"; const char *filter_extension = ".bz2"; -static void cloexec(int fd) -{ - long flags = fcntl(fd, F_GETFD); - - if (flags < 0) - return; - - fcntl(fd, F_SETFD, flags | FD_CLOEXEC); -} - Tarfile::Tarfile(RemoteFile *file, const string &segment) : size(0), segment_name(segment)