Skip to content

Commit

Permalink
Modified MountServer to use new export interface
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Marcionek <amarcionek@seven10storage.com>
  • Loading branch information
amarcionek committed Jun 21, 2019
1 parent 04a869d commit 143ed0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/org/dcache/nfs/v3/MountServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.stream.Collectors;

import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.ExportFile;
import org.dcache.nfs.ExportTable;
import org.dcache.nfs.FsExport;
import org.dcache.nfs.status.*;
import org.dcache.nfs.vfs.Inode;
Expand All @@ -58,7 +58,7 @@
public class MountServer extends mount_protServerStub {

private static final Logger _log = LoggerFactory.getLogger(MountServer.class);
private final ExportFile _exportFile;
private final ExportTable _exports;
private final Multimap<String, InetAddress> _mounts = HashMultimap.create();
private final VirtualFileSystem _vfs;

Expand All @@ -69,9 +69,9 @@ public class MountServer extends mount_protServerStub {
public final static int RPC_AUTH_GSS_KRB5I = 390004;
public final static int RPC_AUTH_GSS_KRB5P = 390005;

public MountServer(ExportFile exportFile, VirtualFileSystem fs) {
public MountServer(ExportTable exports, VirtualFileSystem fs) {
super();
_exportFile = exportFile;
_exports = exports;
_vfs = fs;
}

Expand All @@ -91,7 +91,7 @@ public mountres3 MOUNTPROC3_MNT_3(RpcCall call$, dirpath arg1) {
InetAddress remoteAddress = call$.getTransport().getRemoteSocketAddress().getAddress();
_log.debug("Mount request for: {}", mountPoint);

FsExport export = _exportFile.getExport(mountPoint, remoteAddress);
FsExport export = _exports.getExport(mountPoint, remoteAddress);
if (export == null) {
m.fhs_status = mountstat3.MNT3ERR_ACCES;
_log.info("Mount deny for: {}:{}", remoteAddress, mountPoint);
Expand Down Expand Up @@ -176,7 +176,7 @@ public exports MOUNTPROC3_EXPORT_3(RpcCall call$) {

eList.value = null;

Map<String, List<FsExport>> exports = _exportFile
Map<String, List<FsExport>> exports = _exports
.exports()
.collect(Collectors.groupingBy(FsExport::getPath));

Expand Down

0 comments on commit 143ed0e

Please sign in to comment.