code: public String[] getHardLinkedFiles(String src) throws IOException {
      byte[][] components = INode.getPathComponents(src);
      List<byte [][]> results = null;
      readLock();
      try {
        INodeFile inode = getFileINode(components);
        if (!exists(inode)) {
          throw new IOException(src + " does not exist");
        }
        if (inode instanceof INodeHardLinkFile) {
          HardLinkFileInfo info = ((INodeHardLinkFile) inode)
            .getHardLinkFileInfo();
          // Only get the list of names as byte arrays under the lock.
          results = new ArrayList<byte[][]>(info.getReferenceCnt());
          for (int i = 0; i < info.getReferenceCnt(); i++) {
            try {
              results.add(getINodeByteArray(info.getHardLinkedFile(i)));
            } catch (IOException ioe) {
              NameNode.LOG.info("Hardlink may have been deleted", ioe);
            }
          }
        } else {
          return new String[] {};
        }
      } finally {
        readUnlock();
      }
  
      // Convert byte arrays to strings outside the lock since this is expensive.
      String[] files = new String[results.size()-1];
      int size = 0;
      for (int i = 0; i < results.size(); i++) {
        String file = getFullPathName(results.get(i));
        if (!file.equals(src)) {
          if (size >= files.length) {
            throw new IOException(src + " is not part of the list of hardlinked "
                + "files! This is a serious bug!");
          }
          files[size++] = file;
        }
      }
      return files;
    }
docs: See {@link ClientProtocol#getHardLinkedFiles(String)}.