Merge pull request #25559 from intelfx/work/systemd-importd-quotas
import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd
This commit is contained in:
@@ -22,7 +22,7 @@ static int check_btrfs(void) {
|
||||
return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
|
||||
}
|
||||
|
||||
int setup_machine_directory(sd_bus_error *error) {
|
||||
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota) {
|
||||
int r;
|
||||
|
||||
r = check_btrfs();
|
||||
@@ -31,8 +31,14 @@ int setup_machine_directory(sd_bus_error *error) {
|
||||
if (r == 0)
|
||||
return 0;
|
||||
|
||||
if (!use_btrfs_subvol)
|
||||
return 0;
|
||||
|
||||
(void) btrfs_subvol_make_label("/var/lib/machines");
|
||||
|
||||
if (!use_btrfs_quota)
|
||||
return 0;
|
||||
|
||||
r = btrfs_quota_enable("/var/lib/machines", true);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to enable quota for /var/lib/machines, ignoring: %m");
|
||||
@@ -41,5 +47,5 @@ int setup_machine_directory(sd_bus_error *error) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines, ignoring: %m");
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
int setup_machine_directory(sd_bus_error *error);
|
||||
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota);
|
||||
|
||||
Reference in New Issue
Block a user