code: private void lockInodeInternal(Inode inode, LockMode mode) {
      Preconditions.checkState(!endsInInode());
      String lastEdgeName = ((EdgeEntry) lastEntry()).getEdge().getName();
      Preconditions.checkState(inode.getName().equals(lastEdgeName),
          "Expected to lock inode %s but locked inode %s", lastEdgeName, inode.getName());
  
      mLockedInodes.add(inode);
      mEntries.add(new InodeEntry(mInodeLockManager.lockInode(inode, mode), inode));
    }
docs: Locks the next inode without checking or updating the mode.
  
  @param inode the inode to lock
  @param mode the mode to lock in