Changes in / [89128f3:b25199bc] in mainline
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.grub
r89128f3 rb25199bc 89 89 echo " $(MULTIBOOT_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \ 90 90 else \ 91 echo " $(MODULE_CMD) /boot/$$module /boot/$$module" >> $(BOOT_CONFIG) ; \91 echo " $(MODULE_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \ 92 92 fi \ 93 93 done -
kernel/arch/amd64/src/boot/multiboot2.S
r89128f3 rb25199bc 55 55 .long MULTIBOOT2_TAG_MODULE 56 56 .long MULTIBOOT2_TAG_MEMMAP 57 #ifdef CONFIG_FB58 57 .long MULTIBOOT2_TAG_FBINFO 59 #endif60 58 tag_info_req_end: 61 59 … … 87 85 tag_flags_end: 88 86 89 #ifdef CONFIG_FB90 87 /* Framebuffer tag */ 91 88 tag_framebuffer_start: … … 97 94 .long CONFIG_BFB_BPP 98 95 tag_framebuffer_end: 99 #endif100 96 101 97 /* Module alignment tag */ -
kernel/arch/ia32/src/boot/multiboot2.S
r89128f3 rb25199bc 53 53 .long MULTIBOOT2_TAG_MODULE 54 54 .long MULTIBOOT2_TAG_MEMMAP 55 #ifdef CONFIG_FB56 55 .long MULTIBOOT2_TAG_FBINFO 57 #endif58 56 tag_info_req_end: 59 57 … … 85 83 tag_flags_end: 86 84 87 #ifdef CONFIG_FB88 85 /* Framebuffer tag */ 89 86 tag_framebuffer_start: … … 95 92 .long CONFIG_BFB_BPP 96 93 tag_framebuffer_end: 97 #endif98 94 99 95 /* Module alignment tag */ -
kernel/genarch/src/drivers/i8042/i8042.c
r89128f3 rb25199bc 44 44 #include <mm/slab.h> 45 45 #include <ddi/device.h> 46 #include <time/delay.h>47 46 48 47 #define i8042_SET_COMMAND 0x60 … … 52 51 #define i8042_BUFFER_FULL_MASK 0x01 53 52 #define i8042_WAIT_MASK 0x02 54 55 #define i8042_TIMEOUT 6553656 53 57 54 static irq_ownership_t i8042_claim(irq_t *irq) … … 80 77 static void i8042_clear_buffer(i8042_t *dev) 81 78 { 82 for (uint32_t i = 0; i < i8042_TIMEOUT; i++) { 83 if ((pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) == 0) 84 break; 85 79 while (pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) 86 80 (void) pio_read_8(&dev->data); 87 delay(50); /* 50 us think time */88 }89 }90 91 static void i8042_send_command(i8042_t *dev, uint8_t cmd)92 {93 for (uint32_t i = 0; i < i8042_TIMEOUT; i++) {94 if ((pio_read_8(&dev->status) & i8042_WAIT_MASK) == 0)95 break;96 97 delay(50); /* 50 us think time */98 }99 100 pio_write_8(&dev->status, cmd);101 delay(10000); /* 10 ms think time */102 81 } 103 82 … … 105 84 i8042_instance_t *i8042_init(i8042_t *dev, inr_t inr) 106 85 { 107 i8042_instance_t *instance =108 malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);86 i8042_instance_t *instance 87 = malloc(sizeof(i8042_instance_t), FRAME_ATOMIC); 109 88 if (instance) { 110 89 instance->i8042 = dev; … … 117 96 instance->irq.handler = i8042_irq_handler; 118 97 instance->irq.instance = instance; 98 119 99 } 120 100 … … 127 107 ASSERT(kbrdin); 128 108 129 i8042_clear_buffer(instance->i8042);130 131 109 instance->kbrdin = kbrdin; 132 110 irq_register(&instance->irq); 111 i8042_clear_buffer(instance->i8042); 133 112 } 134 113 … … 137 116 { 138 117 interrupts_disable(); 118 139 119 i8042_clear_buffer(dev); 140 i8042_send_command(dev, i8042_CPU_RESET); 120 121 /* Reset CPU */ 122 pio_write_8(&dev->status, i8042_CPU_RESET); 141 123 } 142 124 -
kernel/genarch/src/fb/bfb.c
r89128f3 rb25199bc 40 40 #include <console/console.h> 41 41 42 uintptr_t bfb_addr = 0;42 uintptr_t bfb_addr = (uintptr_t) -1; 43 43 uint32_t bfb_width = 0; 44 44 uint32_t bfb_height = 0; … … 57 57 bool bfb_init(void) 58 58 { 59 if ((bfb_addr == 0) || (bfb_width == 0) || (bfb_height == 0) || 60 (bfb_bpp == 0) || (bfb_scanline == 0)) 59 if ((bfb_width == 0) || (bfb_height == 0)) 61 60 return false; 62 61 -
kernel/genarch/src/multiboot/multiboot2.c
r89128f3 rb25199bc 76 76 static void multiboot2_fbinfo(const multiboot2_fbinfo_t *fbinfo) 77 77 { 78 #ifdef CONFIG_FB79 78 if (fbinfo->visual == MULTIBOOT2_VISUAL_RGB) { 80 79 bfb_addr = fbinfo->addr; … … 93 92 bfb_blue_size = fbinfo->rgb.blue_size; 94 93 } 95 #endif96 94 } 97 95 -
kernel/generic/src/main/main.c
r89128f3 rb25199bc 262 262 * Create the first thread. 263 263 */ 264 thread_t *kinit_thread =265 264 thread_t *kinit_thread 265 = thread_create(kinit, NULL, kernel, 0, "kinit", true); 266 266 if (!kinit_thread) 267 267 panic("Cannot create kinit thread."); -
uspace/drv/bus/isa/isa.ma
r89128f3 rb25199bc 1 9 pci/ven=8086&dev=70001 9 pci/ven=8086&dev=7000 -
uspace/drv/bus/usb/ehci/ehci.ma
r89128f3 rb25199bc 1 10 pci/class=0c&subclass=03&progif=20 1 10 pci/ven=1002&dev=4345 2 10 pci/ven=1002&dev=4386 3 10 pci/ven=1002&dev=4396 4 10 pci/ven=1002&dev=4373 5 10 pci/ven=1022&dev=7463 6 10 pci/ven=1022&dev=7808 7 10 pci/ven=102f&dev=01b5 8 10 pci/ven=10cf&dev=1415 9 10 pci/ven=10de&dev=00e8 10 10 pci/ven=10de&dev=055f 11 10 pci/ven=10de&dev=056a 12 10 pci/ven=10de&dev=077c 13 10 pci/ven=10de&dev=077e 14 10 pci/ven=10de&dev=0aa6 15 10 pci/ven=10de&dev=0aa9 16 10 pci/ven=10de&dev=0aaa 17 10 pci/ven=10de&dev=0d9d 18 10 pci/ven=1166&dev=0414 19 10 pci/ven=1166&dev=0416 20 10 pci/ven=1414&dev=5805 21 10 pci/ven=1414&dev=5807 22 10 pci/ven=15ad&dev=0770 23 10 pci/ven=17a0&dev=8084 24 10 pci/ven=8086&dev=24cd 25 10 pci/ven=8086&dev=24dd 26 10 pci/ven=8086&dev=265c 27 10 pci/ven=8086&dev=268c 28 10 pci/ven=8086&dev=27cc 29 10 pci/ven=8086&dev=2836 30 10 pci/ven=8086&dev=283a 31 10 pci/ven=8086&dev=293a 32 10 pci/ven=8086&dev=293c 33 10 pci/ven=8086&dev=3a3a 34 10 pci/ven=8086&dev=3a3c 35 10 pci/ven=8086&dev=3a6a 36 10 pci/ven=8086&dev=3a6c 37 10 pci/ven=8086&dev=8117 38 10 pci/ven=8086&dev=8807 39 10 pci/ven=8086&dev=880f -
uspace/drv/bus/usb/ohci/ohci.ma
r89128f3 rb25199bc 1 10 pci/class=0c&subclass=03&progif=10 1 10 pci/ven=106b&dev=0026 2 10 pci/ven=106b&dev=003f 3 10 pci/ven=10de&dev=0aa5 4 5 10 pci/ven=1002&dev=4374 6 10 pci/ven=1002&dev=4375 7 8 10 pci/ven=1002&dev=4387 9 10 pci/ven=1002&dev=4388 10 10 pci/ven=1002&dev=4389 11 10 pci/ven=1002&dev=438a 12 10 pci/ven=1002&dev=438b 13 10 pci/ven=1002&dev=4397 14 10 pci/ven=1002&dev=4398 15 10 pci/ven=1002&dev=4399 -
uspace/drv/bus/usb/uhci/uhci.ma
r89128f3 rb25199bc 1 10 pci/class=0c&subclass=03&progif=00 1 10 pci/ven=8086&dev=7020 2 10 pci/ven=8086&dev=7112 3 4 10 pci/ven=8086&dev=27c8 5 10 pci/ven=8086&dev=27c9 6 10 pci/ven=8086&dev=27ca 7 10 pci/ven=8086&dev=27cb 8 9 10 pci/ven=8086&dev=2830 10 10 pci/ven=8086&dev=2831 11 10 pci/ven=8086&dev=2832 12 10 pci/ven=8086&dev=2834 13 10 pci/ven=8086&dev=2835 14 15 10 pci/ven=8086&dev=2934 16 10 pci/ven=8086&dev=2935 17 10 pci/ven=8086&dev=2936 18 10 pci/ven=8086&dev=2937 19 10 pci/ven=8086&dev=2938 20 10 pci/ven=8086&dev=2939 21 22 10 pci/ven=8086&dev=24c2 23 10 pci/ven=8086&dev=24c4 24 10 pci/ven=8086&dev=24c7 25 26 10 pci/ven=8086&dev=2688 27 10 pci/ven=8086&dev=2689 28 10 pci/ven=8086&dev=268a 29 10 pci/ven=8086&dev=268b -
uspace/drv/bus/usb/vhc/vhc.ma
r89128f3 rb25199bc 1 1 10 usb&hc=vhc 2 -
uspace/lib/c/generic/ddi.c
r89128f3 rb25199bc 53 53 } 54 54 55 /** Map apiece of physical memory to task.55 /** Map piece of physical memory to task. 56 56 * 57 57 * Caller of this function must have the CAP_MEM_MANAGER capability. 58 58 * 59 * @param pf 60 * @param vp 61 * @param pages 62 * @param flags 59 * @param pf Physical address of the starting frame. 60 * @param vp Virtual address of the starting page. 61 * @param pages Number of pages to map. 62 * @param flags Flags for the new address space area. 63 63 * 64 * @return EOK on success 65 * @return EPERM if the caller lacks the CAP_MEM_MANAGER capability 66 * @return ENOENT if there is no task with specified ID 67 * @return ENOMEM if there was some problem in creating 68 * the address space area. 69 * 64 * @return 0 on success, EPERM if the caller lacks the 65 * CAP_MEM_MANAGER capability, ENOENT if there is no task 66 * with specified ID and ENOMEM if there was some problem 67 * in creating address space area. 70 68 */ 71 int physmem_map(void *pf, void *vp, size_t pages, unsignedint flags)69 int physmem_map(void *pf, void *vp, unsigned long pages, int flags) 72 70 { 73 return __SYSCALL4(SYS_PHYSMEM_MAP, (sysarg_t) pf, (sysarg_t) vp, 74 pages,flags);71 return __SYSCALL4(SYS_PHYSMEM_MAP, (sysarg_t) pf, (sysarg_t) vp, pages, 72 flags); 75 73 } 76 74 -
uspace/lib/c/include/ddi.h
r89128f3 rb25199bc 41 41 42 42 extern int device_assign_devno(void); 43 extern int physmem_map(void *, void *, size_t, unsignedint);43 extern int physmem_map(void *, void *, unsigned long, int); 44 44 extern int iospace_enable(task_id_t, void *, unsigned long); 45 45 extern int pio_enable(void *, size_t, void **); -
uspace/lib/minix/minix.h
r89128f3 rb25199bc 39 39 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 40 40 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 41 #define S_IFDIR 0040000 /* Directory*/42 #define S_IFREG 0100000 /* Regular file*/41 #define S_IFDIR 0040000 /*Directory*/ 42 #define S_IFREG 0100000 /*Regular file*/ 43 43 #define S_IFMT 00170000 44 44 45 /* The following block sizes are valid only on V3 filesystem*/45 /*The following block sizes are valid only on V3 filesystem*/ 46 46 #define MFS_MIN_BLOCKSIZE 1024 47 47 #define MFS_MAX_BLOCKSIZE 4096 … … 88 88 #define MFS_ERROR_FS 0x0002 89 89 90 /* MFS V1/V2 superblock data on disk*/90 /*MFS V1/V2 superblock data on disk*/ 91 91 struct mfs_superblock { 92 /* Total number of inodes on the device*/92 /*Total number of inodes on the device*/ 93 93 uint16_t s_ninodes; 94 /* Total number of zones on the device*/94 /*Total number of zones on the device*/ 95 95 uint16_t s_nzones; 96 /* Number of inode bitmap blocks*/96 /*Number of inode bitmap blocks*/ 97 97 uint16_t s_ibmap_blocks; 98 /* Number of zone bitmap blocks*/98 /*Number of zone bitmap blocks*/ 99 99 uint16_t s_zbmap_blocks; 100 /* First data zone on device*/100 /*First data zone on device*/ 101 101 uint16_t s_first_data_zone; 102 /* Base 2 logarithm of the zone to block ratio*/102 /*Base 2 logarithm of the zone to block ratio*/ 103 103 uint16_t s_log2_zone_size; 104 /* Maximum file size expressed in bytes*/104 /*Maximum file size expressed in bytes*/ 105 105 uint32_t s_max_file_size; 106 106 /* … … 109 109 */ 110 110 uint16_t s_magic; 111 /* 111 /*Flag used to detect FS errors*/ 112 112 uint16_t s_state; 113 /* Total number of zones on the device (V2 only)*/113 /*Total number of zones on the device (V2 only)*/ 114 114 uint32_t s_nzones2; 115 115 } __attribute__ ((packed)); 116 116 117 117 118 /* MFS V3 superblock data on disk*/118 /*MFS V3 superblock data on disk*/ 119 119 struct mfs3_superblock { 120 /* Total number of inodes on the device*/120 /*Total number of inodes on the device*/ 121 121 uint32_t s_ninodes; 122 122 uint16_t s_pad0; 123 /* Number of inode bitmap blocks*/123 /*Number of inode bitmap blocks*/ 124 124 int16_t s_ibmap_blocks; 125 /* Number of zone bitmap blocks*/125 /*Number of zone bitmap blocks*/ 126 126 int16_t s_zbmap_blocks; 127 /* First data zone on device*/127 /*First data zone on device*/ 128 128 uint16_t s_first_data_zone; 129 /* Base 2 logarithm of the zone to block ratio*/129 /*Base 2 logarithm of the zone to block ratio*/ 130 130 int16_t s_log2_zone_size; 131 131 int16_t s_pad1; 132 /* Maximum file size expressed in bytes*/132 /*Maximum file size expressed in bytes*/ 133 133 uint32_t s_max_file_size; 134 /* Total number of zones on the device*/134 /*Total number of zones on the device*/ 135 135 uint32_t s_nzones; 136 136 /* … … 140 140 int16_t s_magic; 141 141 int16_t s_pad2; 142 /* Filesystem block size expressed in bytes*/142 /*Filesystem block size expressed in bytes*/ 143 143 uint16_t s_block_size; 144 /* Filesystem disk format version*/144 /*Filesystem disk format version*/ 145 145 int8_t s_disk_version; 146 146 } __attribute__ ((packed)); 147 147 148 /* MinixFS V1 inode structure as it is on disk*/148 /*MinixFS V1 inode structure as it is on disk*/ 149 149 struct mfs_inode { 150 150 uint16_t i_mode; … … 154 154 uint8_t i_gid; 155 155 uint8_t i_nlinks; 156 /* Block numbers for direct zones*/156 /*Block numbers for direct zones*/ 157 157 uint16_t i_dzone[V1_NR_DIRECT_ZONES]; 158 /* Block numbers for indirect zones*/158 /*Block numbers for indirect zones*/ 159 159 uint16_t i_izone[V1_NR_INDIRECT_ZONES]; 160 160 } __attribute__ ((packed)); 161 161 162 /* MinixFS V2 inode structure as it is on disk (also valid for V3).*/162 /*MinixFS V2 inode structure as it is on disk (also valid for V3).*/ 163 163 struct mfs2_inode { 164 164 uint16_t i_mode; … … 170 170 int32_t i_mtime; 171 171 int32_t i_ctime; 172 /* Block numbers for direct zones*/172 /*Block numbers for direct zones*/ 173 173 uint32_t i_dzone[V2_NR_DIRECT_ZONES]; 174 /* Block numbers for indirect zones*/174 /*Block numbers for indirect zones*/ 175 175 uint32_t i_izone[V2_NR_INDIRECT_ZONES]; 176 176 } __attribute__ ((packed)); 177 177 178 /* MinixFS V1/V2 directory entry on-disk structure*/178 /*MinixFS V1/V2 directory entry on-disk structure*/ 179 179 struct mfs_dentry { 180 180 uint16_t d_inum; … … 182 182 }; 183 183 184 /* MinixFS V3 directory entry on-disk structure*/184 /*MinixFS V3 directory entry on-disk structure*/ 185 185 struct mfs3_dentry { 186 186 uint32_t d_inum; -
uspace/srv/bd/rd/rd.c
r89128f3 rb25199bc 55 55 #include <ipc/bd.h> 56 56 #include <macros.h> 57 #include <inttypes.h> 58 59 #define NAME "rd" 57 58 #define NAME "rd" 60 59 61 60 /** Pointer to the ramdisk's image */ … … 209 208 static bool rd_init(void) 210 209 { 211 sysarg_t size; 212 int ret = sysinfo_get_value("rd.size", &size); 213 if ((ret != EOK) || (size == 0)) { 210 int ret = sysinfo_get_value("rd.size", &rd_size); 211 if ((ret != EOK) || (rd_size == 0)) { 214 212 printf("%s: No RAM disk found\n", NAME); 215 213 return false; 216 214 } 217 215 218 sysarg_t addr_phys;219 ret = sysinfo_get_value("rd.address.physical", & addr_phys);220 if ((ret != EOK) || ( addr_phys== 0)) {216 sysarg_t rd_ph_addr; 217 ret = sysinfo_get_value("rd.address.physical", &rd_ph_addr); 218 if ((ret != EOK) || (rd_ph_addr == 0)) { 221 219 printf("%s: Invalid RAM disk physical address\n", NAME); 222 220 return false; 223 221 } 224 222 225 rd_size = ALIGN_UP(size, block_size);226 223 rd_addr = as_get_mappable_page(rd_size); 227 224 228 unsigned int flags = 229 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE; 230 ret = physmem_map((void *) addr_phys, rd_addr, 225 int flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE; 226 int retval = physmem_map((void *) rd_ph_addr, rd_addr, 231 227 ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags); 232 if (ret < 0) { 228 229 if (retval < 0) { 233 230 printf("%s: Error mapping RAM disk\n", NAME); 234 231 return false; 235 232 } 236 233 237 printf("%s: Found RAM disk at %p, % " PRIun "bytes\n", NAME,238 (void *) addr_phys,size);239 240 ret= loc_server_register(NAME, rd_connection);241 if (r et< 0) {242 printf("%s: Unable to register driver (%d)\n", NAME, r et);234 printf("%s: Found RAM disk at %p, %zu bytes\n", NAME, 235 (void *) rd_ph_addr, rd_size); 236 237 int rc = loc_server_register(NAME, rd_connection); 238 if (rc < 0) { 239 printf("%s: Unable to register driver (%d)\n", NAME, rc); 243 240 return false; 244 241 } 245 242 246 243 service_id_t service_id; 247 ret = loc_service_register("bd/initrd", &service_id); 248 if (ret != EOK) { 244 if (loc_service_register("bd/initrd", &service_id) != EOK) { 249 245 printf("%s: Unable to register device service\n", NAME); 250 246 return false; -
uspace/srv/fs/exfat/exfat_directory.c
r89128f3 rb25199bc 101 101 { 102 102 uint32_t i; 103 int rc = EOK;103 int rc; 104 104 105 105 i = (di->pos * sizeof(exfat_dentry_t)) / BPS(di->bs); … … 108 108 109 109 if (di->b && di->bnum != i) { 110 rc =block_put(di->b);110 block_put(di->b); 111 111 di->b = NULL; 112 112 } … … 126 126 di->bnum = i; 127 127 } 128 return rc;128 return EOK; 129 129 } 130 130 … … 434 434 int rc, count; 435 435 exfat_dentry_t *de; 436 437 di->pos = pos;438 436 439 437 rc = exfat_directory_get(di, &de); -
uspace/srv/fs/mfs/mfs.h
r89128f3 rb25199bc 48 48 #define NAME "mfs" 49 49 50 / * #define DEBUG_MODE */50 //#define DEBUG_MODE 51 51 52 52 #define min(a, b) ((a) < (b) ? (a) : (b)) … … 71 71 } mfs_version_t; 72 72 73 /* Generic MinixFS superblock*/73 /*Generic MinixFS superblock*/ 74 74 struct mfs_sb_info { 75 75 uint32_t ninodes; … … 84 84 uint16_t state; 85 85 86 /* The following fields do not exist on disk but only in memory*/86 /*The following fields do not exist on disk but only in memory*/ 87 87 unsigned long itable_size; 88 88 mfs_version_t fs_version; … … 97 97 }; 98 98 99 /* Generic MinixFS inode*/99 /*Generic MinixFS inode*/ 100 100 struct mfs_ino_info { 101 101 uint16_t i_mode; … … 107 107 int32_t i_mtime; 108 108 int32_t i_ctime; 109 /* Block numbers for direct zones*/109 /*Block numbers for direct zones*/ 110 110 uint32_t i_dzone[V2_NR_DIRECT_ZONES]; 111 /* Block numbers for indirect zones*/111 /*Block numbers for indirect zones*/ 112 112 uint32_t i_izone[V2_NR_INDIRECT_ZONES]; 113 113 114 /* The following fields do not exist on disk but only in memory*/114 /*The following fields do not exist on disk but only in memory*/ 115 115 bool dirty; 116 116 fs_index_t index; 117 117 }; 118 118 119 /* Generic MFS directory entry*/119 /*Generic MFS directory entry*/ 120 120 struct mfs_dentry_info { 121 121 uint32_t d_inum; 122 122 char d_name[MFS3_MAX_NAME_LEN + 1]; 123 123 124 /* The following fields do not exist on disk but only in memory*/125 126 /* Index of the dentry in the list*/124 /*The following fields do not exist on disk but only in memory*/ 125 126 /*Index of the dentry in the list*/ 127 127 unsigned index; 128 /* Pointer to the node at witch the dentry belongs*/128 /*Pointer to the node at witch the dentry belongs*/ 129 129 struct mfs_node *node; 130 130 }; … … 136 136 }; 137 137 138 /* MinixFS node in core*/138 /*MinixFS node in core*/ 139 139 struct mfs_node { 140 140 struct mfs_ino_info *ino_i; … … 145 145 }; 146 146 147 /* mfs_ops.c*/147 /*mfs_ops.c*/ 148 148 extern vfs_out_ops_t mfs_ops; 149 149 extern libfs_ops_t mfs_libfs_ops; … … 152 152 mfs_global_init(void); 153 153 154 /* mfs_inode.c*/154 /*mfs_inode.c*/ 155 155 extern int 156 156 mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i, 157 157 fs_index_t index); 158 158 159 159 extern int … … 163 163 mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink); 164 164 165 /* mfs_rw.c*/165 /*mfs_rw.c*/ 166 166 extern int 167 167 mfs_read_map(uint32_t *b, const struct mfs_node *mnode, const uint32_t pos); … … 169 169 extern int 170 170 mfs_write_map(struct mfs_node *mnode, uint32_t pos, uint32_t new_zone, 171 171 uint32_t *old_zone); 172 172 173 173 extern int 174 174 mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size); 175 175 176 /* mfs_dentry.c*/176 /*mfs_dentry.c*/ 177 177 extern int 178 178 mfs_read_dentry(struct mfs_node *mnode, 179 struct mfs_dentry_info *d_info, unsigned index);179 struct mfs_dentry_info *d_info, unsigned index); 180 180 181 181 extern int … … 188 188 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum); 189 189 190 /* mfs_balloc.c*/190 /*mfs_balloc.c*/ 191 191 extern int 192 192 mfs_alloc_inode(struct mfs_instance *inst, uint32_t *inum); … … 201 201 mfs_free_zone(struct mfs_instance *inst, uint32_t zone); 202 202 203 /* mfs_utils.c*/203 /*mfs_utils.c*/ 204 204 extern uint16_t 205 205 conv16(bool native, uint16_t n); -
uspace/srv/fs/mfs/mfs_balloc.c
r89128f3 rb25199bc 198 198 limit = sbi->nzones - sbi->firstdatazone - 1; 199 199 } else { 200 /* bid == BMAP_INODE*/200 /*bid == BMAP_INODE*/ 201 201 search = &sbi->isearch; 202 202 start_block = 2; … … 212 212 for (i = *search / bits_per_block; i < nblocks; ++i) { 213 213 r = block_get(&b, inst->service_id, i + start_block, 214 BLOCK_FLAGS_NONE);214 BLOCK_FLAGS_NONE); 215 215 216 216 if (r != EOK) -
uspace/srv/fs/mfs/mfs_dentry.c
r89128f3 rb25199bc 168 168 return ENAMETOOLONG; 169 169 170 /* Search the directory entry to be removed*/170 /*Search the directory entry to be removed*/ 171 171 unsigned i; 172 172 for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize ; ++i) { -
uspace/srv/fs/mfs/mfs_inode.c
r89128f3 rb25199bc 235 235 236 236 r = block_get(&b, mnode->instance->service_id, 237 itable_off + inum / sbi->ino_per_block,238 BLOCK_FLAGS_NONE);237 itable_off + inum / sbi->ino_per_block, 238 BLOCK_FLAGS_NONE); 239 239 240 240 if (r != EOK) … … 278 278 279 279 r = block_get(&b, mnode->instance->service_id, 280 itable_off + inum / sbi->ino_per_block,281 BLOCK_FLAGS_NONE);280 itable_off + inum / sbi->ino_per_block, 281 BLOCK_FLAGS_NONE); 282 282 283 283 if (r != EOK) -
uspace/srv/fs/mfs/mfs_ops.c
r89128f3 rb25199bc 664 664 struct mfs_node *child = cfn->data; 665 665 struct mfs_sb_info *sbi = parent->instance->sbi; 666 bool destroy_dentry = false;667 666 668 667 mfsdebug("%s()\n", __FUNCTION__); … … 673 672 int r = mfs_insert_dentry(parent, name, child->ino_i->index); 674 673 if (r != EOK) 675 return r; 674 goto exit_error; 675 676 child->ino_i->i_nlinks++; 677 child->ino_i->dirty = true; 676 678 677 679 if (S_ISDIR(child->ino_i->i_mode)) { 678 if (child->ino_i->i_nlinks != 1) {679 /* It's not possible to hardlink directories in MFS */680 destroy_dentry = true;681 r = EMLINK;682 goto exit;683 }684 680 r = mfs_insert_dentry(child, ".", child->ino_i->index); 685 if (r != EOK) { 686 destroy_dentry = true; 687 goto exit; 688 } 681 if (r != EOK) 682 goto exit_error; 689 683 690 684 r = mfs_insert_dentry(child, "..", parent->ino_i->index); 691 if (r != EOK) { 692 destroy_dentry = true; 693 goto exit; 694 } 685 if (r != EOK) 686 goto exit_error; 695 687 696 688 parent->ino_i->i_nlinks++; … … 698 690 } 699 691 700 exit: 701 if (destroy_dentry) { 702 int r2 = mfs_remove_dentry(parent, name); 703 if (r2 != EOK) 704 r = r2; 705 } else { 706 child->ino_i->i_nlinks++; 707 child->ino_i->dirty = true; 708 } 692 exit_error: 709 693 return r; 710 694 } … … 837 821 found: 838 822 async_data_read_finalize(callid, d_info.d_name, 839 823 str_size(d_info.d_name) + 1); 840 824 bytes = ((pos - spos) + 1); 841 825 } else { -
uspace/srv/fs/mfs/mfs_rw.c
r89128f3 rb25199bc 147 147 ino_i->dirty = true; 148 148 } else { 149 /* Sparse block*/149 /*Sparse block*/ 150 150 *b = 0; 151 151 return EOK; … … 233 233 } 234 234 235 /**Free unused indirect zones from a MINIX inode according to it s new size.235 /**Free unused indirect zones from a MINIX inode according to it's new size. 236 236 * 237 237 * @param mnode Pointer to a generic MINIX inode in memory.
Note:
See TracChangeset
for help on using the changeset viewer.