亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rf_dagfuncs.c

?? RAIDFrame是個非常好的磁盤陣列RAID仿真工具
?? C
?? 第 1 頁 / 共 3 頁
字號:
  RF_Etimer_t timer;  int i, retcode;  RF_PhysDiskAddr_t *pda;  caddr_t undoBuf;  retcode = 0;  if (node->dagHdr->status == rf_enable) {    /* don't do the XOR if the input is the same as the output */    RF_ETIMER_START(timer);    for (i=0; i<node->numParams-1; i+=2) if (node->params[i+1].p != node->results[0]) {#if RF_BACKWARD > 0      /* This section mimics undo logging for backward error recovery experiments b       * allocating and initializing a buffer       * XXX 512 byte sector size is hard coded!       */      pda = node->params[i].p;      if (node->dagHdr->allocList == NULL)	rf_MakeAllocList(node->dagHdr->allocList);      RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);#endif /* RF_BACKWARD > 0 */      retcode = rf_XorIntoBuffer(raidPtr, (RF_PhysDiskAddr_t *) node->params[i].p,			      (char *)node->params[i+1].p, (char *) node->results[0], node->dagHdr->bp);    }    RF_ETIMER_STOP(timer); RF_ETIMER_EVAL(timer); tracerec->xor_us += RF_ETIMER_VAL_US(timer);  }  return(rf_GenericWakeupFunc(node, retcode));     /* call wake func explicitly since no I/O in this node */}/* xor the inputs into the result buffer, ignoring placement issues */int rf_SimpleXorFunc(node)  RF_DagNode_t  *node;{  RF_Raid_t *raidPtr = (RF_Raid_t *)node->params[node->numParams-1].p;  int i, retcode = 0;  RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;  RF_Etimer_t timer;  RF_PhysDiskAddr_t *pda;  caddr_t undoBuf;  if (node->dagHdr->status == rf_enable) {    RF_ETIMER_START(timer);    /* don't do the XOR if the input is the same as the output */    for (i=0; i<node->numParams-1; i+=2) if (node->params[i+1].p != node->results[0]) {#if RF_BACKWARD > 0      /* This section mimics undo logging for backward error recovery experiments b       * allocating and initializing a buffer       * XXX 512 byte sector size is hard coded!       */      pda = node->params[i].p;      if (node->dagHdr->allocList == NULL)	rf_MakeAllocList(node->dagHdr->allocList);      RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);#endif /* RF_BACKWARD > 0 */      retcode = rf_bxor((char *)node->params[i+1].p, (char *) node->results[0], 		     rf_RaidAddressToByte(raidPtr, ((RF_PhysDiskAddr_t *)node->params[i].p)->numSector),		     (struct buf *) node->dagHdr->bp);    }    RF_ETIMER_STOP(timer); RF_ETIMER_EVAL(timer); tracerec->xor_us += RF_ETIMER_VAL_US(timer);  }  return(rf_GenericWakeupFunc(node, retcode));     /* call wake func explicitly since no I/O in this node */}/* this xor is used by the degraded-mode dag functions to recover lost data. * the second-to-last parameter is the PDA for the failed portion of the access. * the code here looks at this PDA and assumes that the xor target buffer is * equal in size to the number of sectors in the failed PDA.  It then uses * the other PDAs in the parameter list to determine where within the target * buffer the corresponding data should be xored. */int rf_RecoveryXorFunc(node)  RF_DagNode_t  *node;{  RF_Raid_t *raidPtr = (RF_Raid_t *)node->params[node->numParams-1].p;  RF_RaidLayout_t *layoutPtr = (RF_RaidLayout_t *) &raidPtr->Layout;  RF_PhysDiskAddr_t *failedPDA = (RF_PhysDiskAddr_t *)node->params[node->numParams-2].p;  int i, retcode = 0;  RF_PhysDiskAddr_t *pda;  int suoffset, failedSUOffset = rf_StripeUnitOffset(layoutPtr,failedPDA->startSector);  char *srcbuf, *destbuf;  RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;  RF_Etimer_t timer;  caddr_t undoBuf;  if (node->dagHdr->status == rf_enable) {    RF_ETIMER_START(timer);    for (i=0; i<node->numParams-2; i+=2) if (node->params[i+1].p != node->results[0]) {      pda = (RF_PhysDiskAddr_t *)node->params[i].p;#if RF_BACKWARD > 0      /* This section mimics undo logging for backward error recovery experiments b       * allocating and initializing a buffer       * XXX 512 byte sector size is hard coded!       */      if (node->dagHdr->allocList == NULL)	rf_MakeAllocList(node->dagHdr->allocList);      RF_CallocAndAdd(undoBuf, 1, 512 * pda->numSector, (caddr_t), node->dagHdr->allocList);#endif /* RF_BACKWARD > 0 */      srcbuf = (char *)node->params[i+1].p;      suoffset = rf_StripeUnitOffset(layoutPtr, pda->startSector);      destbuf = ((char *) node->results[0]) + rf_RaidAddressToByte(raidPtr,suoffset-failedSUOffset);      retcode = rf_bxor(srcbuf, destbuf, rf_RaidAddressToByte(raidPtr, pda->numSector), node->dagHdr->bp);    }    RF_ETIMER_STOP(timer); RF_ETIMER_EVAL(timer); tracerec->xor_us += RF_ETIMER_VAL_US(timer);  }  return (rf_GenericWakeupFunc(node, retcode));}/***************************************************************************************** * The next three functions are utilities used by the above xor-execution functions. ****************************************************************************************//* * this is just a glorified buffer xor.  targbuf points to a buffer that is one full stripe unit * in size.  srcbuf points to a buffer that may be less than 1 SU, but never more.  When the * access described by pda is one SU in size (which by implication means it's SU-aligned), * all that happens is (targbuf) <- (srcbuf ^ targbuf).  When the access is less than one * SU in size the XOR occurs on only the portion of targbuf identified in the pda. */int rf_XorIntoBuffer(raidPtr, pda, srcbuf, targbuf, bp)  RF_Raid_t          *raidPtr;  RF_PhysDiskAddr_t  *pda;  char               *srcbuf;  char               *targbuf;  void               *bp;{  char *targptr;  int sectPerSU = raidPtr->Layout.sectorsPerStripeUnit;  int SUOffset = pda->startSector % sectPerSU;  int length, retcode = 0;  RF_ASSERT(pda->numSector <= sectPerSU);    targptr = targbuf + rf_RaidAddressToByte(raidPtr, SUOffset);  length  = rf_RaidAddressToByte(raidPtr, pda->numSector);  retcode = rf_bxor(srcbuf, targptr, length, bp);  return(retcode);}/* it really should be the case that the buffer pointers (returned by malloc) * are aligned to the natural word size of the machine, so this is the only * case we optimize for.  The length should always be a multiple of the sector * size, so there should be no problem with leftover bytes at the end. */int rf_bxor(src, dest, len, bp)  char  *src;  char  *dest;  int    len;  void  *bp;{  unsigned mask = sizeof(long) -1, retcode = 0;    if ( !(((unsigned long) src) & mask) && !(((unsigned long) dest) & mask) && !(len&mask) ) {    retcode = rf_longword_bxor((unsigned long *) src, (unsigned long *) dest, len>>RF_LONGSHIFT, bp);  } else {    RF_ASSERT(0);  }  return(retcode);}/* map a user buffer into kernel space, if necessary */#ifdef KERNEL#define REMAP_VA(_bp,x,y) (y) = (unsigned long *) ((IS_SYS_VA(x)) ? (unsigned long *)(x) : (unsigned long *) rf_MapToKernelSpace((struct buf *) (_bp), (caddr_t)(x)))#else /* KERNEL */#define REMAP_VA(_bp,x,y) (y) = (x)#endif /* KERNEL *//* When XORing in kernel mode, we need to map each user page to kernel space before we can access it. * We don't want to assume anything about which input buffers are in kernel/user * space, nor about their alignment, so in each loop we compute the maximum number * of bytes that we can xor without crossing any page boundaries, and do only this many * bytes before the next remap. */int rf_longword_bxor(src, dest, len, bp)  register unsigned long  *src;  register unsigned long  *dest;  int                      len; /* longwords */  void                    *bp;{  register unsigned long *end = src+len;  register unsigned long d0, d1, d2, d3, s0, s1, s2, s3;   /* temps */  register unsigned long *pg_src, *pg_dest;                /* per-page source/dest pointers */  int longs_this_time;                                     /* # longwords to xor in the current iteration */  REMAP_VA(bp, src, pg_src);  REMAP_VA(bp, dest, pg_dest);  if (!pg_src || !pg_dest) return(EFAULT);    while (len >= 4 ) {    longs_this_time = RF_MIN(len, RF_MIN(RF_BLIP(pg_src), RF_BLIP(pg_dest)) >> RF_LONGSHIFT);  /* note len in longwords */    src += longs_this_time; dest+= longs_this_time; len -= longs_this_time;    while (longs_this_time >= 4) {      d0 = pg_dest[0];      d1 = pg_dest[1];      d2 = pg_dest[2];      d3 = pg_dest[3];      s0 = pg_src[0];      s1 = pg_src[1];      s2 = pg_src[2];      s3 = pg_src[3];      pg_dest[0] = d0 ^ s0;      pg_dest[1] = d1 ^ s1;      pg_dest[2] = d2 ^ s2;      pg_dest[3] = d3 ^ s3;      pg_src += 4;      pg_dest += 4;      longs_this_time -= 4;    }    while (longs_this_time > 0) {   /* cannot cross any page boundaries here */      *pg_dest++ ^= *pg_src++;      longs_this_time--;    }        /* either we're done, or we've reached a page boundary on one (or possibly both) of the pointers */    if (len) {      if (RF_PAGE_ALIGNED(src))  REMAP_VA(bp, src, pg_src);      if (RF_PAGE_ALIGNED(dest)) REMAP_VA(bp, dest, pg_dest);      if (!pg_src || !pg_dest) return(EFAULT);    }  }  while (src < end) {    *pg_dest++ ^=  *pg_src++;    src++; dest++; len--;    if (RF_PAGE_ALIGNED(src)) REMAP_VA(bp, src, pg_src);    if (RF_PAGE_ALIGNED(dest)) REMAP_VA(bp, dest, pg_dest);  }  RF_ASSERT(len == 0);  return(0);}/*   dst = a ^ b ^ c;   a may equal dst   see comment above longword_bxor*/int rf_longword_bxor3(dst,a,b,c,len, bp)  register unsigned long  *dst;  register unsigned long  *a;  register unsigned long  *b;  register unsigned long  *c;  int                      len; /* length in longwords */  void                    *bp;{  unsigned long a0,a1,a2,a3, b0,b1,b2,b3;  register unsigned long *pg_a, *pg_b, *pg_c, *pg_dst;    /* per-page source/dest pointers */  int longs_this_time;                                     /* # longs to xor in the current iteration */  char dst_is_a = 0;  REMAP_VA(bp, a, pg_a);  REMAP_VA(bp, b, pg_b);  REMAP_VA(bp, c, pg_c);  if (a == dst) {pg_dst = pg_a; dst_is_a = 1;} else { REMAP_VA(bp, dst, pg_dst); }    /* align dest to cache line.  Can't cross a pg boundary on dst here. */  while ((((unsigned long) pg_dst) & 0x1f)) {    *pg_dst++ = *pg_a++ ^ *pg_b++ ^ *pg_c++;    dst++; a++; b++; c++;    if (RF_PAGE_ALIGNED(a)) {REMAP_VA(bp, a, pg_a); if (!pg_a) return(EFAULT);}    if (RF_PAGE_ALIGNED(b)) {REMAP_VA(bp, a, pg_b); if (!pg_b) return(EFAULT);}    if (RF_PAGE_ALIGNED(c)) {REMAP_VA(bp, a, pg_c); if (!pg_c) return(EFAULT);}    len--;  }    while (len > 4 ) {    longs_this_time = RF_MIN(len, RF_MIN(RF_BLIP(a), RF_MIN(RF_BLIP(b), RF_MIN(RF_BLIP(c), RF_BLIP(dst)))) >> RF_LONGSHIFT);    a+= longs_this_time; b+= longs_this_time; c+= longs_this_time; dst+=longs_this_time; len-=longs_this_time;    while (longs_this_time >= 4) {      a0 = pg_a[0]; longs_this_time -= 4;            a1 = pg_a[1];      a2 = pg_a[2];            a3 = pg_a[3];  pg_a += 4;            b0 = pg_b[0];      b1 = pg_b[1];            b2 = pg_b[2];      b3 = pg_b[3];      /* start dual issue */      a0 ^= b0; b0 =  pg_c[0];            pg_b += 4;  a1 ^= b1;            a2 ^= b2; a3 ^= b3;            b1 =  pg_c[1]; a0 ^= b0;            b2 =  pg_c[2]; a1 ^= b1;            b3 =  pg_c[3]; a2 ^= b2;            pg_dst[0] = a0; a3 ^= b3;      pg_dst[1] = a1; pg_c += 4;      pg_dst[2] = a2;      pg_dst[3] = a3; pg_dst += 4;    }    while (longs_this_time > 0) {   /* cannot cross any page boundaries here */      *pg_dst++ = *pg_a++ ^ *pg_b++ ^ *pg_c++;      longs_this_time--;    }        if (len) {      if (RF_PAGE_ALIGNED(a)) {REMAP_VA(bp, a, pg_a); if (!pg_a) return(EFAULT); if (dst_is_a) pg_dst = pg_a;}      if (RF_PAGE_ALIGNED(b)) {REMAP_VA(bp, b, pg_b); if (!pg_b) return(EFAULT);}      if (RF_PAGE_ALIGNED(c)) {REMAP_VA(bp, c, pg_c); if (!pg_c) return(EFAULT);}      if (!dst_is_a) if (RF_PAGE_ALIGNED(dst)) {REMAP_VA(bp, dst, pg_dst); if (!pg_dst) return(EFAULT);}    }  }  while (len) {    *pg_dst++ = *pg_a++ ^ *pg_b++ ^ *pg_c++;    dst++; a++; b++; c++;    if (RF_PAGE_ALIGNED(a)) {REMAP_VA(bp, a, pg_a); if (!pg_a) return(EFAULT); if (dst_is_a) pg_dst = pg_a;}    if (RF_PAGE_ALIGNED(b)) {REMAP_VA(bp, b, pg_b); if (!pg_b) return(EFAULT);}    if (RF_PAGE_ALIGNED(c)) {REMAP_VA(bp, c, pg_c); if (!pg_c) return(EFAULT);}    if (!dst_is_a) if (RF_PAGE_ALIGNED(dst)) {REMAP_VA(bp, dst, pg_dst); if (!pg_dst) return(EFAULT);}    len--;  }  return(0);}int rf_bxor3(dst,a,b,c,len, bp)  register unsigned char  *dst;  register unsigned char  *a;  register unsigned char  *b;  register unsigned char  *c;  unsigned long            len;  void                    *bp;{	RF_ASSERT(((RF_UL(dst)|RF_UL(a)|RF_UL(b)|RF_UL(c)|len) & 0x7) == 0);	return(rf_longword_bxor3((unsigned long *)dst, (unsigned long *)a,		(unsigned long *)b, (unsigned long *)c, len>>RF_LONGSHIFT, bp));}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜三级一区二区三| 成人免费看黄yyy456| 欧美久久久久免费| 三级在线观看一区二区| 欧美日韩精品一区二区三区蜜桃| 五月婷婷综合在线| 精品少妇一区二区| 国产91富婆露脸刺激对白| 中文字幕在线观看一区| 在线精品视频小说1| 日本成人在线不卡视频| 久久久久久久久久久久电影| 成人av动漫网站| 亚洲午夜久久久久久久久电影院| 欧美一区二区三区播放老司机| 国内精品久久久久影院薰衣草| 国产精品美日韩| 欧美女孩性生活视频| 国产在线视视频有精品| 亚洲天堂网中文字| 9191成人精品久久| 国产成人综合亚洲网站| 一区免费观看视频| 欧美一区二区久久| 91丨九色porny丨蝌蚪| 日韩黄色免费电影| 中文字幕+乱码+中文字幕一区| 欧美日韩精品系列| 高清不卡在线观看av| 五月开心婷婷久久| 亚洲国产精品成人综合色在线婷婷| 欧美天天综合网| 国产69精品久久777的优势| 偷拍亚洲欧洲综合| 亚洲欧洲成人精品av97| 欧美一区二区美女| 色婷婷av一区二区| 国产馆精品极品| 日韩综合在线视频| 亚洲日本乱码在线观看| 久久午夜免费电影| 日韩一区二区三区视频在线观看| 91蝌蚪porny成人天涯| 精品一区二区在线免费观看| 亚洲综合视频网| 国产精品少妇自拍| 精品国产一区二区在线观看| 欧美天堂一区二区三区| av在线免费不卡| 久久99国产精品久久99果冻传媒| 一区二区成人在线视频| 国产精品午夜在线观看| 久久一夜天堂av一区二区三区| 欧美日韩成人在线| 欧美亚洲国产怡红院影院| 丁香五精品蜜臀久久久久99网站| 久久99在线观看| 日本v片在线高清不卡在线观看| 亚洲综合免费观看高清完整版在线 | 国产亚洲美州欧州综合国| 欧美一二三在线| 欧美日韩国产在线观看| 色偷偷88欧美精品久久久| 成人做爰69片免费看网站| 国产一区二区女| 老司机免费视频一区二区三区| 日韩电影免费一区| 天天操天天综合网| 婷婷综合在线观看| 日韩精品国产精品| 日韩电影一区二区三区四区| 午夜国产精品一区| 日韩va亚洲va欧美va久久| 天天av天天翘天天综合网| 亚洲国产一区二区视频| 亚洲自拍都市欧美小说| 亚洲妇女屁股眼交7| 午夜不卡av在线| 日韩精品欧美精品| 免费观看一级欧美片| 美日韩一级片在线观看| 国模无码大尺度一区二区三区| 久88久久88久久久| 国产精品资源在线| proumb性欧美在线观看| 99精品热视频| 欧美视频中文一区二区三区在线观看 | 欧美在线免费观看亚洲| 欧美日韩三级一区二区| 日韩欧美三级在线| 久久久久久久久久久久久夜| 亚洲国产精品成人久久综合一区| 中文字幕第一区二区| 亚洲精品亚洲人成人网在线播放| 夜夜精品视频一区二区| 日韩电影在线观看电影| 国产一区二区三区高清播放| 国产精品1024| 色成年激情久久综合| 欧美精品粉嫩高潮一区二区| 精品国产在天天线2019| 国产精品伦一区二区三级视频| 亚洲私人影院在线观看| 午夜亚洲国产au精品一区二区| 久久精品久久精品| 91小视频在线| 欧美午夜影院一区| 午夜久久久久久电影| 五月婷婷激情综合| 中文字幕一区二区三区视频| 亚洲免费看黄网站| 蜜桃一区二区三区在线| av电影在线观看不卡| 欧美日韩国产另类不卡| 国产亚洲一区字幕| 亚洲国产综合91精品麻豆| 国产一区二区三区不卡在线观看| 94色蜜桃网一区二区三区| 91精品国产高清一区二区三区蜜臀| 国产拍欧美日韩视频二区| 午夜欧美一区二区三区在线播放| 国模大尺度一区二区三区| 欧美在线色视频| 欧美极品另类videosde| 视频一区免费在线观看| 成人av电影在线| 日韩三级精品电影久久久| 亚洲女性喷水在线观看一区| 激情都市一区二区| 欧美影视一区在线| 国产精品久久久久久久久晋中 | 欧美日韩精品欧美日韩精品| 久久综合成人精品亚洲另类欧美| 欧美日韩一区视频| 国产午夜精品久久久久久久| 午夜精品成人在线| 91香蕉国产在线观看软件| 精品sm捆绑视频| 婷婷六月综合亚洲| 91在线视频18| 国产精品少妇自拍| 国精产品一区一区三区mba视频 | 免费成人美女在线观看| 色噜噜狠狠色综合中国| 欧美激情一区二区三区在线| 久久精品国产久精国产| 欧美日韩不卡在线| 亚洲图片欧美色图| 色综合 综合色| 国产精品国产自产拍高清av王其| 麻豆国产欧美日韩综合精品二区| 欧美色区777第一页| 亚洲男人的天堂一区二区| 国产成人99久久亚洲综合精品| 日韩精品一区二区三区三区免费 | 日韩精品中文字幕一区 | 久久激情五月激情| 欧美视频一区二区三区在线观看| 国产精品久久久久久久久晋中| 国产成人综合在线| 国产三级精品视频| 国产盗摄视频一区二区三区| 久久色.com| 国产一区二区网址| 久久这里都是精品| 国产寡妇亲子伦一区二区| 久久久久久一二三区| 国产专区综合网| 久久久www成人免费毛片麻豆| 精品中文字幕一区二区| 精品欧美一区二区久久| 寂寞少妇一区二区三区| 久久久www成人免费毛片麻豆| 国产激情偷乱视频一区二区三区| 久久久综合激的五月天| 国产+成+人+亚洲欧洲自线| 国产精品嫩草影院av蜜臀| www.av精品| 亚洲精品欧美二区三区中文字幕| 色偷偷久久人人79超碰人人澡| 一区二区三区91| 4438成人网| 国产精品资源在线看| 中文字幕精品一区二区三区精品| 成人黄色在线看| 一区av在线播放| 欧美一区二区三区思思人| 久久国内精品视频| 中文字幕高清一区| 在线看国产日韩| 麻豆国产一区二区| 国产精品免费看片| 欧美日韩小视频| 韩国三级在线一区| 午夜精品国产更新| 麻豆91免费看| 亚洲综合色自拍一区| 欧美高清www午色夜在线视频| 久久99最新地址| 亚洲欧美日韩国产成人精品影院|