code: private void updateCount(INode[] inodes, int dsUpdateStartPos, int endPos,
                             long nsDelta, long dsDelta, boolean checkQuota)
    throws QuotaExceededException {
      if (!ready) {
        // still intializing. do not check or update quotas.
        return;
      }
      if (endPos > inodes.length) {
        endPos = inodes.length;
      }
      if (checkQuota) {
        verifyQuota(inodes, 0, dsUpdateStartPos, endPos, nsDelta, dsDelta);
      }
      for (int i = 0; i < endPos; i++) {
        if (inodes[i].isQuotaSet()) { // a directory with quota
          INodeDirectoryWithQuota node = (INodeDirectoryWithQuota) inodes[i];
          if (i >= dsUpdateStartPos) {
            node.updateNumItemsInTree(nsDelta, dsDelta);
          } else {
            node.updateNumItemsInTree(nsDelta, 0);
          }
          
        }
      }
    }
docs: Update NS quota of each inode with quota in the inodes array from the position 0 to
  the position of endPos.
  
  And update DS quota of each inode with quota in the inodes array from the position of
  dsUpdateStartPos to the position of endPos.
  
  Currently only HardLink operations use a dsUpdateStartPos that is non-zero
  and hence we have the special handling of DS quota,
  but for NS quota we always assume 0.
  
  @param inodes an array of inodes on a path
  @param dsUpdateStartPos The start position to update the DS quota
  @param endPos the endPos of inodes to update the both NS and DS quota
  @param nsDelta the delta change of namespace
  @param dsDelta the delta change of diskspace
  @param checkQuota if true then check if quota is exceeded
  @throws QuotaExceededException if the new count violates any quota limit