I think you may want to create a new transaction here and call internal methods, rather than relying on public methods on the fs object, so that this operation is atomic.

See `open_file`, `fstat_file`, et. al.