This has theoretical bug if our collection spans different
filesystems and some filesystems support holes, and some not.
If this ever encountered we should use pathconf(2) and cache
its result for directories.
My guess the goal was to skip files with holes in them. Original commit
590f0761f4aba64c4a3b4c8f11543a929178da38, doesn't explain that. If that
is still necessary, better to add lseek(SEEK_DATA) check later.
Some effort was made to unify monitoring via kqueue and via inotify
APIs. Now both provide their implementation of add_watch() function.
I guess there are some logical bugs in vnode_process(). With this commit
it would be better provide code as is, and resolve bugs separately.
Fix several issues with the non-destructive rescan functionality.
Most of these issues also affected inotify scanning as well. These
include annoying debug messages, adding album art for files that we
aren't supposed to be scanning anyway, incrementing the UpdateID when no
changes were made to the database, and other smaller issues.