Lines Matching defs:sector
65 unsigned long long sector;
78 /* Convert the file position into a sector number an offset. */
80 sector = offset / bch->sectsize;
81 sectoffset = offset - sector * bch->sectsize;
83 if (sector >= bch->nsectors)
90 /* Read the initial partial sector */
95 /* Read the sector into the sector buffer */
97 ret = bchlib_readsector(bch, sector + bch->sectstart);
103 /* Copy the tail end of the sector to the user buffer */
123 ++sector;
125 if (sector >= bch->nsectors)
135 /* Then read all of the full sectors following the partial sector directly
142 if (sector + nsectors > bch->nsectors)
144 nsectors = bch->nsectors - sector;
147 ret = los_disk_read(bch->disk->disk_id, (void *)buffer, sector + bch->sectstart, nsectors, TRUE);
157 sector += nsectors;
161 if (sector >= bch->nsectors)
170 /* Then read any partial final sector */
174 /* Read the sector into the sector buffer */
176 ret = bchlib_readsector(bch, sector + bch->sectstart);
182 /* Copy the head end of the sector to the user buffer */