From: Ondrej Kozina Date: Tue, 12 Mar 2013 14:01:42 +0000 (+0100) Subject: - fixes related to XATTRS status flag X-Git-Tag: v0.1.3~18^2~12 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=d01c12483bf46196166a1533b0f5488050b3804a;p=thirdparty%2Fsnapper.git - fixes related to XATTRS status flag XATTRS status flag is now placed on fixed (effectively reserved) position no matter the ENABLE_XATTR #define state. --- diff --git a/snapper/File.cc b/snapper/File.cc index aa8ca4ea..b832eb63 100644 --- a/snapper/File.cc +++ b/snapper/File.cc @@ -39,6 +39,9 @@ #include "snapper/Compare.h" #include "snapper/Exception.h" +#ifdef ENABLE_XATTRS +#include +#endif namespace snapper { @@ -616,11 +619,14 @@ namespace snapper #ifdef ENABLE_XATTRS /* - * NOTE: following statement is not valid for btrfs - * * xattributes have to be transfered as well * if we'are about to create new type during * undo! + * + * TODO: for btrfs only: + * + * if we use clone() ioctl for btrfs, we don't need to + * recreate xattributes */ if (getPreToPostStatus() & (XATTRS | TYPE | DELETED)) { @@ -725,11 +731,8 @@ namespace snapper ret += status & PERMISSIONS ? "p" : "."; ret += status & USER ? "u" : "."; ret += status & GROUP ? "g" : "."; - - -#ifdef ENABLE_XATTRS ret += status & XATTRS ? "x" : "."; -#endif + return ret; } @@ -768,13 +771,12 @@ namespace snapper ret |= GROUP; } -#ifdef ENABLE_XATTRS if (str.length() >= 5) { if (str[4] == 'x') ret |= XATTRS; } -#endif + return ret; } diff --git a/snapper/File.h b/snapper/File.h index f3843925..74732975 100644 --- a/snapper/File.h +++ b/snapper/File.h @@ -29,9 +29,6 @@ #include #include -#ifdef ENABLE_XATTRS -#include -#endif namespace snapper { @@ -42,10 +39,7 @@ namespace snapper enum StatusFlags { CREATED = 1, DELETED = 2, TYPE = 4, CONTENT = 8, PERMISSIONS = 16, USER = 32, - GROUP = 64 -#ifdef ENABLE_XATTRS - ,XATTRS = 128 -#endif + GROUP = 64, XATTRS = 128 }; enum Cmp