HDFS-7506. Consolidate implementation of setting inode attributes into a single class. Contributed by Haohui Mai.