Commit 03c7147c authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs4: add xattr related operation stubs

Motivation:
Before nfs server can fully support extended attributes, the related operations
sold be accepted by the server.

Modification:
Implement xattr related operation stubs that currently do nothing.

Result:
ground work for xattr support

Acked-by: Lea Morschel
Target: master
parent 6eaebcd9
......@@ -147,6 +147,14 @@ public class MDSOperationExecutor extends AbstractOperationExecutor {
return new OperationFREE_STATEID(op);
case nfs_opnum4.OP_TEST_STATEID:
return new OperationTEST_STATEID(op);
case nfs_opnum4.OP_GETXATTR:
return new OperationGETXATTR(op);
case nfs_opnum4.OP_SETXATTR:
return new OperationSETXATTR(op);
case nfs_opnum4.OP_LISTXATTRS:
return new OperationLISTXATTRS(op);
case nfs_opnum4.OP_REMOVEXATTR:
return new OperationREMOVEXATTR(op);
case nfs_opnum4.OP_ILLEGAL:
}
......
/*
* Copyright (c) 2019 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.v4;
import java.io.IOException;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.NotSuppException;
import org.dcache.nfs.v4.xdr.nfs_argop4;
import org.dcache.nfs.v4.xdr.nfs_opnum4;
import org.dcache.nfs.v4.xdr.nfs_resop4;
import org.dcache.oncrpc4j.rpc.OncRpcException;
public class OperationGETXATTR extends AbstractNFSv4Operation {
public OperationGETXATTR(nfs_argop4 args) {
super(args, nfs_opnum4.OP_GETXATTR);
}
@Override
public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNFSException, IOException, OncRpcException {
throw new NotSuppException("Not implemented yet.");
}
}
/*
* Copyright (c) 2019 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.v4;
import java.io.IOException;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.NotSuppException;
import org.dcache.nfs.v4.xdr.nfs_argop4;
import org.dcache.nfs.v4.xdr.nfs_opnum4;
import org.dcache.nfs.v4.xdr.nfs_resop4;
import org.dcache.oncrpc4j.rpc.OncRpcException;
public class OperationLISTXATTRS extends AbstractNFSv4Operation {
public OperationLISTXATTRS(nfs_argop4 args) {
super(args, nfs_opnum4.OP_LISTXATTRS);
}
@Override
public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNFSException, IOException, OncRpcException {
throw new NotSuppException("Not implemented yet.");
}
}
/*
* Copyright (c) 2019 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.v4;
import java.io.IOException;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.NotSuppException;
import org.dcache.nfs.v4.xdr.nfs_argop4;
import org.dcache.nfs.v4.xdr.nfs_opnum4;
import org.dcache.nfs.v4.xdr.nfs_resop4;
import org.dcache.oncrpc4j.rpc.OncRpcException;
public class OperationREMOVEXATTR extends AbstractNFSv4Operation {
public OperationREMOVEXATTR(nfs_argop4 args) {
super(args, nfs_opnum4.OP_REMOVEXATTR);
}
@Override
public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNFSException, IOException, OncRpcException {
throw new NotSuppException("Not implemented yet.");
}
}
/*
* Copyright (c) 2019 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.v4;
import java.io.IOException;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.NotSuppException;
import org.dcache.nfs.v4.xdr.nfs_argop4;
import org.dcache.nfs.v4.xdr.nfs_opnum4;
import org.dcache.nfs.v4.xdr.nfs_resop4;
import org.dcache.oncrpc4j.rpc.OncRpcException;
public class OperationSETXATTR extends AbstractNFSv4Operation {
public OperationSETXATTR(nfs_argop4 args) {
super(args, nfs_opnum4.OP_SETXATTR);
}
@Override
public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNFSException, IOException, OncRpcException {
throw new NotSuppException("Not implemented yet.");
}
}
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class GETXATTR4args implements XdrAble {
public String gxa_name;
public GETXATTR4args() {
}
public GETXATTR4args(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeString(gxa_name);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
gxa_name = xdr.xdrDecodeString();
}
}
// End of GETXATTR4args.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.nfs.nfsstat;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.rpc.net.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class GETXATTR4res implements XdrAble {
public int gxr_status;
public xattrvalue4 gxr_value;
public GETXATTR4res() {
}
public GETXATTR4res(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeInt(gxr_status);
if(gxr_status == nfsstat.NFS_OK) {
gxr_value.xdrEncode(xdr);
}
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
gxr_status = xdr.xdrDecodeInt();
if(gxr_status == nfsstat.NFS_OK) {
gxr_value = new xattrvalue4(xdr);
}
}
}
// End of GETXATTR4res.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.rpc.net.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class LISTXATTRS4args implements XdrAble {
public nfs_cookie4 lxa_cookie;
public count4 lxa_maxcount;
public LISTXATTRS4args() {
}
public LISTXATTRS4args(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
lxa_cookie.xdrEncode(xdr);
lxa_maxcount.xdrEncode(xdr);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
lxa_cookie = new nfs_cookie4(xdr);
lxa_maxcount = new count4(xdr);
}
}
// End of LISTXATTRS4args.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.nfs.nfsstat;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.rpc.net.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class LISTXATTRS4res implements XdrAble {
public int lxr_status;
public LISTXATTRS4resok lxr_value;
public LISTXATTRS4res() {
}
public LISTXATTRS4res(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeInt(lxr_status);
if (lxr_status == nfsstat.NFS_OK) {
lxr_value.xdrEncode(xdr);
}
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
lxr_status = xdr.xdrDecodeInt();
if (lxr_status == nfsstat.NFS_OK) {
lxr_value = new LISTXATTRS4resok(xdr);
}
}
}
// End of LISTXATTRS4res.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class LISTXATTRS4resok implements XdrAble {
public nfs_cookie4 lxr_cookie;
public String [] lxr_names;
public boolean lxr_eof;
public LISTXATTRS4resok() {
}
public LISTXATTRS4resok(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
lxr_cookie.xdrEncode(xdr);
{ int $size = lxr_names.length; xdr.xdrEncodeInt($size); for ( int $idx = 0; $idx < $size; ++$idx ) { xdr.xdrEncodeString(lxr_names[$idx]); } }
xdr.xdrEncodeBoolean(lxr_eof);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
lxr_cookie = new nfs_cookie4(xdr);
{ int $size = xdr.xdrDecodeInt(); lxr_names = new String[$size]; for ( int $idx = 0; $idx < $size; ++$idx ) { lxr_names[$idx] = xdr.xdrDecodeString(); } }
lxr_eof = xdr.xdrDecodeBoolean();
}
}
// End of LISTXATTRS4resok.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class REMOVEXATTR4args implements XdrAble {
public String rxa_name;
public REMOVEXATTR4args() {
}
public REMOVEXATTR4args(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeString(rxa_name);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
rxa_name = xdr.xdrDecodeString();
}
}
// End of REMOVEXATTR4args.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.rpc.net.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class REMOVEXATTR4res implements XdrAble {
public int rxr_status;
public change_info4 rxr_info;
public REMOVEXATTR4res() {
}
public REMOVEXATTR4res(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeInt(rxr_status);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
rxr_status = xdr.xdrDecodeInt();
}
}
// End of REMOVEXATTR4res.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class SETXATTR4args implements XdrAble {
public int sxa_option;
public String sxa_name;
public xattrvalue4 sxa_value;
public SETXATTR4args() {
}
public SETXATTR4args(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeInt(sxa_option);
xdr.xdrEncodeString(sxa_name);
sxa_value.xdrEncode(xdr);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
sxa_option = xdr.xdrDecodeInt();
sxa_name = xdr.xdrDecodeString();
sxa_value = new xattrvalue4(xdr);
}
}
// End of SETXATTR4args.java
/*
* Automatically generated by jrpcgen 1.0.7+ on 11/1/19, 1:52 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*
* This version of jrpcgen adopted by dCache project
* See http://www.dCache.ORG for details
*/
package org.dcache.nfs.v4.xdr;
import org.dcache.oncrpc4j.rpc.*;
import org.dcache.oncrpc4j.rpc.net.*;
import org.dcache.oncrpc4j.xdr.*;
import java.io.IOException;
public class SETXATTR4res implements XdrAble {
public int sxr_status;
public change_info4 sxr_info;
public SETXATTR4res() {
}
public SETXATTR4res(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
xdr.xdrEncodeInt(sxr_status);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
sxr_status = xdr.xdrDecodeInt();
}
}
// End of SETXATTR4res.java
......@@ -126,6 +126,10 @@ public class nfs_argop4 implements XdrAble {
public WANT_DELEGATION4args opwant_delegation;
public DESTROY_CLIENTID4args opdestroy_clientid;
public RECLAIM_COMPLETE4args opreclaim_complete;
public GETXATTR4args opgetxattr;
public SETXATTR4args opsetxattr;
public LISTXATTRS4args oplistxattrs;
public REMOVEXATTR4args opremovexattr;
public nfs_argop4() {
}
......@@ -306,6 +310,18 @@ public class nfs_argop4 implements XdrAble {
case nfs_opnum4.OP_RECLAIM_COMPLETE:
opreclaim_complete.xdrEncode(xdr);
break;
case nfs_opnum4.OP_GETXATTR:
opgetxattr.xdrEncode(xdr);
break;
case nfs_opnum4.OP_SETXATTR:
opsetxattr.xdrEncode(xdr);
break;
case nfs_opnum4.OP_LISTXATTRS:
oplistxattrs.xdrEncode(xdr);
break;
case nfs_opnum4.OP_REMOVEXATTR:
opremovexattr.xdrEncode(xdr);
break;
case nfs_opnum4.OP_ILLEGAL:
break;
}
......@@ -482,6 +498,18 @@ public class nfs_argop4 implements XdrAble {
case nfs_opnum4.OP_RECLAIM_COMPLETE:
opreclaim_complete = new RECLAIM_COMPLETE4args(xdr);
break;
case nfs_opnum4.OP_GETXATTR: