Redox and nonredox reactions of magnetite and hematite in rocks