Prakash-Surya/lustre — comment on commit d6e2b4bb3ea7775588de6beb8ad01049fbeacec7
File: lustre/utils/mount_lustre.c line 278
By nedbass:

It looks like add_mgsnids() is a special case in that it handles multiple mgsnode= parameters. This is confusing to me since as far as I know there can be only one mgs per filesystem, but maybe there are plans to support multiple mgs nodes someday. In any case, it seems to me you could write a function to handle the general case where only one instance of a parameter is expected. Perhaps it could take the PARAM_ string constant as an argument so you could still specifically only parse out the parameters you want. So you could have something like

int add_param(char *option, char *params, const char *param);

add_param(options, ldd->ldd_params, PARAM_UPCALL);
add_param(options, ldd->ldd_params, PARAM_STRIPESIZE);
add_param(options, ldd->ldd_params, PARAM_STRIPECOUNT);

etc.