Skip to content

Commit

Permalink
nfs: add exception that matches FS4ERR_OFFLOAD_DENIED state
Browse files Browse the repository at this point in the history
required by server-side copy support

Acked-by: Paul Millar
Target: master
  • Loading branch information
kofemann committed Feb 9, 2023
1 parent cbe5d31 commit 89df15c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/dcache/nfs/nfsstat.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
* Copyright (c) 2009 - 2023 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
*
* This library is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -611,6 +611,8 @@ public static void throwIfNeeded(int errorCode) throws ChimeraNFSException {
throw new NoXattrException();
case nfsstat.NFSERR_XATTR2BIG:
throw new XattrTooBigException();
case nfsstat.NFS4ERR_OFFLOAD_DENIED:
throw new OffloadDeniedExeption();
default:
throw new BadXdrException();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.dcache.nfs.status;

import static org.dcache.nfs.nfsstat.NFS4ERR_OFFLOAD_DENIED;

import org.dcache.nfs.ChimeraNFSException;

public class OffloadDeniedExeption extends ChimeraNFSException {

public OffloadDeniedExeption() {
super(NFS4ERR_OFFLOAD_DENIED);
}

public OffloadDeniedExeption(String msg) {
super(NFS4ERR_OFFLOAD_DENIED, msg);
}

public OffloadDeniedExeption(String msg, Throwable cause) {
super(NFS4ERR_OFFLOAD_DENIED, msg, cause);
}

public OffloadDeniedExeption(Throwable cause) {
super(NFS4ERR_OFFLOAD_DENIED, cause);
}
}

0 comments on commit 89df15c

Please sign in to comment.