[systemd-devel] [PATCH 2/4] Adding unmount functions to be used in shutdown

Kay Sievers kay.sievers at vrfy.org
Thu Oct 7 00:24:40 PDT 2010


On Thu, Oct 7, 2010 at 06:03,  <fidencio at profusion.mobi> wrote:
> +        if (udev_enumerate_add_match_subsystem(e, "block") < 0) {
> +                r = -EIO;
> +                goto finish;
> +        }
> +
> +        if (udev_enumerate_scan_devices(e) < 0) {
> +                r = -EIO;
> +                goto finish;
> +        }
> +
> +        first = udev_enumerate_get_list_entry(e);
> +
> +        udev_list_entry_foreach(item, first) {
> +                MountPoint *lb;
> +                char buf[PATH_MAX];
> +                char *loop;
> +
> +                snprintf(buf, sizeof(buf), "%s", udev_list_entry_get_name(item));
> +                if (strstr(buf, "loop"))

I think, here you can let libudev return only the loop devices with:
  udev_enumerate_add_match_sysname(, "loop*");

Kay


More information about the systemd-devel mailing list