code: public Optional<Scoped> tryAcquirePersistingLock(long inodeId) {
      AtomicBoolean lock = mPersistingLocks.getUnchecked(inodeId);
      if (lock.compareAndSet(false, true)) {
        return Optional.of(() -> lock.set(false));
      }
      return Optional.empty();
    }
docs: Tries to acquire a lock for persisting the specified inode id.
  
  @param inodeId the inode to acquire the lock for
  @return an optional wrapping a closure for releasing the lock on success, or Optional.empty if
  the lock is already taken