public void downgradeLastInode ( ) { Preconditions . checkState ( endsInInode ( ) ) ; Preconditions . checkState ( ! mEntries . isEmpty ( ) ) ; Preconditions . checkState ( mLockMode == LockMode . WRITE ) ; InodeEntry last = ( InodeEntry ) mEntries . get ( mEntries . size ( ) - 1 ) ; LockResource lock = mInodeLockManager . lockInode ( last . getInode ( ) , LockMode . READ ) ; last . getLock ( ) . close ( ) ; mEntries . set ( mEntries . size ( ) - 1 , new InodeEntry ( lock , last . mInode ) ) ; mLockMode = LockMode . READ ; }
Downgrades the last inode from a write lock to a read lock . The read lock is acquired before releasing the write lock .