cpusets: restructure the function update_cpumask() and update_nodemask()