code: private void verifyQuota(INode[] inodes, int nsQuotaStartPos, int dsQuotaStartPos,
        int endPos, long nsDelta, long dsDelta)
    throws QuotaExceededException {
      if (!ready) {
        // Do not check quota if edits log is still being processed
        return;
      }
      if (endPos >inodes.length) {
        endPos = inodes.length;
      }
      int i = endPos - 1;
      Assert.assertTrue("nsQuotaStartPos shall be less or equal than the dsQuotaStartPos",
          (nsQuotaStartPos <= dsQuotaStartPos));
      try {
        // check existing components in the path
        for(; i >= nsQuotaStartPos; i--) {
          if (inodes[i].isQuotaSet()) { // a directory with quota
            INodeDirectoryWithQuota node =(INodeDirectoryWithQuota)inodes[i];
            if (i >= dsQuotaStartPos) {
              // Verify both nsQuota and dsQuota
              node.verifyQuota(nsDelta, dsDelta);
            } else {
              // Verify the nsQuota only
              node.verifyQuota(nsDelta, 0);
            }
          }
        }
      } catch (QuotaExceededException e) {
        e.setPathName(getFullPathName(inodes, i));
        throw e;
      }
    }
docs: Verify quota for adding or moving a new INode with required
  namespace and diskspace to a given position.
  
  This functiuon assumes that the nsQuotaStartPos is less or equal than the dsQuotaStartPos
  
  @param inodes INodes corresponding to a path
  @param dsQuotaStartPos the start position where the NS quota needs to be updated
  @param dsQuotaStartPos the start position where the DS quota needs to be updated
  @param endPos the end position where the NS and DS quota need to be updated
  @param nsDelta needed namespace
  @param dsDelta needed diskspace
  @throws QuotaExceededException if quota limit is exceeded.