Ejemplo n.º 1
0
        /*
         * public static bool HasChildIncore(RedFS_Inode wip, int level, long sfbn)
         * {
         *  if (level == 1)
         *  {
         *      RedBufL1 wbl1 = (RedBufL1)wip.FindOrInsertOrRemoveBuf(FIR_OPTYPE.FIND, 1, sfbn, null, null);
         *      if (wbl1.get_numchildptrs_incore() != 0) return true;
         *      else return false;
         *  }
         *  else if (level == 2)
         *  {
         *      RedBufL2 wbl2 = (RedBufL2)wip.FindOrInsertOrRemoveBuf(FIR_OPTYPE.FIND, 2, sfbn, null, null);
         *      if (wbl2.get_numchildptrs_incore() != 0) return true;
         *      else return false;
         *  }
         *  else
         *  {
         *      DEFS.ASSERT(false, "Dont pass wrong arguments");
         *      return false;
         *  }
         * }
         */

        public static bool HasChildIncoreOld(RedFS_Inode wip, int level, long sfbn)
        {
            DEFS.ASSERT(level > 0, "Incorrect level to HasChildIncore()");
            if (level == 1)
            {
                int count0 = wip.L0list.Count;
                int span1  = 1024;

                for (int i = 0; i < count0; i++)
                {
                    RedBufL0 wbl0 = (RedBufL0)wip.L0list.ElementAt(i);
                    if (wbl0.m_start_fbn >= sfbn && wbl0.m_start_fbn < (sfbn + span1))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            else
            {
                int count1 = wip.L1list.Count;
                int span2  = 1024 * 1024;

                for (int i = 0; i < count1; i++)
                {
                    RedBufL1 wbl1 = (RedBufL1)wip.L1list.ElementAt(i);
                    if (wbl1.m_start_fbn >= sfbn && wbl1.m_start_fbn < (sfbn + span2))
                    {
                        return(true);
                    }
                }
                return(false);
            }
        }
 public void deallocate4(RedBufL0 wb)
 {
     lock (iStack)
     {
         iStackTop++;
         iStack[iStackTop] = wb;
     }
 }
 public void init()
 {
     for (int i = 0; i < iStack.Length; i++)
     {
         iStack[i] = new RedBufL0(0);
     }
     iStackTop = iStack.Length - 1;
 }
 public RedBufL0 allocate(long sf)
 {
     lock (iStack)
     {
         RedBufL0 wb = iStack[iStackTop];
         iStackTop--;
         wb.reinitbuf(sf);
         return(wb);
     }
 }
Ejemplo n.º 5
0
 public static bool DedupeBCompare(RedBufL0 wbl0a, RedBufL0 wbl0b)
 {
     return(true);
 }