Lines Matching refs:sect
1340 DWORD sect; in change_bitmap() local
1344 sect = fs->bitbase + clst / 8 / SS(fs); /* Sector address */ in change_bitmap()
1348 if (move_window(fs, sect++) != FR_OK) return FR_DISK_ERR; in change_bitmap()
1649 DWORD sect; in dir_clear() local
1655 sect = clst2sect(fs, clst); /* Top of the cluster */ in dir_clear()
1656 fs->winsect = sect; /* Set window to top of the cluster */ in dir_clear()
1664 …for (n = 0; n < fs->csize && disk_write(fs->pdrv, ibuf, sect + n, szb) == RES_OK; n += szb) ; /* F… in dir_clear()
1670 …for (n = 0; n < fs->csize && disk_write(fs->pdrv, ibuf, sect + n, szb) == RES_OK; n += szb) ; /* F… in dir_clear()
1704 dp->sect = fs->dirbase; in dir_sdi()
1714 dp->sect = clst2sect(fs, clst); in dir_sdi()
1717 if (dp->sect == 0) return FR_INT_ERR; in dir_sdi()
1718 dp->sect += ofs / SS(fs); /* Sector# of the directory entry */ in dir_sdi()
1741 …if (ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) dp->sect = 0;… in dir_next()
1742 if (dp->sect == 0) return FR_NO_FILE; /* Report EOT if it has been disabled */ in dir_next()
1745 dp->sect++; /* Next sector */ in dir_next()
1749 dp->sect = 0; return FR_NO_FILE; in dir_next()
1760 dp->sect = 0; return FR_NO_FILE; in dir_next()
1769 if (!stretch) dp->sect = 0; /* (this line is to suppress compiler warning) */ in dir_next()
1770 dp->sect = 0; return FR_NO_FILE; /* Report EOT */ in dir_next()
1774 dp->sect = clst2sect(fs, clst); in dir_next()
1806 res = move_window(fs, dp->sect);
2168 res = move_window(dp->obj.fs, dp->sect);
2179 res = move_window(dp->obj.fs, dp->sect);
2191 res = move_window(dp->obj.fs, dp->sect);
2271 res = move_window(dp->obj.fs, dp->sect);
2346 while (dp->sect) {
2347 res = move_window(fs, dp->sect);
2400 if (res != FR_OK) dp->sect = 0; /* Terminate the read operation on error or EOT */
2450 res = move_window(fs, dp->sect);
2560 res = move_window(fs, dp->sect);
2576 res = move_window(fs, dp->sect);
2611 res = move_window(fs, dp->sect);
2626 res = move_window(fs, dp->sect);
2661 if (dp->sect == 0) return; /* Exit if read pointer has reached end of directory */
3189 DWORD sect /* Sector# (lba) to load and check if it is an FAT-VBR or not */ argument
3193 if (move_window(fs, sect) != FR_OK) return 4; /* Load boot record */
3692 fp->sect = 0; /* Invalidate current data sector */
3712 fp->sect = sc + (DWORD)(ofs / SS(fs));
3714 if (disk_read(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) res = FR_DISK_ERR;
3746 DWORD clst, sect; local
3780 sect = clst2sect(fs, fp->clust); /* Get current sector */
3781 if (sect == 0) ABORT(fs, FR_INT_ERR);
3782 sect += csect;
3788 if (disk_read(fs->pdrv, rbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
3791 if (fs->wflag && fs->winsect - sect < cc) {
3792 mem_cpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs));
3795 if ((fp->flag & FA_DIRTY) && fp->sect - sect < cc) {
3796 mem_cpy(rbuff + ((fp->sect - sect) * SS(fs)), fp->buf, SS(fs));
3804 if (fp->sect != sect) { /* Load data sector if not in cache */
3807 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
3811 …if (disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Fill sector cache …
3814 fp->sect = sect;
3819 if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
3846 DWORD clst, sect; local
3888 …if (fs->winsect == fp->sect && sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Write-back sec…
3891 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
3895 sect = clst2sect(fs, fp->clust); /* Get current sector */
3896 if (sect == 0) ABORT(fs, FR_INT_ERR);
3897 sect += csect;
3903 if (disk_write(fs->pdrv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
3906 …if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
3907 mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs));
3911 if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
3912 mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs));
3923 fs->winsect = sect;
3926 if (fp->sect != sect && /* Fill sector cache with file data */
3928 disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) {
3932 fp->sect = sect;
3937 if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
3973 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR);
4189 res = move_window(fs, dj.sect);
4311 if (fp->fptr % SS(fs) && dsc != fp->sect) { /* Refill sector cache if needed */
4315 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
4321 fp->sect = dsc;
4391 if (fp->fptr % SS(fs) && nsect != fp->sect) { /* Fill sector cache if needed */
4395 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
4401 fp->sect = nsect;
4642 DWORD nfree, clst, sect, stat; local
4672 sect = fs->bitbase; /* Bitmap sector */
4676 res = move_window(fs, sect++);
4689 sect = fs->fatbase; /* Top of the FAT */
4693 res = move_window(fs, sect++);
4753 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) {
5469 DWORD clst, sect; local
5495 sect = clst2sect(fs, fp->clust); /* Get current data sector */
5496 if (sect == 0) ABORT(fs, FR_INT_ERR);
5497 sect += csect;
5499 …if (move_window(fs, sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window to the file data…
5502 if (fp->sect != sect) { /* Fill sector cache with file data */
5505 if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
5509 if (disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
5513 fp->sect = sect;
5545 DWORD szb_buf, sz_buf, sz_blk, n_clst, pau, sect, nsect, n; local
5658 sect = b_data + au * tbl[0]; /* Table start sector */
5688 if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5689 sect += n; i = 0;
5696 sect = b_data; nsect = (szb_bit + ss - 1) / ss; /* Start of bitmap and number of sectors */
5703 if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5704 sect += n; nsect -= n;
5708 sect = b_fat; nsect = sz_fat; /* Start of FAT and number of FAT sectors */
5724 if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5725 sect += n; nsect -= n;
5738 …sect = b_data + au * (tbl[0] + tbl[1]); nsect = au; /* Start of the root directory and number of s…
5741 if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5743 sect += n; nsect -= n;
5747 sect = b_vol;
5770 if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5776 if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5782 if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5786 if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5918 sect = b_fat; /* FAT start sector */
5930 if (disk_write(pdrv, buf, sect, (UINT)n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5932 sect += n; nsect -= n;
5940 if (disk_write(pdrv, buf, sect, (UINT)n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
5941 sect += n; nsect -= n;