code: public void setPinned(RpcContext rpcContext, LockedInodePath inodePath, boolean pinned,
        long opTimeMs) throws FileDoesNotExistException, InvalidPathException {
      Preconditions.checkState(inodePath.getLockPattern().isWrite());
  
      Inode inode = inodePath.getInode();
  
      mState.applyAndJournal(rpcContext, UpdateInodeEntry.newBuilder()
          .setId(inode.getId())
          .setPinned(pinned)
          .setLastModificationTimeMs(opTimeMs)
          .build());
  
      if (inode.isDirectory()) {
        assert inode instanceof InodeDirectory;
        // inode is a directory. Set the pinned state for all children.
        for (Inode child : mInodeStore.getChildren(inode.asDirectory())) {
          try (LockedInodePath childPath =
              inodePath.lockChild(child, LockPattern.WRITE_INODE)) {
            // No need for additional locking since the parent is write-locked.
            setPinned(rpcContext, childPath, pinned, opTimeMs);
          }
        }
      }
    }
docs: Sets the pinned state of an inode. If the inode is a directory, the pinned state will be set
  recursively.
  
  @param rpcContext the rpc context
  @param inodePath the {@link LockedInodePath} to set the pinned state for
  @param pinned the pinned state to set for the inode (and possible descendants)
  @param opTimeMs the operation time
  @throws FileDoesNotExistException if inode does not exist