Merge pull request #14614 from poettering/import-fixlets

three small importd fixes
This commit is contained in:
Anita Zhang
2020-01-22 03:48:31 -08:00
committed by GitHub
5 changed files with 32 additions and 23 deletions
+14
View File
@@ -4,6 +4,8 @@
#include "alloc-util.h"
#include "btrfs-util.h"
#include "chattr-util.h"
#include "errno-util.h"
#include "import-util.h"
#include "log.h"
#include "macro.h"
@@ -163,3 +165,15 @@ int import_assign_pool_quota_and_warn(const char *path) {
return 0;
}
int import_set_nocow_and_log(int fd, const char *path) {
int r;
r = chattr_fd(fd, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
if (r < 0)
return log_full_errno(
ERRNO_IS_NOT_SUPPORTED(r) ? LOG_DEBUG : LOG_WARNING,
r, "Failed to set file attributes on %s: %m", path);
return 0;
}
+2
View File
@@ -23,3 +23,5 @@ int tar_strip_suffixes(const char *name, char **ret);
int raw_strip_suffixes(const char *name, char **ret);
int import_assign_pool_quota_and_warn(const char *path);
int import_set_nocow_and_log(int fd, const char *path);