Home | History | Annotate | Download | only in block

Lines Matching refs:directory

3  * QEMU Block driver for virtual VFAT (shadows a local directory)
286 /* as s->directory is growable, no pointer may be used here */
293 * - the next cluster of the directory for a directory, and
326 array_t fat,directory,mapping;
436 entry=array_get_next(&(s->directory));
447 entry=array_get(&(s->directory),s->directory.next-1-(i/26));
450 return array_get(&(s->directory),s->directory.next-number_of_entries);
609 int i,j,long_index=s->directory.next;
614 entry=array_get_next(&(s->directory));
629 entry=array_get_next(&(s->directory));
649 direntry_t* entry1=array_get(&(s->directory),directory_start);
681 entry_long=array_get(&(s->directory),long_index);
692 * Read a directory. (the index of the corresponding mapping must be passed).
717 first_cluster == 0 ? 0 : s->directory.next;
719 /* actually read the directory, and allocate the mappings */
739 /* create directory entry for this file */
772 s->current_mapping->dir_index=s->directory.next-1;
790 while(s->directory.next%(0x10*s->sectors_per_cluster)) {
791 direntry_t* direntry=array_get_next(&(s->directory));
797 if (mapping_index == 0 && s->directory.next < ROOT_ENTRIES) {
798 /* root directory */
799 int cur = s->directory.next;
800 array_ensure_allocated(&(s->directory), ROOT_ENTRIES - 1);
801 memset(array_get(&(s->directory), cur), 0,
807 first_cluster += (s->directory.next - mapping->info.dir.first_dir_index)
811 direntry = (direntry_t*)array_get(&(s->directory), mapping->dir_index);
837 return (direntry_t*)(s->directory.pointer+sizeof(direntry_t)*mapping->dir_index);
865 array_init(&(s->directory),sizeof(direntry_t));
869 direntry_t* entry=array_get_next(&(s->directory));
875 /* Now build FAT, and write back information into directory */
895 /* MS-DOS expects the FAT to be 0 for the root directory
904 fprintf(stderr, "Could not read directory %s\n",
914 direntry_t* direntry = array_get(&(s->directory),
931 fprintf(stderr,"Directory does not fit in FAT%d (capacity %s)\n",
1195 s->cluster = (unsigned char*)s->directory.pointer+offset
1197 assert(((s->cluster-(unsigned char*)s->directory.pointer)%s->cluster_size)==0);
1198 assert((char*)s->cluster+s->cluster_size <= s->directory.pointer+s->directory.next*s->directory.item_size);
1567 * part of a file, it has bit 2 set, in case of a directory, bit 1. If it
1569 * If any cluster is allocated, but not part of a file or directory, this
1618 /* the root directory */
1731 * used by the directory, its subdirectories and their files.
1762 /* new directory */
1825 DLOG(fprintf(stderr, "invalid begin for directory: %s\n", path2); print_direntry(direntries + i));
1831 DLOG(fprintf(stderr, "problem in directory %s:\n", path2); print_direntry(direntries + i));
1870 * - count the number of clusters occupied by this directory and
1893 /* mark every mapped file/directory as deleted.
1904 DLOG(fprintf(stderr, "problem in directory\n"));
2030 * make room in s->directory,
2033 direntry_t* result = array_insert(&(s->directory), dir_index, count);
2042 int ret = array_remove_slice(&(s->directory), dir_index, count);
2059 direntry_t* direntry = array_get(&(s->directory), dir_index);
2135 direntry_t* direntry = array_get(&(s->directory), dir_index);
2151 assert(mapping->info.dir.first_dir_index < s->directory.next);
2181 void* direntry = array_get(&(s->directory), current_dir_index);
2186 assert(!strncmp(s->directory.pointer, "QEMU", 4));
2196 direntry = array_get(&(s->directory), first_dir_index + i);
2215 direntry_t* direntry = array_get(&(s->directory), dir_index);
2286 assert(mapping->dir_index < s->directory.next);
2287 direntry_t* direntry = array_get(&(s->directory), mapping->dir_index);
2290 assert(mapping->info.dir.first_dir_index + 0x10 * s->sectors_per_cluster * (mapping->end - mapping->begin) <= s->directory.next);
2302 for (i = 0; i < s->directory.next; i++) {
2303 direntry_t* direntry = array_get(&(s->directory), i);
2372 direntry_t* direntry = array_get(&(s->directory),
2425 j = s->directory.next;
2427 insert_direntries(s, s->directory.next,
2471 direntry_t* entry = array_get(&(s->directory),
2494 for (i = 0; i < s->directory.next; i++) {
2495 entry = array_get(&(s->directory), i);
2500 if (i >= s->directory.next) {
2547 direntry_t* entry = array_get(&(s->directory),
2551 /* remove file/directory */
2553 int j, next_dir_index = s->directory.next,
2716 array_get(&(s->directory), dir_index + k),
2825 array_free(&(s->directory));
2856 if (((direntry_t*)vvv->directory.pointer)[1].attributes != 0xf)
2861 assert(vvv->directory.size >= vvv->directory.item_size * vvv->directory.next);
2865 directory.next);
2866 direntry = array_get(&(vvv->directory), mapping->dir_index);