summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
Diffstat (limited to 'discover')
-rw-r--r--discover/udev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/discover/udev.c b/discover/udev.c
index b1a25b3..656c5ab 100644
--- a/discover/udev.c
+++ b/discover/udev.c
@@ -26,6 +26,11 @@
#include "device-handler.h"
#include "cdrom.h"
+/* We set a default monitor buffer size, as we may not process monitor
+ * events while performing device discvoery. systemd uses a 128M buffer, so
+ * we'll do the same here */
+static const int monitor_bufsize = 128 * 1024 * 1024;
+
struct pb_udev {
struct udev *udev;
struct udev_monitor *monitor;
@@ -355,6 +360,12 @@ static int udev_setup_monitor(struct udev *udev, struct udev_monitor **monitor)
goto out_err;
}
+ result = udev_monitor_set_receive_buffer_size(m, monitor_bufsize);
+ if (result) {
+ pb_log("udev_monitor_set_rx_bufsize(%d) failed\n",
+ monitor_bufsize);
+ }
+
result = udev_monitor_filter_add_match_subsystem_devtype(m, "block",
NULL);
OpenPOWER on IntegriCloud