MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dumper_remove

Function dumper_remove

freebsd/kern/kern_shutdown.c:1325–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1323}
1324
1325int
1326dumper_remove(const char *devname, const struct diocskerneldump_arg *kda)
1327{
1328 struct dumperinfo *di, *sdi;
1329 bool found;
1330 int error;
1331
1332 error = priv_check(curthread, PRIV_SETDUMPER);
1333 if (error != 0)
1334 return (error);
1335
1336 /*
1337 * Try to find a matching configuration, and kill it.
1338 *
1339 * NULL 'kda' indicates remove any configuration matching 'devname',
1340 * which may remove multiple configurations in atypical configurations.
1341 */
1342 found = false;
1343 mtx_lock(&dumpconf_list_lk);
1344 TAILQ_FOREACH_SAFE(di, &dumper_configs, di_next, sdi) {
1345 if (dumper_config_match(di, devname, kda)) {
1346 found = true;
1347 TAILQ_REMOVE(&dumper_configs, di, di_next);
1348 free_single_dumper(di);
1349 }
1350 }
1351 mtx_unlock(&dumpconf_list_lk);
1352
1353 /* Only produce ENOENT if a more targeted match didn't match. */
1354 if (!found && kda->kda_index == KDA_REMOVE)
1355 return (ENOENT);
1356 return (0);
1357}
1358
1359static int
1360dump_check_bounds(struct dumperinfo *di, off_t offset, size_t length)

Callers 2

netdump_unconfigureFunction · 0.85
netdump_ioctlFunction · 0.85

Calls 5

dumper_config_matchFunction · 0.85
free_single_dumperFunction · 0.85
priv_checkFunction · 0.70
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected