[openfirmware] r1248 - ofw/fs/ext2fs

svn at openfirmware.info svn at openfirmware.info
Wed Jul 22 09:29:06 CEST 2009


Author: wmb
Date: 2009-07-22 09:29:06 +0200 (Wed, 22 Jul 2009)
New Revision: 1248

Modified:
   ofw/fs/ext2fs/dir.fth
   ofw/fs/ext2fs/methods.fth
Log:
Fixed ext2 file creation problem.








Modified: ofw/fs/ext2fs/dir.fth
===================================================================
--- ofw/fs/ext2fs/dir.fth	2009-07-22 07:12:17 UTC (rev 1247)
+++ ofw/fs/ext2fs/dir.fth	2009-07-22 07:29:06 UTC (rev 1248)
@@ -135,12 +135,12 @@
    (last-dirent) drop
    dirent-len@  dirent-reclen  -
 ;
-: set-dirent   ( name$ rec-len inode# -- )
+: set-dirent   ( name$ type rec-len file-type inode# -- )
    dirent int!						( name$ rec-len )
+   \ XXX this should be contingent upon EXT2_FEATURE_INCOMPAT_FILETYPE
+   dirent-type!						( name$ )
    dirent-len!						( name$ )
    dup dirent-namelen!					( name$ )
-   \ XXX set actual file type here if EXT2_FEATURE_INCOMPAT_FILETYPE
-   0 dirent-type!					( name$ )
    dirent-nameadr swap move				( )
    update
 ;
@@ -173,6 +173,10 @@
    false
 ;
 
+1 constant regular-type
+2 constant dir-type
+7 constant symlink-type
+
 : ($create)   ( name$ mode -- error? )
    >r							( name$ )
    \ check for room in the directory, and expand it if necessary
@@ -184,7 +188,7 @@
    then							( name$ rec-len )
 
    \ At this point dirent points to the place for the new dirent
-   alloc-inode set-dirent false				( error? )
+   regular-type alloc-inode set-dirent false		( error? )
    r> dirent-inode@ init-inode
 ;
 
@@ -199,10 +203,6 @@
 
 \ --
 
-1 constant regular-type
-2 constant dir-type
-7 constant symlink-type
-
 \ Information that we need about the working file/directory
 \ The working file changes at each level of a path search
 

Modified: ofw/fs/ext2fs/methods.fth
===================================================================
--- ofw/fs/ext2fs/methods.fth	2009-07-22 07:12:17 UTC (rev 1247)
+++ ofw/fs/ext2fs/methods.fth	2009-07-22 07:29:06 UTC (rev 1248)
@@ -23,9 +23,9 @@
    block bsize erase update	\  flush
    wd-inum >r
    inode# first-dirent  if  r> drop  true exit  then
-   " ."   d# 12		 inode#	set-dirent
+   " ."   d# 12	dir-type inode#	set-dirent
    d# 12 diroff !
-   " .."  bsize d# 12 -	 r> set-dirent
+   " .."  bsize d# 12 -	dir-type r> set-dirent
    false				( error? )
    diroff off
 ;




More information about the openfirmware mailing list