Lines Matching defs:sectors
254 // We must ensure that we don't write to any sectors which are marked as
326 * Returns the sectors' offset in the image file on success and < 0 on error
378 int64_t sectors, sectors_per_block;
384 sectors = sectors_per_block - (sector_num % sectors_per_block);
385 if (sectors > nb_sectors) {
386 sectors = nb_sectors;
390 memset(buf, 0, sectors * BDRV_SECTOR_SIZE);
393 sectors * BDRV_SECTOR_SIZE);
394 if (ret != sectors * BDRV_SECTOR_SIZE) {
399 nb_sectors -= sectors;
400 sector_num += sectors;
401 buf += sectors * BDRV_SECTOR_SIZE;
411 int64_t sectors, sectors_per_block;
418 sectors = sectors_per_block - (sector_num % sectors_per_block);
419 if (sectors > nb_sectors) {
420 sectors = nb_sectors;
429 ret = bdrv_pwrite(bs->file, offset, buf, sectors * BDRV_SECTOR_SIZE);
430 if (ret != sectors * BDRV_SECTOR_SIZE) {
434 nb_sectors -= sectors;
435 sector_num += sectors;
436 buf += sectors * BDRV_SECTOR_SIZE;
444 * Calculates the number of cylinders, heads and sectors per cylinder
445 * based on a given number of sectors. This is the algorithm described
518 sectors requested until we get enough (or fail). */