]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixes related to XATTRS status flag
authorOndrej Kozina <okozina@redhat.com>
Tue, 12 Mar 2013 14:01:42 +0000 (15:01 +0100)
committerOndrej Kozina <okozina@redhat.com>
Tue, 12 Mar 2013 14:01:42 +0000 (15:01 +0100)
XATTRS status flag is now placed on fixed (effectively reserved)
position no matter the ENABLE_XATTR #define state.

snapper/File.cc
snapper/File.h

index aa8ca4ea91406719d326b6ed9545deef2c613805..b832eb63c81216a2e90b647926a2c29e8478dc62 100644 (file)
@@ -39,6 +39,9 @@
 #include "snapper/Compare.h"
 #include "snapper/Exception.h"
 
+#ifdef ENABLE_XATTRS
+#include <snapper/XAttributes.h>
+#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;
     }
 
index f3843925dc629b161e848b83de162e23a4e1948d..7473297542cb30a17950c1cb408323054bb04f72 100644 (file)
@@ -29,9 +29,6 @@
 #include <string>
 #include <vector>
 
-#ifdef ENABLE_XATTRS
-#include <snapper/XAttributes.h>
-#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