platform_external_selinux/libselinux
Ondrej Mosnacek 02f302fc5b selinux_restorecon: introduce selinux_restorecon_parallel(3)
Refactor selinux_restorecon(3) to allow for distributing the relabeling
to multiple threads and add a new function
selinux_restorecon_parallel(3), which allows specifying the number of
threads to use. The existing selinux_restorecon(3) function maintains
the same interface and maintains the same behavior (i.e. relabeling is
done on a single thread).

The parallel implementation takes a simple approach of performing all
the directory tree traversal in a critical section and only letting the
relabeling of individual objects run in parallel. Thankfully, this
approach turns out to be efficient enough in practice, as shown by
restorecon benchmarks (detailed in a subsequent patch that switches
setfiles & restorecon to use selinux_restorecon_parallel(3)).

Note that to be able to use the parallelism, the calling application/
library must be explicitly linked to the libpthread library (statically
or dynamically). This is necessary to mantain the requirement that
libselinux shouldn't explicitly link with libpthread. (I don't know what
exactly was the reason behind this requirement as the commit logs are
fuzzy, but special care has been taken in the past to maintain it, so I
didn't want to break it...)

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-11-23 10:03:18 +01:00
..
include selinux_restorecon: introduce selinux_restorecon_parallel(3) 2021-11-23 10:03:18 +01:00
man selinux_restorecon: introduce selinux_restorecon_parallel(3) 2021-11-23 10:03:18 +01:00
src selinux_restorecon: introduce selinux_restorecon_parallel(3) 2021-11-23 10:03:18 +01:00
utils libselinux/utils: drop requirement to combine compiling and linking 2021-09-22 12:31:53 +02:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libselinux: do not duplicate make target when going into subdirectory 2021-04-30 21:09:22 +02:00
VERSION Update VERSIONs to 3.3 for release. 2021-10-21 16:31:23 +02:00