[BACK]Return to ffs_subr.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / ufs / ffs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/ufs/ffs/ffs_subr.c between version 1.15.10.3 and 1.15.10.4

version 1.15.10.3, 2002/02/11 20:10:47 version 1.15.10.4, 2002/06/23 17:52:08
Line 127  ffs_fragacct(fs, fragmap, fraglist, cnt,
Line 127  ffs_fragacct(fs, fragmap, fraglist, cnt,
         inblk = (int)(fragtbl[fs->fs_frag][fragmap]) << 1;          inblk = (int)(fragtbl[fs->fs_frag][fragmap]) << 1;
         fragmap <<= 1;          fragmap <<= 1;
         for (siz = 1; siz < fs->fs_frag; siz++) {          for (siz = 1; siz < fs->fs_frag; siz++) {
                 if ((inblk & (1 << (siz + (fs->fs_frag % NBBY)))) == 0)                  if ((inblk & (1 << (siz + (fs->fs_frag & (NBBY - 1))))) == 0)
                         continue;                          continue;
                 field = around[siz];                  field = around[siz];
                 subfield = inside[siz];                  subfield = inside[siz];
Line 193  ffs_isblock(fs, cp, h)
Line 193  ffs_isblock(fs, cp, h)
 {  {
         u_char mask;          u_char mask;
   
         switch ((int)fs->fs_frag) {          switch ((int)fs->fs_fragshift) {
         case 8:          case 3:
                 return (cp[h] == 0xff);                  return (cp[h] == 0xff);
         case 4:          case 2:
                 mask = 0x0f << ((h & 0x1) << 2);                  mask = 0x0f << ((h & 0x1) << 2);
                 return ((cp[h >> 1] & mask) == mask);                  return ((cp[h >> 1] & mask) == mask);
         case 2:          case 1:
                 mask = 0x03 << ((h & 0x3) << 1);                  mask = 0x03 << ((h & 0x3) << 1);
                 return ((cp[h >> 2] & mask) == mask);                  return ((cp[h >> 2] & mask) == mask);
         case 1:          case 0:
                 mask = 0x01 << (h & 0x7);                  mask = 0x01 << (h & 0x7);
                 return ((cp[h >> 3] & mask) == mask);                  return ((cp[h >> 3] & mask) == mask);
         default:          default:
                 panic("ffs_isblock: unknown fs_frag %d", (int)fs->fs_frag);                  panic("ffs_isblock: unknown fs_fragshift %d",
                       (int)fs->fs_fragshift);
         }          }
 }  }
   
Line 220  ffs_isfreeblock(fs, cp, h)
Line 221  ffs_isfreeblock(fs, cp, h)
         ufs_daddr_t h;          ufs_daddr_t h;
 {  {
   
         switch ((int)fs->fs_frag) {          switch ((int)fs->fs_fragshift) {
         case 8:          case 3:
                 return (cp[h] == 0);                  return (cp[h] == 0);
         case 4:  
                 return ((cp[h >> 1] & (0x0f << ((h & 0x1) << 2))) == 0);  
         case 2:          case 2:
                 return ((cp[h >> 2] & (0x03 << ((h & 0x3) << 1))) == 0);                  return ((cp[h >> 1] & (0x0f << ((h & 0x1) << 2))) == 0);
         case 1:          case 1:
                   return ((cp[h >> 2] & (0x03 << ((h & 0x3) << 1))) == 0);
           case 0:
                 return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0);                  return ((cp[h >> 3] & (0x01 << (h & 0x7))) == 0);
         default:          default:
                 panic("ffs_isfreeblock: unknown fs_frag %d", (int)fs->fs_frag);                  panic("ffs_isfreeblock: unknown fs_fragshift %d",
                       (int)fs->fs_fragshift);
         }          }
 }  }
   
Line 244  ffs_clrblock(fs, cp, h)
Line 246  ffs_clrblock(fs, cp, h)
         ufs_daddr_t h;          ufs_daddr_t h;
 {  {
   
         switch ((int)fs->fs_frag) {          switch ((int)fs->fs_fragshift) {
         case 8:          case 3:
                 cp[h] = 0;                  cp[h] = 0;
                 return;                  return;
         case 4:          case 2:
                 cp[h >> 1] &= ~(0x0f << ((h & 0x1) << 2));                  cp[h >> 1] &= ~(0x0f << ((h & 0x1) << 2));
                 return;                  return;
         case 2:          case 1:
                 cp[h >> 2] &= ~(0x03 << ((h & 0x3) << 1));                  cp[h >> 2] &= ~(0x03 << ((h & 0x3) << 1));
                 return;                  return;
         case 1:          case 0:
                 cp[h >> 3] &= ~(0x01 << (h & 0x7));                  cp[h >> 3] &= ~(0x01 << (h & 0x7));
                 return;                  return;
         default:          default:
                 panic("ffs_clrblock: unknown fs_frag %d", (int)fs->fs_frag);                  panic("ffs_clrblock: unknown fs_fragshift %d",
                       (int)fs->fs_fragshift);
         }          }
 }  }
   
Line 272  ffs_setblock(fs, cp, h)
Line 275  ffs_setblock(fs, cp, h)
         ufs_daddr_t h;          ufs_daddr_t h;
 {  {
   
         switch ((int)fs->fs_frag) {          switch ((int)fs->fs_fragshift) {
           case 3:
         case 8:  
                 cp[h] = 0xff;                  cp[h] = 0xff;
                 return;                  return;
         case 4:          case 2:
                 cp[h >> 1] |= (0x0f << ((h & 0x1) << 2));                  cp[h >> 1] |= (0x0f << ((h & 0x1) << 2));
                 return;                  return;
         case 2:          case 1:
                 cp[h >> 2] |= (0x03 << ((h & 0x3) << 1));                  cp[h >> 2] |= (0x03 << ((h & 0x3) << 1));
                 return;                  return;
         case 1:          case 0:
                 cp[h >> 3] |= (0x01 << (h & 0x7));                  cp[h >> 3] |= (0x01 << (h & 0x7));
                 return;                  return;
         default:          default:
                 panic("ffs_setblock: unknown fs_frag %d", (int)fs->fs_frag);                  panic("ffs_setblock: unknown fs_fragshift %d",
                       (int)fs->fs_fragshift);
         }          }
 }  }

Legend:
Removed from v.1.15.10.3  
changed lines
  Added in v.1.15.10.4

CVSweb <webmaster@jp.NetBSD.org>