diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-20 13:42:12 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-20 13:42:12 -0700 |
commit | 64ad04d23107e97832ec81c0cc32a95214196d6d (patch) | |
tree | 14f30f1f1e75793b21279e476bd679600fb663a5 /src/cstore/unionfs/cstore-unionfs.cpp | |
parent | cbd1770462b2325372f90ef9200110dc66245377 (diff) | |
download | vyatta-cfg-64ad04d23107e97832ec81c0cc32a95214196d6d.tar.gz vyatta-cfg-64ad04d23107e97832ec81c0cc32a95214196d6d.zip |
remove workaround for "changed" status handling
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.cpp')
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index 7f14483..46611ed 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -780,33 +780,16 @@ UnionfsCstore::unmark_changed_with_descendants() bool UnionfsCstore::mark_changed() { - if (!mutable_cfg_path.has_parent_path()) { - /* at root, mark changed. root marker is needed by the original - * implementation as an indication of whether the whole config - * has changed. - */ - b_fs::path marker = get_work_path() / C_MARKER_CHANGED; - if (b_fs_exists(marker)) { - // already marked. treat as success. - return true; - } - if (!create_file(marker.file_string())) { - output_internal("failed to mark changed [%s]\n", - get_work_path().file_string().c_str()); - return false; - } + b_fs::path marker = get_work_path() / C_MARKER_CHANGED; + if (b_fs_exists(marker)) { + // already marked. treat as success. return true; } - - /* XXX not at root => nop for now. - * we should be marking changed here. however, as commit is still - * using its own unionfs implementation, it will not understand the - * markers and therefore will not perform the necessary cleanup when - * it's done. - * - * for now, don't mark anything besides root. the query function - * will use unionfs-specific implementation (changes-only dir). - */ + if (!create_file(marker.file_string())) { + output_internal("failed to mark changed [%s]\n", + get_work_path().file_string().c_str()); + return false; + } return true; } @@ -883,18 +866,8 @@ UnionfsCstore::get_comment(string& comment, bool active_cfg) bool UnionfsCstore::marked_changed() { - /* this function is only called by cfgPathChanged() in base class. - * - * XXX currently just use the changes_only dir for this query. - * see explanation in mark_changed(). - * - * this implementation relies on the fact that cfgPathChanged() - * includes deleted/added nodes (including deactivated/activated - * nodes since it's NOT deactivate-aware). if that is not the case, - * result will be different between deleted nodes (NOT IN - * changes_only) and deactivated nodes (IN changes_only). - */ - return b_fs_exists(get_change_path()); + b_fs::path marker = get_work_path() / C_MARKER_CHANGED; + return b_fs_exists(marker); } /* XXX currently "committed marking" is done inside commit. |