for (Snapshots::iterator it = snapshots.begin(); it != snapshots.end(); ++it)
{
- it->flushInfo();
-
try
{
it->handleUmountFilesystemSnapshot();
}
- Snapshots::iterator
- Snapper::createSingleSnapshot(string description)
- {
- return snapshots.createSingleSnapshot(0, description, "", map<string, string>());
- }
-
-
- Snapshots::iterator
- Snapper::createPreSnapshot(string description)
- {
- return snapshots.createPreSnapshot(0, description, "", map<string, string>());
- }
-
-
- Snapshots::iterator
- Snapper::createPostSnapshot(string description, Snapshots::const_iterator pre)
- {
- return snapshots.createPostSnapshot(pre, 0, description, "", map<string, string>());
- }
-
-
Snapshots::iterator
Snapper::createSingleSnapshot(uid_t uid, const string& description, const string& cleanup,
const map<string, string>& userdata)
Snapshots::const_iterator getSnapshotCurrent() const;
- Snapshots::iterator createSingleSnapshot(string description) __attribute__ ((deprecated));
- Snapshots::iterator createPreSnapshot(string description) __attribute__ ((deprecated));
- Snapshots::iterator createPostSnapshot(string description, Snapshots::const_iterator pre) __attribute__ ((deprecated));
Snapshots::iterator createSingleSnapshot(uid_t uid, const string& description,
const string& cleanup,
Snapshot::Snapshot(const Snapper* snapper, SnapshotType type, unsigned int num, time_t date)
: snapper(snapper), type(type), num(num), date(date), uid(0), pre_num(0),
- info_modified(false), mount_checked(false), mount_user_request(false),
- mount_use_count(0)
+ mount_checked(false), mount_user_request(false), mount_use_count(0)
{
}
}
- void
- Snapshot::setUid(uid_t val)
- {
- if (isCurrent())
- throw IllegalSnapshotException();
-
- uid = val;
- info_modified = true;
- }
-
-
- void
- Snapshot::setDescription(const string& val)
- {
- if (isCurrent())
- throw IllegalSnapshotException();
-
- description = val;
- info_modified = true;
- }
-
-
- void
- Snapshot::setCleanup(const string& val)
- {
- if (isCurrent())
- throw IllegalSnapshotException();
-
- cleanup = val;
- info_modified = true;
- }
-
-
- void
- Snapshot::setUserdata(const map<string, string>& val)
- {
- if (isCurrent())
- throw IllegalSnapshotException();
-
- for (map<string, string>::const_iterator it = val.begin(); it != val.end(); ++it)
- {
- if (it->first.empty() || it->first.find_first_of(",=") != string::npos)
- throw InvalidUserdataException();
-
- if (it->second.find_first_of(",=") != string::npos)
- throw InvalidUserdataException();
- }
-
- userdata = val;
- info_modified = true;
- }
-
-
void
Snapshots::read()
{
}
- void
- Snapshot::flushInfo()
- {
- if (!info_modified)
- return;
-
- writeInfo();
- info_modified = false;
- }
-
-
void
Snapshot::writeInfo() const
{
}
- Snapshots::iterator
- Snapshots::createSingleSnapshot(string description)
- {
- return createSingleSnapshot(0, description, "", map<string, string>());
- }
-
-
- Snapshots::iterator
- Snapshots::createPreSnapshot(string description)
- {
- return createPreSnapshot(0, description, "", map<string, string>());
- }
-
-
- Snapshots::iterator
- Snapshots::createPostSnapshot(string description, Snapshots::const_iterator pre)
- {
- return createPostSnapshot(pre, 0, description, "", map<string, string>());
- }
-
-
Snapshots::iterator
Snapshots::createSingleSnapshot(uid_t uid, const string& description, const string& cleanup,
const map<string, string>& userdata)
/*
- * Copyright (c) [2011-2014] Novell, Inc.
+ * Copyright (c) [2011-2015] Novell, Inc.
*
* All Rights Reserved.
*
time_t getDate() const { return date; }
- void setUid(uid_t uid) __attribute__ ((deprecated));
uid_t getUid() const { return uid; }
unsigned int getPreNum() const { return pre_num; }
- void setDescription(const string& description) __attribute__ ((deprecated));
string getDescription() const { return description; }
- void setCleanup(const string& cleanup) __attribute__ ((deprecated));
string getCleanup() const { return cleanup; }
- void setUserdata(const map<string, string>& userdata) __attribute__ ((deprecated));
map<string, string> getUserdata() const { return userdata; }
- void flushInfo() __attribute__ ((deprecated));
string snapshotDir() const;
map<string, string> userdata;
- bool info_modified;
-
mutable bool mount_checked;
mutable bool mount_user_request;
mutable unsigned int mount_use_count;
void checkUserdata(const map<string, string>& userdata) const;
- iterator createSingleSnapshot(string description) __attribute__ ((deprecated));
- iterator createPreSnapshot(string description) __attribute__ ((deprecated));
- iterator createPostSnapshot(string description, const_iterator pre) __attribute__ ((deprecated));
-
iterator createSingleSnapshot(uid_t uid, const string& description, const string& cleanup,
const map<string, string>& userdata);
iterator createSingleSnapshot(const_iterator parent, bool read_only, uid_t uid,