Skip to content

Commit 02708e4

Browse files
committed
core: Undo optimization in FileTracker
to reduce the amount of changes in #162 We may also need the reference to Inode should we decide to call Vfs.close from here. Signed-off-by: Christian Kohlschütter <[email protected]>
1 parent c4510cf commit 02708e4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

core/src/main/java/org/dcache/nfs/v4/FileTracker.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ public OpenRecord addOpen(NFS4Client client, StateOwner owner, Inode inode, int
341341
stateid = state.stateid();
342342
OpenState openState = new OpenState(client, owner, stateid, shareAccess, shareDeny);
343343
opens.add(openState);
344-
Opaque fileIdKey = inode.getFileIdKey();
345-
state.addDisposeListener(s -> removeOpen(fileIdKey, stateid));
344+
state.addDisposeListener(s -> removeOpen(inode, stateid));
346345
stateid.bumpSeqid();
347346

348347
// we need to return copy to avoid modification by concurrent opens
@@ -532,10 +531,8 @@ public int getShareAccess(NFS4Client client, Inode inode, Opaque stateid)
532531
* @param stateid associated with the open.
533532
*/
534533
void removeOpen(Inode inode, stateid4 stateid) {
535-
removeOpen(inode.getFileIdKey(), stateid);
536-
}
537534

538-
void removeOpen(Opaque fileId, stateid4 stateid) {
535+
Opaque fileId = inode.getFileIdKey();
539536
Lock lock = filesLock.get(fileId);
540537
lock.lock();
541538
try {

0 commit comments

Comments
 (0)