Lines Matching refs:blockstart
862 static int flash_bad_block(int fd, uint8_t mtd_type, loff_t blockstart) in flash_bad_block() argument
865 int badblock = ioctl(fd, MEMGETBADBLOCK, &blockstart); in flash_bad_block()
875 (unsigned long long)blockstart); in flash_bad_block()
898 loff_t blockstart; /* running start of the current block - in flash_read_buf() local
902 blockstart = (offset / DEVESIZE(dev)) * DEVESIZE(dev); in flash_read_buf()
905 block_seek = offset - blockstart; in flash_read_buf()
923 rc = flash_bad_block(fd, DEVTYPE(dev), blockstart); in flash_read_buf()
927 if (blockstart + block_seek + readlen > environment_end(dev)) { in flash_read_buf()
934 blockstart += blocklen; in flash_read_buf()
942 lseek(fd, blockstart + block_seek, SEEK_SET); in flash_read_buf()
952 rc, (unsigned long long)blockstart + block_seek, in flash_read_buf()
958 blockstart += blocklen; in flash_read_buf()
986 loff_t blockstart; /* running start of the current block - in flash_write_buf() local
996 blockstart = DEVOFFSET(dev); in flash_write_buf()
1007 blockstart = erase_offset; in flash_write_buf()
1076 rc = flash_bad_block(fd, DEVTYPE(dev), blockstart); in flash_write_buf()
1080 if (blockstart + erasesize > environment_end(dev)) { in flash_write_buf()
1086 blockstart += blocklen; in flash_write_buf()
1091 erase.start = blockstart; in flash_write_buf()
1103 if (lseek(fd, blockstart, SEEK_SET) == -1) { in flash_write_buf()
1112 (unsigned long long)blockstart); in flash_write_buf()
1125 blockstart += erasesize; in flash_write_buf()