WIP new file stats compile

Also inlined atomic functions to avoid unused static warning