X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmgs%2Fmgs_llog.c;h=00e2fbc64b85c82c65dc3879cb12efd27fe2d482;hp=945dca5d9d4075f1d619d18f92f3667146d3fdf6;hb=294b0efc31ae733c821fb76670238c51ca30d7f7;hpb=4642f30970c8737f31d63c75eeda2cff15c68a77 diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 945dca5..00e2fbc 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -3897,6 +3897,7 @@ int mgs_nodemap_cmd(const struct lu_env *env, struct mgs_device *mgs, const char *param) { lnet_nid_t nid[2]; + __u32 idmap[2]; bool bool_switch; __u32 int_id; int rc = 0; @@ -3937,6 +3938,30 @@ int mgs_nodemap_cmd(const struct lu_env *env, struct mgs_device *mgs, int_id = simple_strtoul(param, NULL, 10); rc = nodemap_set_squash_gid(nodemap_name, int_id); break; + case LCFG_NODEMAP_ADD_UIDMAP: + case LCFG_NODEMAP_ADD_GIDMAP: + rc = nodemap_parse_idmap(param, idmap); + if (rc != 0) + break; + if (cmd == LCFG_NODEMAP_ADD_UIDMAP) + rc = nodemap_add_idmap(nodemap_name, NODEMAP_UID, + idmap); + else + rc = nodemap_add_idmap(nodemap_name, NODEMAP_GID, + idmap); + break; + case LCFG_NODEMAP_DEL_UIDMAP: + case LCFG_NODEMAP_DEL_GIDMAP: + rc = nodemap_parse_idmap(param, idmap); + if (rc != 0) + break; + if (cmd == LCFG_NODEMAP_DEL_UIDMAP) + rc = nodemap_del_idmap(nodemap_name, NODEMAP_UID, + idmap); + else + rc = nodemap_del_idmap(nodemap_name, NODEMAP_GID, + idmap); + break; default: rc = -EINVAL; }