Merge pull request #14614 from poettering/import-fixlets
three small importd fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user