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

Function fdset_shrink_nolock

dpdk/lib/vhost/fd_man.c:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static void
37fdset_shrink_nolock(struct fdset *pfdset)
38{
39 int i;
40 int last_valid_idx = get_last_valid_idx(pfdset, pfdset->num - 1);
41
42 for (i = 0; i < last_valid_idx; i++) {
43 if (pfdset->fd[i].fd != -1)
44 continue;
45
46 fdset_move(pfdset, i, last_valid_idx);
47 last_valid_idx = get_last_valid_idx(pfdset, last_valid_idx - 1);
48 }
49 pfdset->num = last_valid_idx + 1;
50}
51
52/*
53 * Find deleted fd entries and remove them

Callers 2

fdset_shrinkFunction · 0.85
fdset_addFunction · 0.85

Calls 2

get_last_valid_idxFunction · 0.85
fdset_moveFunction · 0.85

Tested by

no test coverage detected