Skip to content

Commit e042266

Browse files
committed
nfs4: drop hard-coded layout type on recall
Motivation: the pNFS server might issue a layout type that not match the hardcoded one that is used by recall, thus, there should be a possibility to specify layout type by recall. Modification: Update ClientCB#cbLayoutRecallFile to accept layout type. Result: flexibility that allows to recall the correct file layout. Acked-by: Paul Millar Target: master
1 parent f64f308 commit e042266

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

API-changes.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to NFS4J public API
22

3+
## 0.27
4+
5+
- change the signature of `ClientCB#cbLayoutRecallFile` to accept layout type.
6+
37
## 0.24
48

59
- update org.dcache.nfs.util.Cache and org.dcache.nfs.v4.NFSv4StateHandler to use java.time.Duration instead of a _long in millis_ to describe various amounts of time.

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2024 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2025 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -233,14 +233,15 @@ public void cbDelegationRecall(nfs_fh4 fh, stateid4 stateid, boolean truncate) t
233233
*
234234
* @param fh file handle of the file
235235
* @param stateid stateid of the layout
236+
* @param layouttype type of layout to recall
236237
* @throws OncRpcException if an RPC error occurs
237238
* @throws IOException if an I/O error occurs
238239
*/
239-
public void cbLayoutRecallFile(nfs_fh4 fh, stateid4 stateid) throws OncRpcException, IOException {
240+
public void cbLayoutRecallFile(nfs_fh4 fh, stateid4 stateid, layouttype4 layouttype) throws OncRpcException, IOException {
240241

241242
CB_LAYOUTRECALL4args cbLayoutrecall = new CB_LAYOUTRECALL4args();
242243
cbLayoutrecall.clora_changed = true;
243-
cbLayoutrecall.clora_type = layouttype4.LAYOUT4_NFSV4_1_FILES.getValue();
244+
cbLayoutrecall.clora_type = layouttype.getValue();
244245
cbLayoutrecall.clora_iomode = layoutiomode4.LAYOUTIOMODE4_ANY;
245246
cbLayoutrecall.clora_recall = new layoutrecall4();
246247
cbLayoutrecall.clora_recall.lor_recalltype = layoutrecall_type4.LAYOUTRECALL4_FILE;

0 commit comments

Comments
 (0)