Remove 2>/dev/null from three lvm commands executed by vgimportclone.
Add configure --enable-udev-systemd-background-jobs.
Add lvm2-pvscan@.service to run pvscan as a service for lvmetad/autoactivation.
+ Use #ifdef __linux__ instead of linux throughout.
Fix lvconvert swap of poolmetadata volume for active thin pool.
Check for open count with a timeout before removal/deactivation of an LV.
Report RAID images split with tracking as out-of-sync ("I").
#include <arpa/inet.h> /* for htonl, ntohl */
#include <fcntl.h> /* for musl libc */
-#ifdef linux
+#ifdef __linux__
/*
* Kernel version 2.6.36 and higher has
* new OOM killer adjustment interface.
_exit_now = 1;
}
-#ifdef linux
+#ifdef __linux__
static int _set_oom_adj(const char *oom_adj_path, int val)
{
FILE *fp;
fd = rlim.rlim_cur;
for (--fd; fd >= 0; fd--) {
-#ifdef linux
+#ifdef __linux__
/* Do not close fds preloaded by systemd! */
if (_systemd_activation &&
(fd == SD_FD_FIFO_SERVER || fd == SD_FD_FIFO_CLIENT))
if (_restart)
restart();
-#ifdef linux
+#ifdef __linux__
_systemd_activation = _systemd_handover(&fifos);
#endif
signal(SIGHUP, &_exit_handler);
signal(SIGQUIT, &_exit_handler);
-#ifdef linux
+#ifdef __linux__
/* Systemd has adjusted oom killer for us already */
if (!_systemd_activation && !_protect_against_oom_killer())
syslog(LOG_ERR, "Failed to protect against OOM killer");
/* TODO - move this mountinfo code into library to be reusable */
-#ifdef linux
+#ifdef __linux__
# include "kdev_t.h"
#else
# define MAJOR(x) major((x))
if (lv_is_thin_pool(lv) &&
(lv_is_raid(seg_lv(first_seg(lv), 0)) ||
lv_is_raid(first_seg(lv)->metadata_lv))) {
- log_error("Thinpool data or metadata volume"
- " must be specified. (e.g. \"%s/%s_tdata\")",
+ log_error("Thin pool data or metadata volume "
+ "must be specified. (E.g. \"%s/%s_tdata\")",
lv->vg->name, lv->name);
return 0;
}
#include <syslog.h>
#include <time.h>
-#ifdef linux
+#ifdef __linux__
# include <malloc.h>
#endif
#include <unistd.h>
#include <sys/ioctl.h>
-#ifdef linux
+#ifdef __linux__
# define u64 uint64_t /* Missing without __KERNEL__ */
# undef WNOHANG /* Avoid redefinition */
# undef WUNTRACED /* Avoid redefinition */
#include "metadata.h"
#include "xlate.h"
-#ifdef linux
+#ifdef __linux__
/* Lifted from <linux/raid/md_p.h> because of difficulty including it */
#include "lib.h"
#include "dev-type.h"
-#ifdef linux
+#ifdef __linux__
#define MAX_PAGESIZE (64 * 1024)
#define SIGNATURE_SIZE 10
return ret;
}
-#ifdef linux
+#ifdef __linux__
static unsigned long _dev_topology_attribute(struct dev_types *dt,
const char *attribute,
#define NUMBER_OF_MAJORS 4096
-#ifdef linux
+#ifdef __linux__
# define MAJOR(dev) ((dev & 0xfff00) >> 8)
# define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00))
# define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
#include "lib.h"
#include "filter.h"
-#ifdef linux
+#ifdef __linux__
static int _ignore_md(struct dev_filter *f __attribute__((unused)),
struct device *dev)
#include "filter.h"
#include "activate.h"
-#ifdef linux
+#ifdef __linux__
#include <dirent.h>
#include "lib.h"
#include "filter.h"
-#ifdef linux
+#ifdef __linux__
#include <dirent.h>
#ifndef _LVM_XLATE_H
#define _LVM_XLATE_H
-#ifdef linux
+#ifdef __linux__
# include <endian.h>
# include <byteswap.h>
#else
#define EXIT_ALREADYRUNNING 13
-#ifdef linux
+#ifdef __linux__
#include <stddef.h>
fd = rlim.rlim_cur;
for (--fd; fd >= 0; fd--) {
-#ifdef linux
+#ifdef __linux__
/* Do not close fds preloaded by systemd! */
if (_systemd_activation && fd == SD_FD_SOCKET_SERVER)
continue;
if (setenv("LC_ALL", "C", 1))
perror("Cannot set LC_ALL to C");
-#ifdef linux
+#ifdef __linux__
_systemd_activation = _systemd_handover(&s);
#endif
signal(SIGALRM, &_exit_handler);
signal(SIGPIPE, SIG_IGN);
-#ifdef linux
+#ifdef __linux__
/* Systemd has adjusted oom killer for us already */
if (s.avoid_oom && !_systemd_activation && !_protect_against_oom_killer())
ERROR(&s, "Failed to protect against OOM killer");
#include <sys/utsname.h>
#include <limits.h>
-#ifdef linux
+#ifdef __linux__
# include "kdev_t.h"
# include <linux/limits.h>
#else
# include <libudev.h>
#endif
-#ifdef linux
+#ifdef __linux__
# include <linux/fs.h>
#endif
return 1;
}
-#ifdef linux
+#ifdef __linux__
static int _open_dev_node(const char *dev_name)
{
int fd = -1;
#ifndef _LINUX_DM_IOCTL_V4_H
#define _LINUX_DM_IOCTL_V4_H
-#ifdef linux
+#ifdef __linux__
# include <linux/types.h>
#endif
__result; }))
#endif
-#ifdef linux
+#ifdef __linux__
# include "kdev_t.h"
#else
# define MAJOR(x) major((x))