Reorganize remove-inacitve command

Don't remove inactive core if it has dirt cache lines assigned unless `force`
flag is specified.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2021-04-12 13:46:57 +02:00
parent 8a8572d8bb
commit 4e680bb50a
6 changed files with 24 additions and 24 deletions

View File

@@ -1937,7 +1937,8 @@ int remove_core(unsigned int cache_id, unsigned int core_id,
return SUCCESS;
}
int remove_inactive_core(unsigned int cache_id, unsigned int core_id)
int remove_inactive_core(unsigned int cache_id, unsigned int core_id,
bool force)
{
int fd = 0;
struct kcas_remove_inactive cmd;
@@ -1954,6 +1955,7 @@ int remove_inactive_core(unsigned int cache_id, unsigned int core_id)
memset(&cmd, 0, sizeof(cmd));
cmd.cache_id = cache_id;
cmd.core_id = core_id;
cmd.force = force;
if (run_ioctl(fd, KCAS_IOCTL_REMOVE_INACTIVE, &cmd) < 0) {
close(fd);