Lines Matching refs:nb_sb
1566 unsigned long mb_id, uint64_t *nb_sb)
1572 while (*nb_sb) {
1581 while (count < *nb_sb && sb_id > 0 &&
1590 *nb_sb -= count;
1606 uint64_t nb_sb = vm->sbm.sbs_per_mb;
1608 return virtio_mem_sbm_unplug_any_sb_raw(vm, mb_id, &nb_sb);
1644 unsigned long mb_id, uint64_t *nb_sb)
1646 const int count = min_t(int, *nb_sb, vm->sbm.sbs_per_mb);
1682 *nb_sb -= count;
1695 unsigned long mb_id, uint64_t *nb_sb)
1702 if (WARN_ON_ONCE(!*nb_sb))
1705 while (*nb_sb) {
1710 while (count < *nb_sb &&
1718 *nb_sb -= count;
1742 uint64_t nb_sb = diff / vm->sbm.sb_size;
1746 if (!nb_sb)
1754 rc = virtio_mem_sbm_plug_any_sb(vm, mb_id, &nb_sb);
1755 if (rc || !nb_sb)
1772 rc = virtio_mem_sbm_plug_and_add_mb(vm, mb_id, &nb_sb);
1773 if (rc || !nb_sb)
1779 while (nb_sb) {
1786 rc = virtio_mem_sbm_plug_and_add_mb(vm, mb_id, &nb_sb);
1915 uint64_t *nb_sb)
1919 rc = virtio_mem_sbm_unplug_any_sb_raw(vm, mb_id, nb_sb);
2001 uint64_t *nb_sb)
2006 if (*nb_sb >= vm->sbm.sbs_per_mb &&
2011 *nb_sb -= vm->sbm.sbs_per_mb;
2018 for (sb_id = vm->sbm.sbs_per_mb - 1; sb_id >= 0 && *nb_sb; sb_id--) {
2031 *nb_sb -= 1;
2056 uint64_t *nb_sb)
2065 return virtio_mem_sbm_unplug_any_sb_online(vm, mb_id, nb_sb);
2068 return virtio_mem_sbm_unplug_any_sb_offline(vm, mb_id, nb_sb);
2083 uint64_t nb_sb = diff / vm->sbm.sb_size;
2087 if (!nb_sb)
2106 rc = virtio_mem_sbm_unplug_any_sb(vm, mb_id, &nb_sb);
2107 if (rc || !nb_sb)
2120 return nb_sb ? -EBUSY : 0;