Skip to content

Commit 7d14d29

Browse files
authored
Merge pull request #87 from iterate-ch/bugfix/issue-86
Expose case sensitivity settings
2 parents 59550a9 + ae9e3d4 commit 7d14d29

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ static Optional<? extends XdrAble> fattr2xdr(int fattr, VirtualFileSystem fs, In
250250
case nfs4_prot.FATTR4_CANSETTIME:
251251
return Optional.of(new fattr4_cansettime(true));
252252
case nfs4_prot.FATTR4_CASE_INSENSITIVE:
253-
return Optional.of(new fattr4_case_insensitive(true));
253+
return Optional.of(new fattr4_case_insensitive(fs.getCaseInsensitive()));
254254
case nfs4_prot.FATTR4_CASE_PRESERVING:
255-
return Optional.of(new fattr4_case_preserving(true));
255+
return Optional.of(new fattr4_case_preserving(fs.getCasePreserving()));
256256
case nfs4_prot.FATTR4_CHOWN_RESTRICTED:
257257
return Optional.empty();
258258
case nfs4_prot.FATTR4_FILEID:

core/src/main/java/org/dcache/nfs/vfs/ForwardingFileSystem.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ public void setAcl(Inode inode, nfsace4[] acl) throws IOException {
140140
delegate().setAcl(inode, acl);
141141
}
142142

143+
@Override
144+
public boolean getCaseInsensitive() {
145+
return delegate().getCaseInsensitive();
146+
}
147+
148+
@Override
149+
public boolean getCasePreserving() {
150+
return delegate().getCasePreserving();
151+
}
152+
143153
@Override
144154
public boolean hasIOLayout(Inode inode) throws IOException {
145155
return delegate().hasIOLayout(inode);

core/src/main/java/org/dcache/nfs/vfs/VfsCache.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ public void setattr(Inode inode, Stat stat) throws IOException {
183183
invalidateStatCache(inode);
184184
}
185185

186+
@Override
187+
public boolean getCaseInsensitive() {
188+
return _inner.getCaseInsensitive();
189+
}
190+
191+
@Override
192+
public boolean getCasePreserving() {
193+
return _inner.getCasePreserving();
194+
}
195+
186196
/*
187197
Utility methods for cache manipulation.
188198
*/

core/src/main/java/org/dcache/nfs/vfs/VirtualFileSystem.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,18 @@ public interface VirtualFileSystem {
297297
*/
298298
NfsIdMapping getIdMapper();
299299

300+
/**
301+
* Determins if this file system is case insensitive.
302+
* @return
303+
*/
304+
boolean getCaseInsensitive();
305+
306+
/**
307+
* Determines if this case insensitive file system is case preserving.
308+
* @return
309+
*/
310+
boolean getCasePreserving();
311+
300312
/**
301313
* Object which represents write operation result.
302314
*/

core/src/test/java/org/dcache/nfs/vfs/DummyVFS.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,16 @@ public NfsIdMapping getIdMapper() {
583583
return _idMapper;
584584
}
585585

586+
@Override
587+
public boolean getCaseInsensitive() {
588+
return true;
589+
}
590+
591+
@Override
592+
public boolean getCasePreserving() {
593+
return true;
594+
}
595+
586596
@Override
587597
public byte[] getXattr(Inode inode, String attr) throws IOException {
588598
long inodeNumber = toInodeNumber(inode);

0 commit comments

Comments
 (0)