|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2009 - 2021 Deutsches Elektronen-Synchroton, |
| 2 | + * Copyright (c) 2009 - 2024 Deutsches Elektronen-Synchroton, |
3 | 3 | * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
|
4 | 4 | *
|
5 | 5 | * This library is free software; you can redistribute it and/or modify
|
|
28 | 28 | import org.dcache.nfs.v4.xdr.CB_LAYOUTRECALL4args;
|
29 | 29 | import org.dcache.nfs.v4.xdr.CB_NOTIFY_DEVICEID4args;
|
30 | 30 | import org.dcache.nfs.v4.xdr.CB_OFFLOAD4args;
|
| 31 | +import org.dcache.nfs.v4.xdr.CB_RECALL4args; |
31 | 32 | import org.dcache.nfs.v4.xdr.CB_SEQUENCE4args;
|
32 | 33 | import org.dcache.nfs.v4.xdr.bitmap4;
|
33 | 34 | import org.dcache.nfs.v4.xdr.callback_sec_parms4;
|
@@ -189,14 +190,52 @@ public void cbLayoutRecallFsid() throws OncRpcException, IOException {
|
189 | 190 | opArgs.opcblayoutrecall = cbLayoutrecall;
|
190 | 191 |
|
191 | 192 | var slot = _clientSession.acquireSlot();
|
192 |
| - try{ |
| 193 | + try { |
193 | 194 | XdrAble args = generateCompound(slot,"cb_layout_recall_fs", opArgs);
|
194 | 195 | _rpc.call(nfs4_prot.CB_COMPOUND_1, args, new CB_COMPOUND4res());
|
195 | 196 | } finally {
|
196 | 197 | _clientSession.releaseSlot(slot);
|
197 | 198 | }
|
198 | 199 | }
|
199 | 200 |
|
| 201 | + /** |
| 202 | + * Recall file delegation from the client. |
| 203 | + * |
| 204 | + * @param fh file handle of the file |
| 205 | + * @param stateid stateid of the delegation |
| 206 | + * @param truncate true if the client should truncate the file |
| 207 | + * @throws OncRpcException if an RPC error occurs |
| 208 | + * @throws IOException if an I/O error occurs |
| 209 | + */ |
| 210 | + public void cbDelegationRecall(nfs_fh4 fh, stateid4 stateid, boolean truncate) throws OncRpcException, IOException { |
| 211 | + |
| 212 | + CB_RECALL4args cbDelegRecall = new CB_RECALL4args(); |
| 213 | + |
| 214 | + cbDelegRecall.stateid = stateid; |
| 215 | + cbDelegRecall.fh = fh; |
| 216 | + cbDelegRecall.truncate = truncate; |
| 217 | + |
| 218 | + nfs_cb_argop4 opArgs = new nfs_cb_argop4(); |
| 219 | + opArgs.argop = nfs_cb_opnum4.OP_CB_RECALL; |
| 220 | + opArgs.opcbrecall = cbDelegRecall; |
| 221 | + |
| 222 | + var slot = _clientSession.acquireSlot(); |
| 223 | + try { |
| 224 | + XdrAble args = generateCompound(slot,"cb_recall_delegation", opArgs); |
| 225 | + _rpc.call(nfs4_prot.CB_COMPOUND_1, args, new CB_COMPOUND4res()); |
| 226 | + } finally { |
| 227 | + _clientSession.releaseSlot(slot); |
| 228 | + } |
| 229 | + } |
| 230 | + |
| 231 | + /** |
| 232 | + * Recall pNFS layout from the client. |
| 233 | + * |
| 234 | + * @param fh file handle of the file |
| 235 | + * @param stateid stateid of the layout |
| 236 | + * @throws OncRpcException if an RPC error occurs |
| 237 | + * @throws IOException if an I/O error occurs |
| 238 | + */ |
200 | 239 | public void cbLayoutRecallFile(nfs_fh4 fh, stateid4 stateid) throws OncRpcException, IOException {
|
201 | 240 |
|
202 | 241 | CB_LAYOUTRECALL4args cbLayoutrecall = new CB_LAYOUTRECALL4args();
|
@@ -227,6 +266,13 @@ public void cbLayoutRecallFile(nfs_fh4 fh, stateid4 stateid) throws OncRpcExcept
|
227 | 266 | }
|
228 | 267 | }
|
229 | 268 |
|
| 269 | + /** |
| 270 | + * Notify the client that a device id has been added. |
| 271 | + * |
| 272 | + * @param id device id |
| 273 | + * @throws OncRpcException if an RPC error occurs |
| 274 | + * @throws IOException if an I/O error occurs |
| 275 | + */ |
230 | 276 | public void cbDeleteDevice(deviceid4 id) throws OncRpcException, IOException {
|
231 | 277 |
|
232 | 278 | CB_NOTIFY_DEVICEID4args cbDeleteDeciveId = new CB_NOTIFY_DEVICEID4args();
|
@@ -265,6 +311,14 @@ public void cbDeleteDevice(deviceid4 id) throws OncRpcException, IOException {
|
265 | 311 | }
|
266 | 312 | }
|
267 | 313 |
|
| 314 | + /** |
| 315 | + * Notify the client that offload copy has been completed. |
| 316 | + * |
| 317 | + * @param fh file handle of the file |
| 318 | + * @param stateid stateid of the file |
| 319 | + * @param response write response |
| 320 | + * @param status status of the offload |
| 321 | + */ |
268 | 322 | public void cbOffload(nfs_fh4 fh, stateid4 stateid, write_response4 response, int status) throws OncRpcException, IOException {
|
269 | 323 |
|
270 | 324 | CB_OFFLOAD4args copyOffload = new CB_OFFLOAD4args();
|
|
0 commit comments