Skip to content

Commit 89df15c

Browse files
committed
nfs: add exception that matches FS4ERR_OFFLOAD_DENIED state
required by server-side copy support Acked-by: Paul Millar Target: master
1 parent cbe5d31 commit 89df15c

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

core/src/main/java/org/dcache/nfs/nfsstat.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2023 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
@@ -611,6 +611,8 @@ public static void throwIfNeeded(int errorCode) throws ChimeraNFSException {
611611
throw new NoXattrException();
612612
case nfsstat.NFSERR_XATTR2BIG:
613613
throw new XattrTooBigException();
614+
case nfsstat.NFS4ERR_OFFLOAD_DENIED:
615+
throw new OffloadDeniedExeption();
614616
default:
615617
throw new BadXdrException();
616618
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2023 Deutsches Elektronen-Synchroton,
3+
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
4+
*
5+
* This library is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU Library General Public License as
7+
* published by the Free Software Foundation; either version 2 of the
8+
* License, or (at your option) any later version.
9+
*
10+
* This library is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Library General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Library General Public
16+
* License along with this program (see the file COPYING.LIB for more
17+
* details); if not, write to the Free Software Foundation, Inc.,
18+
* 675 Mass Ave, Cambridge, MA 02139, USA.
19+
*/
20+
package org.dcache.nfs.status;
21+
22+
import static org.dcache.nfs.nfsstat.NFS4ERR_OFFLOAD_DENIED;
23+
24+
import org.dcache.nfs.ChimeraNFSException;
25+
26+
public class OffloadDeniedExeption extends ChimeraNFSException {
27+
28+
public OffloadDeniedExeption() {
29+
super(NFS4ERR_OFFLOAD_DENIED);
30+
}
31+
32+
public OffloadDeniedExeption(String msg) {
33+
super(NFS4ERR_OFFLOAD_DENIED, msg);
34+
}
35+
36+
public OffloadDeniedExeption(String msg, Throwable cause) {
37+
super(NFS4ERR_OFFLOAD_DENIED, msg, cause);
38+
}
39+
40+
public OffloadDeniedExeption(Throwable cause) {
41+
super(NFS4ERR_OFFLOAD_DENIED, cause);
42+
}
43+
}

0 commit comments

Comments
 (0)