irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsSubStructFileClosedir.cpp
Go to the documentation of this file.
1 
4 #include "miscServerFunct.hpp"
5 #include "dataObjOpr.hpp"
7 
8 // =-=-=-=-=-=-=-
10 
11 int
12 rsSubStructFileClosedir( rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp ) {
14  int remoteFlag;
15  int status;
16 
17  remoteFlag = resolveHost( &subStructFileClosedirInp->addr, &rodsServerHost );
18 
19  if ( remoteFlag == LOCAL_HOST ) {
20  status = _rsSubStructFileClosedir( rsComm, subStructFileClosedirInp );
21  }
22  else if ( remoteFlag == REMOTE_HOST ) {
23  status = remoteSubStructFileClosedir( rsComm, subStructFileClosedirInp,
25  }
26  else {
27  if ( remoteFlag < 0 ) {
28  return remoteFlag;
29  }
30  else {
32  "rsSubStructFileClosedir: resolveHost returned unrecognized value %d",
33  remoteFlag );
35  }
36  }
37 
38  return status;
39 }
40 
41 int
42 remoteSubStructFileClosedir( rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp,
44  int status;
45 
46  if ( rodsServerHost == NULL ) {
48  "remoteSubStructFileClosedir: Invalid rodsServerHost" );
50  }
51 
52  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
53  return status;
54  }
55 
56  status = rcSubStructFileClosedir( rodsServerHost->conn, subStructFileClosedirInp );
57 
58  if ( status < 0 ) {
60  "remoteSubStructFileClosedir: rcFileClosedir failed for fd %d",
61  subStructFileClosedirInp->fd );
62  }
63 
64  return status;
65 }
66 
68  subStructFileFdOprInp_t* _close_inp ) {
69  // =-=-=-=-=-=-=-
70  // create first class structured object
72  new irods::structured_object( *_close_inp ) );
73 
74  struct_obj->comm( _comm );
75  struct_obj->resc_hier( _close_inp->resc_hier );
76  struct_obj->file_descriptor( _close_inp->fd );
77 
78  // =-=-=-=-=-=-=-
79  // call abstrcated interface to close a file
80  irods::error closedir_err = fileClosedir( _comm, struct_obj );
81  if ( !closedir_err.ok() ) {
82  std::stringstream msg;
83  msg << "failed on call to fileClosedir for [";
84  msg << struct_obj->physical_path();
85  msg << "]";
86  irods::log( PASSMSG( msg.str(), closedir_err ) );
87  return closedir_err.code();
88 
89  }
90  else {
91  return closedir_err.code();
92 
93  }
94 
95 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
SubStructFileFdOpr::addr
rodsHostAddr_t addr
Definition: subStructFileRead.h:9
rsComm_t
Definition: rcConnect.h:145
rcSubStructFileClosedir
int rcSubStructFileClosedir(rcComm_t *conn, subStructFileFdOprInp_t *subStructFileClosedirInp)
Definition: rcSubStructFileClosedir.cpp:23
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
rsSubStructFileClosedir
int rsSubStructFileClosedir(rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp)
Definition: rsSubStructFileClosedir.cpp:12
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
SubStructFileFdOpr
Definition: subStructFileRead.h:8
irods::error::code
long long code() const
Definition: irods_error.cpp:194
_rsSubStructFileClosedir
int _rsSubStructFileClosedir(rsComm_t *_comm, subStructFileFdOprInp_t *_close_inp)
Definition: rsSubStructFileClosedir.cpp:67
remoteSubStructFileClosedir
int remoteSubStructFileClosedir(rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileClosedirInp, rodsServerHost_t *rodsServerHost)
Definition: rsSubStructFileClosedir.cpp:42
rsSubStructFileClosedir.hpp
irods::structured_object
Definition: irods_structured_object.hpp:15
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::log
void log(const error &)
Definition: irods_log.cpp:13
irods::structured_object_ptr
boost::shared_ptr< structured_object > structured_object_ptr
Definition: irods_structured_object.hpp:107
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
subStructFileClosedir.h
SubStructFileFdOpr::resc_hier
char resc_hier[(1024+64)]
Definition: subStructFileRead.h:13
SubStructFileFdOpr::fd
int fd
Definition: subStructFileRead.h:11
fileClosedir
irods::error fileClosedir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:392
rodsServerHost
Definition: rodsConnect.h:62
irods_structured_object.hpp
dataObjOpr.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375