• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 14554080340

19 Apr 2025 11:46AM UTC coverage: 72.101% (-0.03%) from 72.13%
14554080340

push

github

web-flow
Add two new paragraphs to coding style about header files (#37188)

296880 of 411754 relevant lines covered (72.1%)

687547.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.13
/src/shared/machine-pool.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <errno.h>
4

5
#include "btrfs-util.h"
6
#include "label-util.h"
7
#include "log.h"
8
#include "machine-pool.h"
9
#include "missing_magic.h"
10
#include "stat-util.h"
11

12
static int check_btrfs(void) {
9✔
13
        struct statfs sfs;
9✔
14

15
        if (statfs("/var/lib/machines", &sfs) < 0) {
9✔
16
                if (errno != ENOENT)
×
17
                        return -errno;
×
18

19
                if (statfs("/var/lib", &sfs) < 0)
×
20
                        return -errno;
×
21
        }
22

23
        return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
9✔
24
}
25

26
int setup_machine_directory(sd_bus_error *error, bool use_btrfs_subvol, bool use_btrfs_quota) {
9✔
27
        int r;
9✔
28

29
        r = check_btrfs();
9✔
30
        if (r < 0)
9✔
31
                return sd_bus_error_set_errnof(error, r, "Failed to determine whether /var/lib/machines is located on btrfs: %m");
×
32
        if (r == 0)
9✔
33
                return 0;
34

35
        if (!use_btrfs_subvol)
×
36
                return 0;
37

38
        (void) btrfs_subvol_make_label("/var/lib/machines");
×
39

40
        if (!use_btrfs_quota)
×
41
                return 0;
42

43
        r = btrfs_quota_enable("/var/lib/machines", true);
×
44
        if (r < 0)
×
45
                log_warning_errno(r, "Failed to enable quota for /var/lib/machines, ignoring: %m");
×
46

47
        r = btrfs_subvol_auto_qgroup("/var/lib/machines", 0, true);
×
48
        if (r < 0)
×
49
                log_warning_errno(r, "Failed to set up default quota hierarchy for /var/lib/machines, ignoring: %m");
×
50

51
        return 0;
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc