bsdperimeter/pfsense — pull request #195 by phil-davis (2012-07-31 09:07:13+00:00)
Title: Don't conf_mount_rw every time packages are listed

Every time System:Packages is selected, the code does a conf_mount_rw, checks for existence of some dirs, then does conf_mount_ro. This makes navigating the package install GUI slow on nanobsd, and it is not needed.
Do is_dir checks first, then conf_mount_rw only if they need to be created. The is_dir function works fine on a read-only filesystem.
Now it is much quicker to list the installed packages.
Note: now that the shared memory "mount reference count" is protected by a lock, it is easy to see when a mount or dismount is done:
ls -l /tmp/shm1000.lock
The file gets touched each time the mount state is changed, so you can easily see when something last happened.