Changeset 2946


Ignore:
Timestamp:
Apr 19, 2012, 9:05:54 PM (3 years ago)
Author:
wmb
Message:

OLPC trac 11786 - fixed bug with file deletion introduced by svn 2817.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ofw/fs/ext2fs/dir.fth

    r2817 r2946  
    7878: +link-count  ( increment -- ) 
    7979   \ link-count = 1 means that the directory has more links than can 
    80    \ be represented in a 16-bit number 
    81    link-count 1 =  if  drop exit  then  \ Don't increment if already 1 
     80   \ be represented in a 16-bit number; don't increment in that case. 
     81   dir?  if                ( increment ) 
     82      link-count 1 =  if   ( increment ) 
     83         drop exit         ( -- ) 
     84      then                 ( increment ) 
     85   then                    ( increment ) 
     86 
     87   link-count +            ( link-count' ) 
    8288 
    8389   \ If the incremented value exceeds the limit, store 1 
    8490   \ We should also set the RO_COMPAT_DIR_NLINK bit in the superblock, 
    85    \ but we assume that OFW won't really be used to create enormous directories 
    86    link-count +  dup d# 65000 >=  if  drop 1  then  ( link-count ) 
    87  
    88    link-count! 
     91   \ but we assume that OFW won't be used to create enormous directories 
     92   dir?  if                ( link-count ) 
     93      dup d# 65000 >=  if  ( link-count ) 
     94         drop 1            ( link-count' ) 
     95      then                 ( link-count' ) 
     96   then                    ( link-count ) 
     97 
     98   link-count!             ( ) 
    8999; 
    90100 
Note: See TracChangeset for help on using the changeset viewer.