summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4d4c748)
/run/initramfs usually contains the initrd so that we can jump back into
it on shutdown. It's usually relatively large and static data, hence we
should avoid relabelling of it. On my netbook this saves 6s. (6.6s
needed for relabelling /dev and /run goes down to 600ms -- still way too
much, but much better).
struct FTW *ftwbuf) {
/* No need to label /dev twice in a row... */
struct FTW *ftwbuf) {
/* No need to label /dev twice in a row... */
- if (ftwbuf->level == 0)
- return 0;
+ if (_unlikely_(ftwbuf->level == 0))
+ return FTW_CONTINUE;
+
+ /* /run/initramfs is static data and big, no need to
+ * dynamically relabel it at boot... */
+ if (_unlikely_(ftwbuf->level == 1 &&
+ tflag == FTW_D &&
+ streq(fpath, "/run/initramfs")))
+ return FTW_SKIP_SUBTREE;
};
int mount_setup(bool loaded_policy) {
};
int mount_setup(bool loaded_policy) {
before_relabel = now(CLOCK_MONOTONIC);
before_relabel = now(CLOCK_MONOTONIC);
- nftw("/dev", nftw_cb, 64, FTW_MOUNT|FTW_PHYS);
- nftw("/run", nftw_cb, 64, FTW_MOUNT|FTW_PHYS);
+ nftw("/dev", nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
+ nftw("/run", nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
after_relabel = now(CLOCK_MONOTONIC);
after_relabel = now(CLOCK_MONOTONIC);