00001
00002
00003 #include "structFileDriver.h"
00004 #include "subStructFileClosedir.h"
00005 #include "miscServerFunct.h"
00006 #include "dataObjOpr.h"
00007
00008 int
00009 rsSubStructFileClosedir (rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp)
00010 {
00011 rodsServerHost_t *rodsServerHost;
00012 int remoteFlag;
00013 int status;
00014
00015 remoteFlag = resolveHost (&subStructFileClosedirInp->addr, &rodsServerHost);
00016
00017 if (remoteFlag == LOCAL_HOST) {
00018 status = _rsSubStructFileClosedir (rsComm, subStructFileClosedirInp);
00019 } else if (remoteFlag == REMOTE_HOST) {
00020 status = remoteSubStructFileClosedir (rsComm, subStructFileClosedirInp,
00021 rodsServerHost);
00022 } else {
00023 if (remoteFlag < 0) {
00024 return (remoteFlag);
00025 } else {
00026 rodsLog (LOG_NOTICE,
00027 "rsSubStructFileClosedir: resolveHost returned unrecognized value %d",
00028 remoteFlag);
00029 return (SYS_UNRECOGNIZED_REMOTE_FLAG);
00030 }
00031 }
00032
00033 return (status);
00034 }
00035
00036 int
00037 remoteSubStructFileClosedir (rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp,
00038 rodsServerHost_t *rodsServerHost)
00039 {
00040 int status;
00041
00042 if (rodsServerHost == NULL) {
00043 rodsLog (LOG_NOTICE,
00044 "remoteSubStructFileClosedir: Invalid rodsServerHost");
00045 return SYS_INVALID_SERVER_HOST;
00046 }
00047
00048 if ((status = svrToSvrConnect (rsComm, rodsServerHost)) < 0) {
00049 return status;
00050 }
00051
00052 status = rcSubStructFileClosedir (rodsServerHost->conn, subStructFileClosedirInp);
00053
00054 if (status < 0) {
00055 rodsLog (LOG_NOTICE,
00056 "remoteSubStructFileClosedir: rcFileClosedir failed for fd %d",
00057 subStructFileClosedirInp->fd);
00058 }
00059
00060 return status;
00061 }
00062
00063 int
00064 _rsSubStructFileClosedir (rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp)
00065 {
00066 int status;
00067
00068 status = subStructFileClosedir (subStructFileClosedirInp->type, rsComm,
00069 subStructFileClosedirInp->fd);
00070
00071 return (status);
00072 }
00073