/* lmt_oss_v1: single oss (no ost info) */ void lmt_db_insert_oss_v1 (char *s) { ListIterator itr = NULL; lmt_db_t db; char *ossname = NULL; float pct_cpu, pct_mem; if (_init_db_ifneeded () < 0) goto done; if (lmt_oss_decode_v1 (s, &ossname, &pct_cpu, &pct_mem) < 0) goto done; itr = list_iterator_create (dbs); while ((db = list_next (itr))) { /* N.B. defeat automatic insertion of new OSS_INFO for legacy, * as there is no way to tie OSS to a particular file system. */ if (lmt_db_lookup (db, "oss", ossname) < 0) continue; if (lmt_db_insert_oss_data (db, 1, ossname, pct_cpu, pct_mem) < 0) { _trigger_db_reconnect (); goto done; } } done: if (ossname) free (ossname); if (itr) list_iterator_destroy (itr); }
int _parse_oss_v1 (const char *s) { int retval = -1; char *name = NULL; float pct_cpu, pct_mem; if (lmt_oss_decode_v1 (s, &name, &pct_cpu, &pct_mem) < 0) goto done; retval = 0; done: if (name) free (name); return retval; }