code: private int verifyQuotaForHardLink(INode[] srcInodes, INode[] dstInodes)
    throws QuotaExceededException {
      if (!ready) {
        // Do not check quota if edits log is still being processed
        return 0;
      }
      Set<INode> ancestorSet = null;  
      INode srcInode = srcInodes[srcInodes.length - 1]; 
      int minLength = Math.min(srcInodes.length, dstInodes.length); 
      int nonCommonAncestor;
      
      // Get the counts from the src file
      INode.DirCounts counts = new INode.DirCounts(); 
      srcInode.spaceConsumedInTree(counts); 
        
      if (srcInode instanceof INodeHardLinkFile) {
        // handle the hardlink file 
        INodeHardLinkFile srcHardLinkFile = (INodeHardLinkFile) srcInode; 
        ancestorSet = srcHardLinkFile.getAncestorSet(); 
        for (nonCommonAncestor = 0; nonCommonAncestor < minLength; nonCommonAncestor++) { 
          if (!ancestorSet.contains(dstInodes[nonCommonAncestor])) {  
            break;
          } 
        }
      } else {
        // handle the regular file  
        for (nonCommonAncestor = 0; nonCommonAncestor < minLength; nonCommonAncestor++) { 
          if (srcInodes[nonCommonAncestor] != dstInodes[nonCommonAncestor]) { 
            break;  
          } 
        } 
      }
      // Verify the NS quota from the beginning and verify the DS quota from the 1st nonCommonAncestor
      verifyQuota(dstInodes, 0, nonCommonAncestor, dstInodes.length - 1,  
          counts.getNsCount(), counts.getDsCount());
      
      return nonCommonAncestor;
    }
docs: Verify quota for the hardlink operation where srcInodes[srcInodes.length-1] copies to
  dstInodes[dstInodes.length-1]
  
  @param srcInodes directory from where node is being moved.
  @param dstInodes directory to where node is moved to.
  @throws QuotaExceededException if quota limit is exceeded.