public class InodeLockManager extends Object
Modifier and Type | Field and Description |
---|---|
LockPool<Edge> |
mEdgeLocks
Cache for supplying edge locks, similar to mInodeLocks.
|
LockPool<Long> |
mInodeLocks
Pool for supplying inode locks.
|
Constructor and Description |
---|
InodeLockManager() |
Modifier and Type | Method and Description |
---|---|
void |
assertAllLocksReleased()
Asserts that all locks have been released, throwing an exception if any locks are still taken.
|
LockResource |
lockEdge(Edge edge,
LockMode mode)
Acquires an edge lock.
|
LockResource |
lockInode(InodeView inode,
LockMode mode)
Acquires an inode lock.
|
LockResource |
lockUpdate(long inodeId)
Acquires the lock for modifying an inode's last modified time or size.
|
Optional<Scoped> |
tryAcquirePersistingLock(long inodeId)
Tries to acquire a lock for persisting the specified inode id.
|
Optional<LockResource> |
tryLockEdge(Edge edge,
LockMode mode)
Attempts to acquire an edge lock.
|
Optional<LockResource> |
tryLockInode(Long inodeId,
LockMode mode)
Attempts to acquire an inode lock.
|
public final LockPool<Long> mInodeLocks
public void assertAllLocksReleased()
public LockResource lockInode(InodeView inode, LockMode mode)
inode
- the inode to lockmode
- the mode to lock inpublic Optional<LockResource> tryLockInode(Long inodeId, LockMode mode)
inodeId
- the inode id to try lockingmode
- the mode to lock inpublic LockResource lockEdge(Edge edge, LockMode mode)
edge
- the edge to lockmode
- the mode to lock inpublic Optional<LockResource> tryLockEdge(Edge edge, LockMode mode)
edge
- the edge to try lockingmode
- the mode to lock inpublic Optional<Scoped> tryAcquirePersistingLock(long inodeId)
inodeId
- the inode to acquire the lock forpublic LockResource lockUpdate(long inodeId)
inodeId
- the id of the inode to lockCopyright © 2023. All Rights Reserved.