HDFS-5673: simplify mask calculation logic.