Changeset 2947
- Timestamp:
- Apr 20, 2012 9:07:04 AM (13 months ago)
- Location:
- ofw/fs/ext2fs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ofw/fs/ext2fs/bitmap.fth
r2815 r2947 76 76 r> h# 0e + le-w! ( ) 77 77 ; 78 : free-inodes+! ( n inode# -- )78 : free-inodes+! ( n group# -- ) 79 79 tuck free-inodes@ + ( group# n' ) 80 80 over free-inodes! ( group# ) 81 81 gd-update ( ) 82 ; 83 : used-dirs@ ( group# -- n ) 84 group-desc dup h# 10 + le-w@ ( adr lo ) 85 desc64? if ( adr lo ) 86 swap h# 30 + le-w@ wljoin ( n ) 87 else ( adr lo ) 88 nip ( n ) 89 then ( n ) 90 ; 91 : used-dirs! ( n group# -- ) 92 group-desc >r ( n r: adr ) 93 desc64? if ( n r: adr ) 94 lwsplit ( lo hi r: adr ) 95 r@ h# 30 + le-w! ( lo r: adr ) 96 then ( n r: adr ) 97 r> h# 10 + le-w! ( ) 98 ; 99 : used-dirs+! ( n group# -- ) 100 tuck used-dirs@ + ( group# n' ) 101 over used-dirs! ( group# ) 102 gd-update ( ) 82 103 ; 83 104 -
ofw/fs/ext2fs/dir.fth
r2946 r2947 79 79 \ link-count = 1 means that the directory has more links than can 80 80 \ be represented in a 16-bit number; don't increment in that case. 81 dir? if( increment )81 dir? sb-nlink? and if ( increment ) 82 82 link-count 1 = if ( increment ) 83 83 drop exit ( -- ) … … 90 90 \ We should also set the RO_COMPAT_DIR_NLINK bit in the superblock, 91 91 \ but we assume that OFW won't be used to create enormous directories 92 dir? if( link-count )92 dir? sb-nlink? and if ( link-count ) 93 93 dup d# 65000 >= if ( link-count ) 94 94 drop 1 ( link-count' ) … … 107 107 mtime! ( ) \ set modification time 108 108 0 link-count! ( ) \ link count will be incremented by new-dirent 109 dir? if 110 1 inode# 1- ipg / used-dirs+! 111 then 109 112 inode# ( inode# ) 110 113 ; … … 215 218 \ Delete the currently selected inode. Does not affect the directory entry, if any. 216 219 : idelete ( -- ) 220 dir? if 221 -1 inode# 1- ipg / used-dirs+! 222 then 223 217 224 \ Short symlinks hold no blocks, but have a string in the direct block list, 218 225 \ so we must not interpret that string as a block list. … … 277 284 278 285 \ new-inode changed the value of inode#; we must restore it so 279 \ new-dirent can find info about the containing dire tory286 \ new-dirent can find info about the containing directory 280 287 wd-inum set-inode ( name$ inode# ) 281 288 -
ofw/fs/ext2fs/sb.fth
r2817 r2947 58 58 : sb-extents? ( -- flag ) incompat-flags h# 40 and 0<> ; 59 59 : sb-gd-csum? ( -- flag ) ro-flags h# 10 and 0<> ; 60 : sb-nlink? ( -- flag ) ro-flags h# 20 and 0<> ; 60 61 61 62 \ Don't write to a disk that uses extensions we don't understand
Note: See TracChangeset
for help on using the changeset viewer.
