• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/msdosfs-209.1.1/userfs_plugin/

Lines Matching defs:device

27     userfs_device_t device;
74 const char * (*device_name)(userfs_device_t device);
75 int (*device_fd)(userfs_device_t device);
76 int (*cache_get_buffer)(userfs_device_t device, uint64_t offset, size_t length, userfs_buffer_t *buffer);
77 void (*cache_release_buffer)(userfs_device_t device, userfs_buffer_t buffer); // TODO: Should this take a "dirty" flag?
78 int (*cache_flush_buffer)(userfs_device_t device, userfs_buffer_t buffer);
79 int (*cache_flush)(userfs_device_t device);
80 int (*cache_invalidate)(userfs_device_t device);
84 int (*buffer_resize)(userfs_buffer_t buffer, size_t new_size); // Need device to read/write?
93 // Maximum device block size that we support
122 static errno_t msdosfs_volume_open(userfs_device_t device, bool locked, userfs_volume_t *volume);
236 * Run fsck_msdos to repair the device using the open file descriptor "fd".
447 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid cluster number (%u) in contiguous_clusters_in_chain\n", device_name(v->device), cluster);
464 err = cache_get_buffer(v->device, v->fatOffset+blockOffset, blockSize, &buffer);
467 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: unable to get FAT buffer for cluster=%lu (error %d)\n", device_name(v->device), (unsigned long)cluster, err);
486 cache_release_buffer(v->device, buffer);
490 err = cache_get_buffer(v->device, v->fatOffset+blockOffset, blockSize, &buffer);
493 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: unable to get FAT buffer for cluster=%lu (error %d)\n", device_name(v->device), (unsigned long)cluster, err);
504 cache_release_buffer(v->device, buffer);
520 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Error %d reading cluster chain at %u\n", device_name(v->device), err, cluster);
526 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Cluster chain has a cycle.\n", device_name(v->device));
533 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: A cluster chain has an invalid cluster number (%u)\n", device_name(v->device), cluster);
569 cache_release_buffer(volume->device, buffer);
578 error = cache_get_buffer(volume->device, volume->fatOffset+blockOffset, blockSize, &buffer);
581 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: unable to get FAT buffer for cluster=%lu (error %d)\n", device_name(volume->device), (unsigned long)cluster, error);
601 cache_release_buffer(volume->device, buffer);
609 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: A cluster chain has an invalid cluster number (%u)\n", device_name(volume->device), cluster);
624 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: Free cluster count would exceed cluster count; ignoring.\n", device_name(volume->device));
631 errno_t error = cache_get_buffer(volume->device, volume->fsInfoSector*volume->bytesPerSector, volume->bytesPerSector, &fsInfoBuffer);
634 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Error %d reading FSInfo sector; ignoring.\n", device_name(volume->device), error);
643 cache_release_buffer(volume->device, fsInfoBuffer);
658 int fd = device_fd(volume->device);
1139 cache_release_buffer(dir->volume->device, dirBlock);
1149 cache_release_buffer(dir->volume->device, dirBlock);
1456 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Invalid extent (start=%u, count=%u, max=%u)\n", device_name(stream->volume->device), stream->cachedPhysicalCluster, stream->cachedClusterCount, stream->volume->maxCluster);
1490 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Cluster chain is too short\n", device_name(stream->volume->device));
1494 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Invalid cluster number in chain (%u)\n", device_name(stream->volume->device), stream->cachedNextCluster);
1518 return cache_get_buffer(volume->device, physical_offset, length, buffer);
1555 return cache_get_buffer(volume->device, physical_offset, physical_length, buffer);
1559 static errno_t msdosfs_volume_open(userfs_device_t device, bool locked, userfs_volume_t *volume)
1572 v->device = device;
1575 /* Sanity check the device's logical block size. */
1576 if (ioctl(device_fd(device), DKIOCGETBLOCKSIZE, &bytesPerSector) < 0)
1579 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: ioctl(DKIOCGETBLOCKSIZE) failed, %s\n", device_name(device), strerror(err));
1585 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: block size is too big (%lu)\n", device_name(device), (unsigned long) bytesPerSector);
1593 err = cache_get_buffer(device, 0, bytesPerSector, &bootSector);
1611 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid jump signature (0x%02X)\n", device_name(device), boot->bs50.bsJump[0]);
1620 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid boot signature (0x%02X 0x%02X)\n", device_name(device), boot->bs50.bsBootSectSig0, boot->bs50.bsBootSectSig1);
1638 * - logical sector size: == device's current sector size
1646 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: logical sector size (%u) != physical sector size (%u)\n", device_name(device), v->bytesPerSector, bytesPerSector);
1652 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid sectors per cluster (%u)\n", device_name(device), sectorsPerCluster);
1658 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid total sectors (%u)\n", device_name(device), totalSectors);
1664 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid sectors per FAT (%u)\n", device_name(device), fatSectors);
1683 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: invalid configuration; no room for clusters\n", device_name(device));
1689 * is (number of clusters) + 1. Convert the pm_firstcluster to device blocks.
1720 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: number of clusters (0x%x) is too large\n", device_name(device), v->maxCluster + 1);
1751 err = cache_get_buffer(v->device, v->fatOffset, blockSize, &fatBuffer);
1754 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: Unable to read FAT[1] (error %d)\n", device_name(device), err);
1764 cache_release_buffer(v->device, fatBuffer);
1772 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: Volume is %s dirty and locked. Will use read-only.\n", device_name(device), v->fatMask == FAT12_MASK ? "assumed" : "marked");
1776 asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s: Volume is %s dirty. Attempting to repair.\n", device_name(device), v->fatMask == FAT12_MASK ? "assumed" : "marked");
1778 cache_release_buffer(device, bootSector);
1780 cache_invalidate(device);
1782 int repair_result = fsck_msdos(device_fd(device), device_name(device));
1785 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: Could not be repaired (status %d). Will use read-only.\n", device_name(device), repair_result);
1790 asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s: Volume repaired.\n", device_name(device));
1810 device_name(device), v->rootCluster, CLUST_FIRST, v->maxCluster);
1816 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: FAT32 has non-zero root directory entry count\n", device_name(device));
1822 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: FAT32 has non-zero version\n", device_name(device));
1828 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: FAT32 has 16-bit total sectors\n", device_name(device));
1834 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: FAT32 has 16-bit FAT sectors\n", device_name(device));
1843 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: FAT12/16 has zero-length root directory\n", device_name(device));
1848 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: FAT12/16 total sectors (%u) fit in 16 bits, but stored in 32 bits\n", device_name(device), totalSectors);
1852 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: FAT12/16 has 32-bit FAT sectors\n", device_name(device));
1873 device_name(device), v->maxCluster + 1, clusters);
1878 * Pin the maximum cluster number based on the number of sectors the device
1883 err = ioctl(device_fd(device), DKIOCGETBLOCKCOUNT, &blockCount);
1889 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: device sector count (%llu) too small; no room for clusters\n", device_name(device), blockCount);
1896 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: device sector count (%llu) is less than volume sector count (%u); limiting maximum cluster to %u (was %u)\n",
1897 device_name(device), blockCount, totalSectors, maxcluster, v->maxCluster);
1902 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "msdosfs_mount: device sector count (%llu) is less than volume sector count (%u)\n",
1937 err = cache_get_buffer(device, v->fsInfoSector*v->bytesPerSector, v->bytesPerSector, &fsInfoBuffer);
1940 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: Error %d trying to read FSInfo sector; ignoring.\n", device_name(device), err);
1962 asl_log(NULL, NULL, ASL_LEVEL_WARNING, "%s: FSInfo sector has invalid signature(s); ignoring.\n", device_name(device));
1967 cache_release_buffer(device, fsInfoBuffer);
1976 cache_release_buffer(device, bootSector);
1983 cache_release_buffer(device, bootSector);
2029 error = cache_get_buffer(volume->device, volume->fatOffset, blockSize, &buffer);
2032 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: msdosfs_volume_mark_dirty: unable to get FAT buffer for cluster=1 (error %d)\n", device_name(volume->device), error);
2048 error = cache_flush_buffer(volume->device, buffer);
2049 cache_release_buffer(volume->device, buffer);
2053 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: msdosfs_volume_mark_dirty: error %d writing FAT\n", device_name(volume->device), error);
2056 if (fsync(device_fd(volume->device)))
2059 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: msdosfs_volume_mark_dirty: error %d from fsync\n", device_name(volume->device), error);
2062 if (ioctl(device_fd(volume->device), DKIOCSYNCHRONIZECACHE) == -1)
2065 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: msdosfs_volume_mark_dirty: error %d from DKIOCSYNCHRONIZECACHE\n", device_name(volume->device), error);
2079 err = cache_flush(volume->device);
2294 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: %s: Attempt to read offset beyond EOF (offset=%llu, EOF=%llu)\n", device_name(stream->volume->device), stream->name, offset, stream->length);
2299 asl_log(NULL, NULL, ASL_LEVEL_ERR, "%s: %s: Attempt to read beyond EOF (offset=%llu, length=%lu, EOF=%llu)\n", device_name(stream->volume->device), stream->name, offset, (unsigned long)length, stream->length);