Lines Matching refs:nb_sb
990 unsigned long mb_id, uint64_t *nb_sb)
996 while (*nb_sb) {
1005 while (count < *nb_sb && sb_id > 0 &&
1014 *nb_sb -= count;
1030 uint64_t nb_sb = vm->nb_sb_per_mb;
1032 return virtio_mem_mb_unplug_any_sb(vm, mb_id, &nb_sb);
1081 uint64_t *nb_sb)
1083 const int count = min_t(int, *nb_sb, vm->nb_sb_per_mb);
1127 *nb_sb -= count;
1140 uint64_t *nb_sb, bool online)
1146 if (WARN_ON_ONCE(!*nb_sb))
1149 while (*nb_sb) {
1154 while (count < *nb_sb &&
1163 *nb_sb -= count;
1191 uint64_t nb_sb = diff / vm->subblock_size;
1195 if (!nb_sb)
1204 rc = virtio_mem_mb_plug_any_sb(vm, mb_id, &nb_sb, true);
1205 if (rc || !nb_sb)
1213 rc = virtio_mem_mb_plug_any_sb(vm, mb_id, &nb_sb, false);
1214 if (rc || !nb_sb)
1230 rc = virtio_mem_mb_plug_and_add(vm, mb_id, &nb_sb);
1231 if (rc || !nb_sb)
1237 while (nb_sb) {
1244 rc = virtio_mem_mb_plug_and_add(vm, mb_id, &nb_sb);
1267 uint64_t *nb_sb)
1271 rc = virtio_mem_mb_unplug_any_sb(vm, mb_id, nb_sb);
1350 uint64_t *nb_sb)
1355 if (*nb_sb >= vm->nb_sb_per_mb &&
1360 *nb_sb -= vm->nb_sb_per_mb;
1367 for (sb_id = vm->nb_sb_per_mb - 1; sb_id >= 0 && *nb_sb; sb_id--) {
1380 *nb_sb -= 1;
1406 uint64_t nb_sb = diff / vm->subblock_size;
1410 if (!nb_sb)
1424 &nb_sb);
1425 if (rc || !nb_sb)
1434 &nb_sb);
1435 if (rc || !nb_sb)
1449 &nb_sb);
1450 if (rc || !nb_sb)
1461 &nb_sb);
1462 if (rc || !nb_sb)
1470 return nb_sb ? -EBUSY : 0;