void IOBuf::unshareChained() {
  // unshareChained() should only be called if we are part of a chain of
  // multiple IOBufs.  The caller should have already verified this.
  assert(isChained());

  IOBuf* current = this;
  while (true) {
    if (current->isSharedOne()) {
      // we have to unshare
      break;
    }

    current = current->next_;
    if (current == this) {
      // None of the IOBufs in the chain are shared,
      // so return without doing anything
      return;
    }
  }

  // We have to unshare.  Let coalesceSlow() do the work.
  coalesceSlow();
}
void IOBuf::unshareChained() {
   
   
  assert(isChained());

  IOBuf* current = this;
  while (true) {
    if (current->isSharedOne()) {
       
      break;
    }

    current = current->next_;
    if (current == this) {
       
       
      return;
    }
  }

   
  coalesceSlow();
}