PL3118 and PL3131 fix: use the correct ext2 attribute bits if possible;
authorMark Huang <mlhuang@cs.princeton.edu>
Tue, 23 Nov 2004 14:56:03 +0000 (14:56 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Tue, 23 Nov 2004 14:56:03 +0000 (14:56 +0000)
immulink changed from bit 15 to bit 27 in 2.6.x.

src/vbuild.cc
src/vunify.cc
src/vutil.h

index ed27809..dcaaa9f 100644 (file)
@@ -51,7 +51,7 @@ struct EXCLDIR{
 static vector<EXCLDIR> excldirs;
 
 
-static int  ext2flags = EXT2_IMMUTABLE_FILE_FL | EXT2_IMMUTABLE_LINK_FL;
+static int  ext2flags = EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL;
 static struct {
        int nblink;
        int nbcopy;
@@ -228,9 +228,9 @@ int main (int argc, char *argv[])
                }else if (strcmp(arg,"--noflags")==0){
                        ext2flags = 0;
                }else if (strcmp(arg,"--immutable")==0){
-                       ext2flags |= EXT2_IMMUTABLE_FILE_FL;
+                       ext2flags |= EXT2_IMMUTABLE_FL;
                }else if (strcmp(arg,"--immutable-mayunlink")==0){
-                       ext2flags |= EXT2_IMMUTABLE_LINK_FL;
+                       ext2flags |= EXT2_IUNLINK_FL;
                }else if (strcmp(arg,"--excldir")==0){
                        i++;
                        excldirs.push_back (EXCLDIR(argv[i]));
index 2b0cac9..8065f5e 100644 (file)
@@ -43,7 +43,7 @@ using namespace std;
 
 static bool undo = false;
 
-static int  ext2flags = EXT2_IMMUTABLE_FILE_FL | EXT2_IMMUTABLE_LINK_FL;
+static int  ext2flags = EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL;
 struct EXCLDIR{
        string prefix;
        int len;
@@ -338,9 +338,9 @@ int main (int argc, char *argv[])
                }else if (strcmp(arg,"--noflags")==0){
                        ext2flags = 0;
                }else if (strcmp(arg,"--immutable")==0){
-                       ext2flags |= EXT2_IMMUTABLE_FILE_FL;
+                       ext2flags |= EXT2_IMMUTABLE_FL;
                }else if (strcmp(arg,"--immutable-mayunlink")==0){
-                       ext2flags |= EXT2_IMMUTABLE_LINK_FL;
+                       ext2flags |= EXT2_IUNLINK_FL;
                }else if (strcmp(arg,"--excldir")==0){
                        i++;
                        //excldirs[excldirs.size()] = EXCLDIR(argv[i]);
index c567267..153076d 100644 (file)
@@ -36,9 +36,17 @@ extern int debug;
 extern bool testmode;
 
 // Patch to help compile this utility on unpatched kernel source
-#ifndef EXT2_IMMUTABLE_FILE_FL
-       #define EXT2_IMMUTABLE_FILE_FL  0x00000010
-       #define EXT2_IMMUTABLE_LINK_FL  0x00008000
+#ifndef EXT2_IMMUTABLE_FL
+#define EXT2_IMMUTABLE_FL 0x00000010
+#endif
+
+#ifndef EXT2_IUNLINK_FL
+/* Set both bits for backward compatibility */
+#define EXT2_IUNLINK_FL 0x08008000
+#endif
+
+#ifndef EXT2_BARRIER_FL
+#define EXT2_BARRIER_FL 0x04000000
 #endif