tmpfiles: move full chattr flag set to chattr-util.h
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Mar 2019 17:41:39 +0000 (18:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Mar 2019 17:43:05 +0000 (18:43 +0100)
It's a pretty generic concept and fits will there, hence let's move it.

src/basic/chattr-util.h
src/tmpfiles/tmpfiles.c

index eb6bfbe..29070c8 100644 (file)
          FS_NOCOMP_FL  |                        \
          FS_PROJINHERIT_FL)
 
+#define CHATTR_ALL_FL                           \
+        (FS_NOATIME_FL      |                   \
+         FS_SYNC_FL         |                   \
+         FS_DIRSYNC_FL      |                   \
+         FS_APPEND_FL       |                   \
+         FS_COMPR_FL        |                   \
+         FS_NODUMP_FL       |                   \
+         FS_EXTENT_FL       |                   \
+         FS_IMMUTABLE_FL    |                   \
+         FS_JOURNAL_DATA_FL |                   \
+         FS_SECRM_FL        |                   \
+         FS_UNRM_FL         |                   \
+         FS_NOTAIL_FL       |                   \
+         FS_TOPDIR_FL       |                   \
+         FS_NOCOW_FL        |                   \
+         FS_PROJINHERIT_FL)
+
 int chattr_fd(int fd, unsigned value, unsigned mask, unsigned *previous);
 int chattr_path(const char *p, unsigned value, unsigned mask, unsigned *previous);
 
index 5251c74..84e104f 100644 (file)
@@ -1096,23 +1096,6 @@ static int path_set_acls(Item *item, const char *path) {
         return r;
 }
 
-#define ATTRIBUTES_ALL                          \
-        (FS_NOATIME_FL      |                   \
-         FS_SYNC_FL         |                   \
-         FS_DIRSYNC_FL      |                   \
-         FS_APPEND_FL       |                   \
-         FS_COMPR_FL        |                   \
-         FS_NODUMP_FL       |                   \
-         FS_EXTENT_FL       |                   \
-         FS_IMMUTABLE_FL    |                   \
-         FS_JOURNAL_DATA_FL |                   \
-         FS_SECRM_FL        |                   \
-         FS_UNRM_FL         |                   \
-         FS_NOTAIL_FL       |                   \
-         FS_TOPDIR_FL       |                   \
-         FS_NOCOW_FL        |                   \
-         FS_PROJINHERIT_FL)
-
 static int parse_attribute_from_arg(Item *item) {
 
         static const struct {
@@ -1186,7 +1169,7 @@ static int parse_attribute_from_arg(Item *item) {
         }
 
         if (mode == MODE_SET)
-                mask |= ATTRIBUTES_ALL;
+                mask |= CHATTR_ALL_FL;
 
         assert(mask != 0);