code: private <T extends INode> T addChild(INode[] pathComponents, int startPos, int endPos,
        T child, long childDiskspace, boolean inheritPermission,
        boolean checkQuota) throws QuotaExceededException {
      INode.DirCounts counts = new INode.DirCounts();
      child.spaceConsumedInTree(counts);
      if (childDiskspace < 0) {
        childDiskspace = counts.getDsCount();
      }
      updateCount(pathComponents, startPos, endPos, counts.getNsCount(), childDiskspace,
          checkQuota);
      T addedNode = null;
      try {
        addedNode = ((INodeDirectory) pathComponents[endPos - 1]).addChild(child,
            inheritPermission);
      } finally {
        if (addedNode == null) {
          updateCount(pathComponents, startPos, endPos, -counts.getNsCount(),
              -childDiskspace, true);
        } else {
          inodeMap.put(addedNode);
        }
      }
      return addedNode;
    }
docs: Add a node child to the inodes at index pos.
  Its ancestors are stored at [startPos, endPos-1].
  QuotaExceededException is thrown if it violates quota limit