Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
nfs4j
Commits
a4286b13
Commit
a4286b13
authored
Dec 19, 2011
by
Tigran Mkrtchyan
☕
Browse files
nfsv41: introduce current state id
process current state id on save/restore current file handle
parent
a3b00ed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/org/dcache/chimera/nfs/v4/CompoundContext.java
View file @
a4286b13
...
...
@@ -31,6 +31,7 @@ import java.util.List;
import
org.dcache.chimera.nfs.vfs.Inode
;
import
org.dcache.chimera.nfs.NfsUser
;
import
org.dcache.chimera.nfs.v4.xdr.server_owner4
;
import
org.dcache.chimera.nfs.v4.xdr.stateid4
;
import
org.dcache.chimera.nfs.v4.xdr.uint64_t
;
import
org.dcache.chimera.nfs.vfs.VirtualFileSystem
;
...
...
@@ -59,6 +60,8 @@ public class CompoundContext {
private
boolean
_cacheThis
;
private
final
int
_totalOperationsCount
;
private
int
_currentOpPosition
=
-
1
;
private
stateid4
_currentStateid
=
null
;
private
stateid4
_savedStateid
=
null
;
/**
* Create context of COUMPOUND request.
...
...
@@ -167,6 +170,7 @@ public class CompoundContext {
throw
new
ChimeraNFSException
(
nfsstat
.
NFSERR_RESTOREFH
,
"no saved file handle"
);
}
_currentInode
=
_savedInode
;
_currentStateid
=
_savedStateid
;
_log
.
debug
(
"restored Inode: {}"
,
_currentInode
);
}
...
...
@@ -188,6 +192,7 @@ public class CompoundContext {
throw
new
ChimeraNFSException
(
nfsstat
.
NFSERR_NOFILEHANDLE
,
"no file handle"
);
}
_savedInode
=
_currentInode
;
_savedStateid
=
_currentStateid
;
_log
.
debug
(
"saved Inode: {}"
,
_savedInode
);
}
...
...
@@ -254,6 +259,16 @@ public class CompoundContext {
_currentOpPosition
++;
}
public
stateid4
currentStateid
()
throws
ChimeraNFSException
{
if
(
_currentStateid
==
null
)
throw
new
ChimeraNFSException
(
nfsstat
.
NFSERR_BAD_STATEID
,
"no current stateid"
);
return
_currentStateid
;
}
public
void
currentStateid
(
stateid4
currentStateid
)
{
_currentStateid
=
currentStateid
;
}
public
ServerIdProvider
getServerIdProvider
()
{
// FIXME: bond to file system and DS
return
new
ServerIdProvider
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment