forked from KolibriOS/kolibrios
fix disk-full handling when creating a folder in ramdisk
git-svn-id: svn://kolibrios.org@3525 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b7d54cce54
commit
df1bbc6819
@ -1601,8 +1601,26 @@ fs_RamdiskRewrite:
|
|||||||
cmp ecx, eax
|
cmp ecx, eax
|
||||||
jb .scan_cont
|
jb .scan_cont
|
||||||
; found!
|
; found!
|
||||||
; calculate name checksum
|
; If creating a directory, allocate one data cluster now and fail immediately
|
||||||
|
; if this is impossible. This prevents from creating an invalid directory entry
|
||||||
|
; on a full disk.
|
||||||
|
; yup, the argument is quite non-intuitive... but what should I do if
|
||||||
|
; the entire function uses such arguments? BTW, it refers to al from pushad,
|
||||||
|
; which in turn is filled with 0 in fs_RamdiskRewrite and 1 in fs_RamdiskCreateFolder.
|
||||||
push esi ecx
|
push esi ecx
|
||||||
|
cmp byte [esp+24+12+20+28], 0
|
||||||
|
jz .no.preallocate.folder.data
|
||||||
|
mov ecx, 2849
|
||||||
|
mov edi, RAMDISK_FAT
|
||||||
|
xor eax, eax
|
||||||
|
repnz scasw
|
||||||
|
jz @f
|
||||||
|
add esp, 24
|
||||||
|
jmp .disk_full
|
||||||
|
@@:
|
||||||
|
mov [esp+24+12+20+20], edi ; store the cluster somewhere
|
||||||
|
.no.preallocate.folder.data:
|
||||||
|
; calculate name checksum
|
||||||
mov esi, [esp+8+8]
|
mov esi, [esp+8+8]
|
||||||
mov ecx, 11
|
mov ecx, 11
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -1672,6 +1690,13 @@ fs_RamdiskRewrite:
|
|||||||
mov byte [edi+11], 10h ; attributes: folder
|
mov byte [edi+11], 10h ; attributes: folder
|
||||||
mov ecx, 32*2
|
mov ecx, 32*2
|
||||||
mov edx, edi
|
mov edx, edi
|
||||||
|
push edx
|
||||||
|
push ecx
|
||||||
|
push edi
|
||||||
|
add edi, 26 ; edi points to low word of cluster
|
||||||
|
push edi
|
||||||
|
mov edi, [esp+16+20+20]
|
||||||
|
jmp .doit2
|
||||||
.doit:
|
.doit:
|
||||||
push edx
|
push edx
|
||||||
push ecx
|
push ecx
|
||||||
@ -1686,6 +1711,7 @@ fs_RamdiskRewrite:
|
|||||||
xor eax, eax
|
xor eax, eax
|
||||||
repnz scasw
|
repnz scasw
|
||||||
jnz .disk_full2
|
jnz .disk_full2
|
||||||
|
.doit2:
|
||||||
dec edi
|
dec edi
|
||||||
dec edi
|
dec edi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user