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)  

rsDataObjCreate.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See dataObjCreate.h for a description of this API call.*/
5 
6 #include "dataObjCreate.h"
7 #include "dataObjCreateAndStat.h"
8 #include "dataObjOpen.h"
9 #include "fileCreate.h"
10 #include "subStructFileCreate.h"
11 #include "rodsLog.h"
12 #include "objMetaOpr.hpp"
13 #include "resource.hpp"
14 #include "specColl.hpp"
15 #include "dataObjOpr.hpp"
16 #include "physPath.hpp"
17 #include "dataObjUnlink.h"
18 #include "dataObjLock.h"
19 #include "regDataObj.h"
20 #include "rcGlobalExtern.h"
21 #include "getRemoteZoneResc.h"
22 #include "getRescQuota.h"
24 #include "rsDataObjCreate.hpp"
25 #include "apiNumber.h"
26 #include "rsObjStat.hpp"
27 #include "rsDataObjOpen.hpp"
28 #include "rsRegDataObj.hpp"
29 #include "rsDataObjUnlink.hpp"
31 #include "rsFileCreate.hpp"
32 #include "rsGetRescQuota.hpp"
33 #include "rsUnregDataObj.hpp"
34 
36 
37 // =-=-=-=-=-=-=-
42 
43 namespace {
44  int register_and_create_data_object(
45  rsComm_t *rsComm,
46  int l1descInx) {
47  dataObjInfo_t* myDataObjInfo = L1desc[l1descInx].dataObjInfo;
48 
49  int status = svrRegDataObj(rsComm, myDataObjInfo);
50  if ( status < 0 ) {
52  "%s: rsRegDataObj for %s failed, status = %d",
53  __FUNCTION__, myDataObjInfo->objPath, status );
54  return status;
55  }
56 
57  myDataObjInfo->replNum = status;
58  status = dataCreate(rsComm, l1descInx);
59  if (status < 0) {
60  l3Unlink(rsComm, myDataObjInfo);
61  unregDataObj_t inp{};
62  inp.dataObjInfo = myDataObjInfo;
63  rsUnregDataObj(rsComm, &inp);
64  }
65  return status;
66  }
67 } // anonymous namespace
68 
69 /* rsDataObjCreate - handle dataObj create request.
70  *
71  * The NO_OPEN_FLAG_KW in condInput specifies that no physical create
72  * and registration will be done.
73  *
74  * return value - > 2 - success with phy open
75  * < 0 - failure
76  */
77 int rsDataObjCreate(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
78 {
79  if (has_trailing_path_separator(dataObjInp->objPath)) {
80  return USER_INPUT_PATH_ERR;
81  }
82 
83  int l1descInx;
84  int status;
85  rodsObjStat_t *rodsObjStatOut = NULL;
86  int remoteFlag;
88  specCollCache_t *specCollCache = NULL;
89  char *lockType = NULL; // JMC - backport 4604
90  int lockFd = -1; // JMC - backport 4604
91 
92  irods::error ret = validate_logical_path( dataObjInp->objPath );
93  if( !ret.ok() ) {
94  irods::log( PASS( ret ) );
95  return ret.code();
96  }
97 
98  resolveLinkedPath( rsComm, dataObjInp->objPath, &specCollCache,
99  &dataObjInp->condInput );
100  remoteFlag = getAndConnRemoteZone( rsComm, dataObjInp, &rodsServerHost,
101  REMOTE_CREATE );
102  if ( remoteFlag < 0 ) {
103  return remoteFlag;
104  }
105  else if ( remoteFlag == REMOTE_HOST ) {
106  openStat_t *openStat = NULL;
107  addKeyVal( &dataObjInp->condInput, CROSS_ZONE_CREATE_KW, "" );
108  status = rcDataObjCreateAndStat( rodsServerHost->conn, dataObjInp, &openStat );
109 
110  /* rm it to avoid confusion */
111  rmKeyVal( &dataObjInp->condInput, CROSS_ZONE_CREATE_KW );
112  if ( status < 0 ) {
113  return status;
114  }
115  l1descInx = allocAndSetL1descForZoneOpr( status, dataObjInp, rodsServerHost, openStat );
116 
117  if ( openStat != NULL ) {
118  free( openStat );
119  }
120  return l1descInx;
121  }
122 
123  // =-=-=-=-=-=-=-
124  // working on the "home zone", determine if we need to redirect to a different
125  // server in this zone for this operation. if there is a RESC_HIER_STR_KW then
126  // we know that the redirection decision has already been made
127  char* resc_hier = getValByKey( &dataObjInp->condInput, RESC_HIER_STR_KW );
128  if ( NULL == resc_hier ) {
129  std::string hier;
131  dataObjInp, hier );
132  if ( !ret.ok() ) {
133  std::stringstream msg;
134  msg << "failed in irods::resolve_resource_hierarchy for [";
135  msg << dataObjInp->objPath << "]";
136  irods::log( PASSMSG( msg.str(), ret ) );
137  return ret.code();
138  }
139 
140  // =-=-=-=-=-=-=-
141  // we resolved the redirect and have a host, set the hier str for subsequent
142  // api calls, etc.
143  addKeyVal( &dataObjInp->condInput, RESC_HIER_STR_KW, hier.c_str() );
144 
145  } // if keyword
146 
147  // =-=-=-=-=-=-=-
148  // JMC - backport 4604
149  lockType = getValByKey( &dataObjInp->condInput, LOCK_TYPE_KW );
150  if ( lockType != NULL ) {
151  lockFd = irods::server_api_call(
153  rsComm,
154  dataObjInp,
155  NULL,
156  ( void** ) NULL,
157  NULL );
158  if ( lockFd >= 0 ) {
159  /* rm it so it won't be done again causing deadlock */
160  rmKeyVal( &dataObjInp->condInput, LOCK_TYPE_KW );
161  }
162  else {
163  rodsLogError( LOG_ERROR, lockFd,
164  "rsDataObjCreate: lock error for %s. lockType = %s",
165  dataObjInp->objPath, lockType );
166  return lockFd;
167  }
168  }
169 
170  // =-=-=-=-=-=-=-
171  // Gets here means local zone operation stat dataObj
172  addKeyVal( &dataObjInp->condInput, SEL_OBJ_TYPE_KW, "dataObj" );
173 
174  status = rsObjStat( rsComm, dataObjInp, &rodsObjStatOut );
175 
176  if ( rodsObjStatOut != NULL && rodsObjStatOut->objType == COLL_OBJ_T ) {
177  if ( lockFd >= 0 ) {
178  char fd_string[NAME_LEN];
179  snprintf( fd_string, sizeof( fd_string ), "%-d", lockFd );
180  addKeyVal( &dataObjInp->condInput, LOCK_FD_KW, fd_string );
183  rsComm,
184  dataObjInp,
185  NULL,
186  ( void** ) NULL,
187  NULL );
188  }
189  freeRodsObjStat( rodsObjStatOut );
190  return USER_INPUT_PATH_ERR;
191  }
192 
193  if ( rodsObjStatOut != NULL &&
194  rodsObjStatOut->specColl != NULL &&
195  rodsObjStatOut->specColl->collClass == LINKED_COLL ) {
196  /* should not be here because if has been translated */
197  if ( lockFd >= 0 ) {
198  char fd_string[NAME_LEN];
199  snprintf( fd_string, sizeof( fd_string ), "%-d", lockFd );
200  addKeyVal( &dataObjInp->condInput, LOCK_FD_KW, fd_string );
203  rsComm,
204  dataObjInp,
205  NULL,
206  ( void** ) NULL,
207  NULL );
208  }
209 
210  freeRodsObjStat( rodsObjStatOut );
211  return SYS_COLL_LINK_PATH_ERR;
212  }
213 
214  if ( rodsObjStatOut == NULL ||
215  ( rodsObjStatOut->objType == UNKNOWN_OBJ_T &&
216  rodsObjStatOut->specColl == NULL ) ) {
217  /* does not exist. have to create one */
218  /* use L1desc[l1descInx].replStatus & OPEN_EXISTING_COPY instead */
219  /* newly created. take out FORCE_FLAG since it could be used by put */
220  /* rmKeyVal (&dataObjInp->condInput, FORCE_FLAG_KW); */
221  addKeyVal(&dataObjInp->condInput, OPEN_TYPE_KW, std::to_string(CREATE_TYPE).c_str());
222  l1descInx = _rsDataObjCreate( rsComm, dataObjInp );
223 
224  }
225  else if ( rodsObjStatOut->specColl != NULL &&
226  rodsObjStatOut->objType == UNKNOWN_OBJ_T ) {
227 
228  /* newly created. take out FORCE_FLAG since it could be used by put */
229  /* rmKeyVal (&dataObjInp->condInput, FORCE_FLAG_KW); */
230  l1descInx = specCollSubCreate( rsComm, dataObjInp );
231  }
232  else {
233 
234  /* dataObj exist */
235  if ( getValByKey( &dataObjInp->condInput, FORCE_FLAG_KW ) != NULL ) {
236  dataObjInp->openFlags |= O_TRUNC | O_RDWR;
237  // =-=-=-=-=-=-=-
238  // re-determine the resource hierarchy since this is an open instead of a create
239  std::string hier;
241  rsComm, dataObjInp, hier );
242  if ( !ret.ok() ) {
243  if ( HIERARCHY_ERROR == ret.code() ) {
244  char* dst_resc_kw = getValByKey( &dataObjInp->condInput, DEST_RESC_NAME_KW );
246  LOG_ERROR,
247  &rsComm->rError,
248  status,
249  "Cannot overwrite replica of [%s] to resource [%s] as no prior replica exists on that resource",
250  dataObjInp->objPath,
251  dst_resc_kw );
252  }
253  else {
254  std::stringstream msg;
255  msg << "failed in irods::resolve_resource_hierarchy for [";
256  msg << dataObjInp->objPath << "]";
257  irods::log( PASSMSG( msg.str(), ret ) );
258  }
259  freeRodsObjStat( rodsObjStatOut );
260 
261  return ret.code();
262  }
263 
264  // =-=-=-=-=-=-=-
265  // we resolved the redirect and have a host, set the hier str for subsequent
266  // api calls, etc.
267  addKeyVal( &dataObjInp->condInput, RESC_HIER_STR_KW, hier.c_str() );
268  std::string top_resc;
270  parser.set_string( hier );
271  parser.first_resc( top_resc );
272  addKeyVal( &dataObjInp->condInput, DEST_RESC_NAME_KW, top_resc.c_str() );
273  addKeyVal(&dataObjInp->condInput, OPEN_TYPE_KW, std::to_string(OPEN_FOR_WRITE_TYPE).c_str());
274  l1descInx = rsDataObjOpen( rsComm, dataObjInp );
275 
276  }
277  else {
278  l1descInx = OVERWRITE_WITHOUT_FORCE_FLAG;
279  }
280  }
281 
282 
283  freeRodsObjStat( rodsObjStatOut );
284 
285  // =-=-=-=-=-=-=-
286  // JMC - backport 4604
287  if ( lockFd >= 0 ) {
288  if ( l1descInx >= 0 ) {
289  L1desc[l1descInx].lockFd = lockFd;
290  }
291  else {
292  char fd_string[NAME_LEN];
293  snprintf( fd_string, sizeof( fd_string ), "%-d", lockFd );
294  addKeyVal( &dataObjInp->condInput, LOCK_FD_KW, fd_string );
297  rsComm,
298  dataObjInp,
299  NULL,
300  ( void** ) NULL,
301  NULL );
302  }
303  }
304 
305  // =-=-=-=-=-=-=-
306  return l1descInx;
307 }
308 
309 int
310 _rsDataObjCreate( rsComm_t *rsComm, dataObjInp_t *dataObjInp ) {
311  int status = 0;
312  int l1descInx = 0;
313 
314  status = l1descInx = _rsDataObjCreateWithResc(
315  rsComm,
316  dataObjInp,
317  "INVALID_RESOURCE_NAME");
318 
319  if ( status < 0 ) {
321  "rsDataObjCreate: Internal error" );
322  }
323  return status;
324 }
325 
326 int
327 specCollSubCreate( rsComm_t *rsComm, dataObjInp_t *dataObjInp ) {
328  int status;
329  int l1descInx;
330  dataObjInfo_t *dataObjInfo = NULL;
331 
332  status = resolvePathInSpecColl( rsComm, dataObjInp->objPath,
333  WRITE_COLL_PERM, 0, &dataObjInfo );
334  if ( dataObjInfo == NULL ) { // JMC cppcheck
335  rodsLog( LOG_ERROR, "specCollSubCreate :: dataObjInp is null" );
336  return status;
337  }
338  if ( status >= 0 ) {
340  "specCollSubCreate: phyPath %s already exist",
341  dataObjInfo->filePath );
342  freeDataObjInfo( dataObjInfo );
344  }
345  else if ( status != SYS_SPEC_COLL_OBJ_NOT_EXIST ) {
346  return status;
347  }
348 
349  l1descInx = allocL1desc();
350 
351  if ( l1descInx < 0 ) {
352  return l1descInx;
353  }
354 
355  dataObjInfo->replStatus = NEWLY_CREATED_COPY;
356  fillL1desc( l1descInx, dataObjInp, dataObjInfo, NEWLY_CREATED_COPY,
357  dataObjInp->dataSize );
358 
359  if ( getValByKey( &dataObjInp->condInput, NO_OPEN_FLAG_KW ) == NULL ) {
360  status = dataCreate( rsComm, l1descInx );
361  if ( status < 0 ) {
362  freeL1desc( l1descInx );
363  return status;
364  }
365  }
366 
367  return l1descInx;
368 }
369 
370 /* _rsDataObjCreateWithResc - Create a single copy of the data Object
371  * given a resource name.
372  *
373  * return l1descInx.
374  */
375 
376 int
378  rsComm_t* rsComm,
379  dataObjInp_t* dataObjInp,
380  const std::string& _resc_name ) {
381 
382  dataObjInfo_t *dataObjInfo;
383  int l1descInx;
384  int status;
385 
386  l1descInx = allocL1desc();
387  if ( l1descInx < 0 ) {
388  return l1descInx;
389  }
390 
391 
392  dataObjInfo = ( dataObjInfo_t* )malloc( sizeof( dataObjInfo_t ) );
393  initDataObjInfoWithInp( dataObjInfo, dataObjInp );
394 
395  // =-=-=-=-=-=-=-
396  // stage kvp for passthru
397  char* kvp_str = getValByKey(
398  &dataObjInp->condInput,
400  if ( kvp_str ) {
401  addKeyVal(
402  &dataObjInfo->condInput,
404  kvp_str );
405 
406  }
407 
408  // =-=-=-=-=-=-=-
409  // honor the purge flag
410  if ( getValByKey( &dataObjInp->condInput, PURGE_CACHE_KW ) != NULL ) { // JMC - backport 4537
411  L1desc[l1descInx].purgeCacheFlag = 1;
412  }
413  char* resc_hier = getValByKey( &dataObjInp->condInput, RESC_HIER_STR_KW );
414  if ( resc_hier ) {
415  // we need to favor the results from the PEP acSetRescSchemeForCreate
417  parse.set_string( resc_hier );
418 
419  std::string root;
420  parse.first_resc( root );
421 
422  std::string leaf;
423  parse.last_resc( leaf );
424 
425  rstrcpy( dataObjInfo->rescName, root.c_str(), NAME_LEN );
426  rstrcpy( dataObjInfo->rescHier, resc_hier, MAX_NAME_LEN );
427  }
428  else {
429  rstrcpy( dataObjInfo->rescName, _resc_name.c_str(), NAME_LEN );// backwards compatibility
430  rstrcpy( dataObjInfo->rescHier, _resc_name.c_str(), MAX_NAME_LEN );// backwards compatibility
431  }
432 
433  irods::error ret = resc_mgr.hier_to_leaf_id(dataObjInfo->rescHier, dataObjInfo->rescId );
434  if(!ret.ok()) {
435  irods::log(PASS(ret));
436  return ret.code();
437  }
438 
439  dataObjInfo->replStatus = NEWLY_CREATED_COPY; // JMC - backport 4754
440  fillL1desc( l1descInx, dataObjInp, dataObjInfo, NEWLY_CREATED_COPY,
441  dataObjInp->dataSize );
442 
443  status = getFilePathName( rsComm, dataObjInfo, L1desc[l1descInx].dataObjInp );
444 
445  if ( status < 0 ) {
446  freeL1desc( l1descInx );
447  return status;
448  }
449 
450  /* output of _rsDataObjCreate - filePath stored in
451  * dataObjInfo struct */
452 
453  if ( getValByKey( &dataObjInp->condInput, NO_OPEN_FLAG_KW ) != NULL ) {
454 
455  /* don't actually physically open the file */
456  status = 0;
457  }
458  else {
459  status = register_and_create_data_object( rsComm, l1descInx );
460  }
461 
462  if ( status < 0 ) {
463  freeL1desc( l1descInx );
464  return status;
465  }
466  else {
467  return l1descInx;
468  }
469 }
470 
471 /* dataCreate - given the l1descInx, physically create the file
472  * and save the l3descInx in L1desc[l1descInx].
473  */
474 
475 int
476 dataCreate( rsComm_t *rsComm, int l1descInx ) {
477  dataObjInfo_t *myDataObjInfo = L1desc[l1descInx].dataObjInfo;
478  int status;
479 
480  /* should call resolveHostForTansfer to find host. gateway rodsServerHost
481  * should be in l3desc */
482  status = l3Create( rsComm, l1descInx );
483 
484  if ( status <= 0 ) {
486  "dataCreate: l3Create of %s failed, status = %d",
487  myDataObjInfo->filePath, status );
488  return status;
489  }
490  else {
491  L1desc[l1descInx].l3descInx = status;
492  }
493 
494  return 0;
495 }
496 
497 int
498 l3Create( rsComm_t *rsComm, int l1descInx ) {
499  int l3descInx;
500 
501  dataObjInfo_t *dataObjInfo = L1desc[l1descInx].dataObjInfo;
502 
503  // =-=-=-=-=-=-=-
504  // extract the host location from the resource hierarchy
505  std::string location;
506  irods::error ret = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
507  if ( !ret.ok() ) {
508  irods::log( PASSMSG( "l3Create - failed in get_loc_for_hier_string", ret ) );
509  return -1;
510  }
511 
512 
513  if ( getStructFileType( dataObjInfo->specColl ) >= 0 ) {
514  subFile_t subFile;
515  memset( &subFile, 0, sizeof( subFile ) );
516  rstrcpy( subFile.subFilePath, dataObjInfo->subPath, MAX_NAME_LEN );
517  rstrcpy( subFile.addr.hostAddr, location.c_str(), NAME_LEN );
518 
519  subFile.specColl = dataObjInfo->specColl;
520  subFile.mode = getFileMode( L1desc[l1descInx].dataObjInp );
521  l3descInx = rsSubStructFileCreate( rsComm, &subFile );
522  }
523  else {
524  /* normal or mounted file */
525  l3descInx = l3CreateByObjInfo( rsComm, L1desc[l1descInx].dataObjInp,
526  L1desc[l1descInx].dataObjInfo );
527  }
528 
529  return l3descInx;
530 }
531 
532 int
534  dataObjInfo_t *dataObjInfo ) {
535 
536  int chkType = 0; // JMC - backport 4774
537 
538  // =-=-=-=-=-=-=-
539  // extract the host location from the resource hierarchy
540  std::string location;
541  irods::error ret = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
542  if ( !ret.ok() ) {
543  irods::log( PASSMSG( "l3CreateByObjInfo - failed in get_loc_for_hier_string", ret ) );
544  return -1;
545  }
546 
547 
548  fileCreateInp_t fileCreateInp;
549  memset( &fileCreateInp, 0, sizeof( fileCreateInp ) );
550  rstrcpy( fileCreateInp.resc_name_, location.c_str(), MAX_NAME_LEN );
551  rstrcpy( fileCreateInp.resc_hier_, dataObjInfo->rescHier, MAX_NAME_LEN );
552  rstrcpy( fileCreateInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN );
553  rstrcpy( fileCreateInp.addr.hostAddr, location.c_str(), NAME_LEN );
554  copyKeyVal(
555  &dataObjInfo->condInput,
556  &fileCreateInp.condInput );
557 
558  rstrcpy( fileCreateInp.fileName, dataObjInfo->filePath, MAX_NAME_LEN );
559  fileCreateInp.mode = getFileMode( dataObjInp );
560  // =-=-=-=-=-=-=-
561  // JMC - backport 4774
562  chkType = getchkPathPerm( rsComm, dataObjInp, dataObjInfo );
563  if ( chkType == DISALLOW_PATH_REG ) {
564  clearKeyVal( &fileCreateInp.condInput );
565  return PATH_REG_NOT_ALLOWED;
566  }
567  else if ( chkType == NO_CHK_PATH_PERM ) {
568  fileCreateInp.otherFlags |= NO_CHK_PERM_FLAG; // JMC - backport 4758
569  }
570  rstrcpy( fileCreateInp.in_pdmo, dataObjInfo->in_pdmo, MAX_NAME_LEN );
571 
572  //loop until we find a valid filename
573  int retryCnt = 0;
574  int l3descInx;
575  do {
576  fileCreateOut_t* create_out = NULL;
577  l3descInx = rsFileCreate( rsComm, &fileCreateInp, &create_out );
578 
579  // update the dataObjInfo with the potential changes made by the resource - hcj
580  if ( create_out != NULL ) {
581  rstrcpy( dataObjInfo->rescHier, fileCreateInp.resc_hier_, MAX_NAME_LEN );
582  rstrcpy( dataObjInfo->filePath, create_out->file_name, MAX_NAME_LEN );
583  free( create_out );
584  }
585 
586  //update the filename in case of a retry
587  rstrcpy( fileCreateInp.fileName, dataObjInfo->filePath, MAX_NAME_LEN );
588  retryCnt++;
589  }
590  while ( getErrno( l3descInx ) == EEXIST &&
591  resolveDupFilePath( rsComm, dataObjInfo, dataObjInp ) >= 0 &&
592  l3descInx <= 2 && retryCnt < 100 );
593  clearKeyVal( &fileCreateInp.condInput );
594  return l3descInx;
595 }
596 
597 /* getRescForCreate - given the resource input in dataObjInp,
598  * fills out _resc_name after applying the acSetRescSchemeForCreate
599  * rule.
600  * Return 1 of the "random" sorting scheme is used. Otherwise return 0
601  * or an error code.
602  */
603 
605  rsComm_t* _comm,
606  dataObjInp_t* _obj_inp,
607  std::string& _resc_name ) {
608 
609  /* query rcat for resource info and sort it */
610  ruleExecInfo_t rei;
611  initReiWithDataObjInp( &rei, _comm, _obj_inp );
612 
613  int status = 0;
614  if ( _obj_inp->oprType == REPLICATE_OPR ) {
615  status = applyRule( "acSetRescSchemeForRepl", NULL, &rei, NO_SAVE_REI );
616  }
617  else {
618  status = applyRule( "acSetRescSchemeForCreate", NULL, &rei, NO_SAVE_REI );
619  }
621  free(rei.condInputData);
622 
623  if ( status < 0 ) {
624  if ( rei.status < 0 ) {
625  status = rei.status;
626  }
627 
628  rodsLog(
629  LOG_NOTICE,
630  "getRescForCreate:acSetRescSchemeForCreate error for %s,status=%d",
631  _obj_inp->objPath,
632  status );
633 
634  return status;
635  }
636 
637  // get resource name
638  if ( !strlen( rei.rescName ) ) {
640  _comm,
641  "", "",
642  &_obj_inp->condInput,
643  _resc_name );
644  if ( !set_err.ok() ) {
645  irods::log( PASS( set_err ) );
646  return SYS_INVALID_RESC_INPUT;
647  }
648  }
649  else {
650  _resc_name = rei.rescName;
651  }
652 
654  _comm,
655  _obj_inp->objPath,
656  _resc_name.c_str(),
657  _obj_inp->dataSize );
660  }
661 
662 
663  return 0;
664 }
allocL1desc
int allocL1desc()
Definition: objDesc.cpp:39
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
DataObjInp::objPath
char objPath[(1024+64)]
Definition: dataObjInpOut.h:66
L1desc
l1desc_t L1desc[1026]
Definition: irods_server_globals.cpp:29
LOCK_TYPE_KW
#define LOCK_TYPE_KW
Definition: rodsKeyWdDef.h:115
getchkPathPerm
int getchkPathPerm(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:312
NULL
#define NULL
Definition: rodsDef.h:70
regDataObj.h
rsComm_t
Definition: rcConnect.h:145
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
SYS_INVALID_RESC_INPUT
@ SYS_INVALID_RESC_INPUT
Definition: rodsErrorTable.h:100
getRemoteZoneResc.h
DataObjInp::openFlags
int openFlags
Definition: dataObjInpOut.h:68
getFilePathName
int getFilePathName(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:87
NEWLY_CREATED_COPY
#define NEWLY_CREATED_COPY
Definition: objInfo.h:115
specColl.hpp
rsDataObjCreate
int rsDataObjCreate(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjCreate.cpp:77
rsGetRescQuota.hpp
rsDataObjOpen.hpp
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
l3Create
int l3Create(rsComm_t *rsComm, int l1descInx)
Definition: rsDataObjCreate.cpp:498
rsDataObjCreate.hpp
fileOpenInp_t::resc_name_
char resc_name_[(1024+64)]
Definition: fileOpen.h:15
Subfile
Definition: objInfo.h:316
UNKNOWN_OBJ_T
@ UNKNOWN_OBJ_T
Definition: rodsType.h:37
rsUnregDataObj.hpp
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
irods::server_api_call
int server_api_call(int _api_index, rsComm_t *_comm, INP_T *_input, bytesBuf_t *_input_buffer, OUT_T **_output, bytesBuf_t *_output_buffer)
Definition: irods_server_api_call.hpp:11
subStructFileCreate.h
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
l1desc::lockFd
int lockFd
Definition: objDesc.hpp:55
validate_logical_path
irods::error validate_logical_path(const std::string &)
Definition: dataObjOpr.cpp:47
resc_mgr
irods::resource_manager resc_mgr
Definition: irods_resource_manager.cpp:31
Subfile::subFilePath
char subFilePath[(1024+64)]
Definition: objInfo.h:318
DataObjInp::dataSize
rodsLong_t dataSize
Definition: dataObjInpOut.h:70
irods::resolve_resource_hierarchy
error resolve_resource_hierarchy(const std::string &, rsComm_t *, dataObjInp_t *, std::string &, dataObjInfo_t **_data_obj_info=0)
Definition: irods_resource_redirect.cpp:505
dataObjCreateAndStat.h
rsDataObjOpen
int rsDataObjOpen(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjOpen.cpp:45
getRescForCreate
int getRescForCreate(rsComm_t *_comm, dataObjInp_t *_obj_inp, std::string &_resc_name)
Definition: rsDataObjCreate.cpp:604
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
has_trailing_path_separator
int has_trailing_path_separator(const char *path)
Definition: rodsPath.cpp:526
SYS_SPEC_COLL_OBJ_NOT_EXIST
@ SYS_SPEC_COLL_OBJ_NOT_EXIST
Definition: rodsErrorTable.h:123
allocAndSetL1descForZoneOpr
int allocAndSetL1descForZoneOpr(int l3descInx, dataObjInp_t *dataObjInp, rodsServerHost_t *remoteZoneHost, openStat_t *openStat)
Definition: objDesc.cpp:638
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
irods::hierarchy_parser
Definition: irods_hierarchy_parser.hpp:14
NO_CHK_PERM_FLAG
#define NO_CHK_PERM_FLAG
Definition: fileOpen.h:10
freeDataObjInfo
int freeDataObjInfo(dataObjInfo_t *dataObjInfo)
Definition: rcMisc.cpp:544
DataObjInfo::rescId
rodsLong_t rescId
Definition: objInfo.h:164
rsSubStructFileCreate
int rsSubStructFileCreate(rsComm_t *rsComm, subFile_t *subFile)
Definition: rsSubStructFileCreate.cpp:13
svrRegDataObj
int svrRegDataObj(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: rsRegDataObj.cpp:120
l1desc::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: objDesc.hpp:42
getStructFileType
int getStructFileType(specColl_t *specColl)
Definition: objMetaOpr.cpp:386
DataObjInfo::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:132
DataObjInfo::replStatus
int replStatus
Definition: objInfo.h:141
irods::set_default_resource
error set_default_resource(rsComm_t *, const std::string &, const std::string &, keyValPair_t *, std::string &)
Definition: irods_resource_backport.cpp:298
setRescQuota
int setRescQuota(rsComm_t *comm_handle, const char *obj_path, const char *resc_name, rodsLong_t data_size)
Definition: rsGetRescQuota.cpp:213
DataObjInfo::condInput
keyValPair_t condInput
Definition: objInfo.h:161
irods_resource_backport.hpp
Subfile::specColl
specColl_t * specColl
Definition: objInfo.h:322
fileOpenInp_t::resc_hier_
char resc_hier_[(1024+64)]
Definition: fileOpen.h:16
WRITE_COLL_PERM
@ WRITE_COLL_PERM
Definition: objInfo.h:99
fillL1desc
int fillL1desc(int l1descInx, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfo, int replStatus, rodsLong_t dataSize)
Definition: objDesc.cpp:154
LOCK_FD_KW
#define LOCK_FD_KW
Definition: rodsKeyWdDef.h:117
l1desc::l3descInx
int l3descInx
Definition: objDesc.hpp:35
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
rcGlobalExtern.h
deploy_schemas_locally.parser
parser
Definition: deploy_schemas_locally.py:59
DataObjInfo::filePath
char filePath[(1024+64)]
Definition: objInfo.h:137
CROSS_ZONE_CREATE_KW
#define CROSS_ZONE_CREATE_KW
Definition: rodsKeyWdDef.h:83
rcDataObjCreateAndStat
int rcDataObjCreateAndStat(rcComm_t *conn, dataObjInp_t *dataObjInp, openStat_t **openStat)
Definition: rcDataObjCreateAndStat.cpp:71
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
dataObjCreate.h
irods_resource_redirect.hpp
fileOpenInp_t::fileName
char fileName[(1024+64)]
Definition: fileOpen.h:20
DataObjInfo::specColl
specColl_t * specColl
Definition: objInfo.h:158
PATH_REG_NOT_ALLOWED
@ PATH_REG_NOT_ALLOWED
Definition: rodsErrorTable.h:194
PURGE_CACHE_KW
#define PURGE_CACHE_KW
Definition: rodsKeyWdDef.h:110
CREATE_TYPE
#define CREATE_TYPE
Definition: dataObjInpOut.h:193
resolveLinkedPath
int resolveLinkedPath(rsComm_t *rsComm, char *objPath, specCollCache_t **specCollCache, keyValPair_t *condInput)
Definition: specColl.cpp:711
initReiWithDataObjInp
int initReiWithDataObjInp(ruleExecInfo_t *rei, rsComm_t *rsComm, dataObjInp_t *dataObjIn)
Definition: irods_re_structs.cpp:164
unregDataObj_t::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: unregDataObj.h:8
freeRodsObjStat
int freeRodsObjStat(rodsObjStat_t *rodsObjStat)
Definition: rcMisc.cpp:3537
COLL_OBJ_T
@ COLL_OBJ_T
Definition: rodsType.h:39
fileCreate.h
DEST_RESC_NAME_KW
#define DEST_RESC_NAME_KW
Definition: rodsKeyWdDef.h:20
RuleExecInfo::condInputData
keyValPair_t * condInputData
Definition: irods_re_structs.hpp:34
fileCreateOut_t
Definition: fileCreate.h:9
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
irods::error::code
long long code() const
Definition: irods_error.cpp:194
LINKED_COLL
@ LINKED_COLL
Definition: objInfo.h:49
RESC_HIER_STR_KW
#define RESC_HIER_STR_KW
Definition: rodsKeyWdDef.h:225
rodsLogAndErrorMsg
void rodsLogAndErrorMsg(int level, rError_t *myError, int status, const char *formatStr,...)
Definition: rodsLog.cpp:231
fileOpenInp_t::addr
rodsHostAddr_t addr
Definition: fileOpen.h:19
irods::hierarchy_parser::last_resc
error last_resc(std::string &_ret_resc) const
Definition: irods_hierarchy_parser.cpp:109
fileOpenInp_t::objPath
char objPath[(1024+64)]
Definition: fileOpen.h:17
DataObjInfo::in_pdmo
char in_pdmo[(1024+64)]
Definition: objInfo.h:162
NO_CHK_PATH_PERM
#define NO_CHK_PATH_PERM
Definition: objInfo.h:246
irods::hierarchy_parser::first_resc
error first_resc(std::string &_ret_resc) const
Definition: irods_hierarchy_parser.cpp:96
specCollSubCreate
int specCollSubCreate(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjCreate.cpp:327
dataCreate
int dataCreate(rsComm_t *rsComm, int l1descInx)
Definition: rsDataObjCreate.cpp:476
OPEN_TYPE_KW
#define OPEN_TYPE_KW
Definition: rodsKeyWdDef.h:95
rsObjStat
int rsObjStat(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsObjStat_t **rodsObjStatOut)
Definition: rsObjStat.cpp:23
SYS_RESC_QUOTA_EXCEEDED
@ SYS_RESC_QUOTA_EXCEEDED
Definition: rodsErrorTable.h:175
REMOTE_CREATE
#define REMOTE_CREATE
Definition: getRemoteZoneResc.h:4
DataObjInp
Definition: dataObjInpOut.h:65
NO_OPEN_FLAG_KW
#define NO_OPEN_FLAG_KW
Definition: rodsKeyWdDef.h:45
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
getRescQuota.h
rodsObjStat::objType
objType_t objType
Definition: objStat.h:10
getErrno
int getErrno(int errCode)
Definition: rcMisc.cpp:3261
Subfile::addr
rodsHostAddr_t addr
Definition: objInfo.h:317
rmKeyVal
int rmKeyVal(keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:710
fileOpenInp_t::mode
int mode
Definition: fileOpen.h:22
rsFileCreate
int rsFileCreate(rsComm_t *rsComm, fileCreateInp_t *fileCreateInp, fileCreateOut_t **)
Definition: rsFileCreate.cpp:28
SEL_OBJ_TYPE_KW
#define SEL_OBJ_TYPE_KW
Definition: rodsKeyWdDef.h:71
DataObjInfo::replNum
int replNum
Definition: objInfo.h:140
irods::hierarchy_parser::set_string
error set_string(const std::string &_resc_hier)
Definition: irods_hierarchy_parser.cpp:36
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rodsLog.h
OPEN_FOR_WRITE_TYPE
#define OPEN_FOR_WRITE_TYPE
Definition: dataObjInpOut.h:195
physPath.hpp
irods::log
void log(const error &)
Definition: irods_log.cpp:13
KEY_VALUE_PASSTHROUGH_KW
#define KEY_VALUE_PASSTHROUGH_KW
Definition: rodsKeyWdDef.h:284
OpenStat
Definition: dataObjOpenAndStat.h:8
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
rsFileCreate.hpp
resolvePathInSpecColl
int resolvePathInSpecColl(rsComm_t *rsComm, char *objPath, specCollPerm_t specCollPerm, int inCachOnly, dataObjInfo_t **dataObjInfo)
Definition: specColl.cpp:644
irods::error
Definition: irods_error.hpp:23
rsSubStructFileCreate.hpp
HIERARCHY_ERROR
@ HIERARCHY_ERROR
Definition: rodsErrorTable.h:752
fileCreateOut_t::file_name
char file_name[(1024+64)]
Definition: fileCreate.h:10
apiNumber.h
unregDataObj_t
Definition: unregDataObj.h:7
fileOpenInp_t::condInput
keyValPair_t condInput
Definition: fileOpen.h:24
REPLICATE_OPR
#define REPLICATE_OPR
Definition: dataObjInpOut.h:172
irods_hierarchy_parser.hpp
SYS_COLL_LINK_PATH_ERR
@ SYS_COLL_LINK_PATH_ERR
Definition: rodsErrorTable.h:172
FORCE_FLAG_KW
#define FORCE_FLAG_KW
Definition: rodsKeyWdDef.h:13
fileOpenInp_t
Definition: fileOpen.h:14
rsObjStat.hpp
irods::resource_manager::hier_to_leaf_id
error hier_to_leaf_id(const std::string &, rodsLong_t &)
Definition: irods_resource_manager.cpp:1082
_rsDataObjCreate
int _rsDataObjCreate(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsDataObjCreate.cpp:310
rodsServerHost
Definition: rodsConnect.h:62
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
DataObjInp::oprType
int oprType
Definition: dataObjInpOut.h:72
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
DATA_OBJ_UNLOCK_AN
#define DATA_OBJ_UNLOCK_AN
Definition: apiNumber.h:109
OVERWRITE_WITHOUT_FORCE_FLAG
@ OVERWRITE_WITHOUT_FORCE_FLAG
Definition: rodsErrorTable.h:243
RuleExecInfo::rescName
char rescName[64]
Definition: irods_re_structs.hpp:29
RuleExecInfo
Definition: irods_re_structs.hpp:18
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
irods::WRITE_OPERATION
const std::string WRITE_OPERATION("WRITE")
getAndConnRemoteZone
int getAndConnRemoteZone(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsServerHost_t **rodsServerHost, char *remotZoneOpr)
Definition: rodsConnect.cpp:784
irods_server_api_call.hpp
applyRule
int applyRule(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:65
resource.hpp
icatHighLevelRoutines.hpp
getFileMode
int getFileMode(dataObjInp_t *dataObjInp)
Definition: physPath.cpp:48
DISALLOW_PATH_REG
#define DISALLOW_PATH_REG
Definition: objInfo.h:245
rodsObjStat
Definition: objStat.h:8
dataObjOpen.h
DataObjInfo::objPath
char objPath[(1024+64)]
Definition: objInfo.h:130
Subfile::mode
int mode
Definition: objInfo.h:319
rsRegDataObj.hpp
rodsObjStat::specColl
specColl_t * specColl
Definition: objStat.h:18
resolveDupFilePath
int resolveDupFilePath(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:279
DATA_OBJ_LOCK_AN
#define DATA_OBJ_LOCK_AN
Definition: apiNumber.h:126
fileOpenInp_t::in_pdmo
char in_pdmo[(1024+64)]
Definition: fileOpen.h:25
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
dataObjOpr.hpp
rsUnregDataObj
int rsUnregDataObj(rsComm_t *rsComm, unregDataObj_t *unregDataObjInp)
Definition: rsUnregDataObj.cpp:17
dataObjLock.h
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
l3CreateByObjInfo
int l3CreateByObjInfo(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfo)
Definition: rsDataObjCreate.cpp:533
irods::get_loc_for_hier_string
error get_loc_for_hier_string(const std::string &_hier, std::string &_loc)
Definition: irods_resource_backport.cpp:633
SYS_COPY_ALREADY_IN_RESC
@ SYS_COPY_ALREADY_IN_RESC
Definition: rodsErrorTable.h:113
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
freeL1desc
int freeL1desc(int l1descInx)
Definition: objDesc.cpp:124
fileOpenInp_t::otherFlags
int otherFlags
Definition: fileOpen.h:18
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
initDataObjInfoWithInp
int initDataObjInfoWithInp(dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: objDesc.cpp:217
DataObjInfo
Definition: objInfo.h:129
USER_INPUT_PATH_ERR
@ USER_INPUT_PATH_ERR
Definition: rodsErrorTable.h:248
irods::CREATE_OPERATION
const std::string CREATE_OPERATION("CREATE")
_rsDataObjCreateWithResc
int _rsDataObjCreateWithResc(rsComm_t *rsComm, dataObjInp_t *dataObjInp, const std::string &_resc_name)
Definition: rsDataObjCreate.cpp:377
SpecCollCache
Definition: objInfo.h:102
objMetaOpr.hpp
SpecColl::collClass
specCollClass_t collClass
Definition: objInfo.h:77
DataObjInfo::subPath
char subPath[(1024+64)]
Definition: objInfo.h:157
copyKeyVal
int copyKeyVal(const keyValPair_t *srcCondInput, keyValPair_t *destCondInput)
Definition: rcMisc.cpp:751
l1desc::purgeCacheFlag
int purgeCacheFlag
Definition: objDesc.hpp:54