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)  

rsDataObjClose.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See dataObjClose.h for a description of this API call.*/
5 
6 
7 #include "dataObjClose.h"
8 #include "rodsLog.h"
9 #include "regReplica.h"
10 #include "modDataObjMeta.h"
11 #include "modAVUMetadata.h"
12 #include "dataObjOpr.hpp"
13 #include "objMetaOpr.hpp"
14 #include "physPath.hpp"
15 #include "resource.hpp"
16 #include "dataObjUnlink.h"
17 #include "rsGlobalExtern.hpp"
18 #include "rcGlobalExtern.h"
19 #include "ruleExecSubmit.h"
20 #include "subStructFileRead.h"
21 #include "subStructFileStat.h"
22 #include "subStructFileClose.h"
23 #include "regDataObj.h"
24 #include "dataObjRepl.h"
25 #include "dataObjTrim.h"
26 #include "dataObjLock.h"
27 #include "fileClose.h"
28 #include "fileStat.h"
29 #include "getRescQuota.h"
30 #include "miscServerFunct.hpp"
31 #include "rsDataObjClose.hpp"
32 #include "apiNumber.h"
33 #include "rsModDataObjMeta.hpp"
34 #include "rsDataObjTrim.hpp"
35 #include "rsDataObjUnlink.hpp"
36 #include "rsRegReplica.hpp"
37 #include "rsGetRescQuota.hpp"
38 #include "rsSubStructFileClose.hpp"
39 #include "rsFileClose.hpp"
40 #include "rsRegDataObj.hpp"
41 #include "rsSubStructFileStat.hpp"
42 #include "rsFileStat.hpp"
43 
44 // =-=-=-=-=-=-=-
46 #include "irods_stacktrace.hpp"
48 #include "irods_file_object.hpp"
49 #include "irods_exception.hpp"
50 #include "irods_serialization.hpp"
53 
54 
55 int
56 rsDataObjClose( rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp ) {
57  int status = irsDataObjClose( rsComm, dataObjCloseInp, NULL );
58 
59  return status;
60 }
61 
62 int
64  rsComm_t *rsComm,
65  openedDataObjInp_t *dataObjCloseInp,
66  dataObjInfo_t **outDataObjInfo ) {
67  int status;
68  int srcL1descInx;
69  openedDataObjInp_t myDataObjCloseInp;
70  int l1descInx;
71  ruleExecInfo_t rei;
72  l1descInx = dataObjCloseInp->l1descInx;
73  if ( l1descInx <= 2 || l1descInx >= NUM_L1_DESC ) {
75  "rsDataObjClose: l1descInx %d out of range",
76  l1descInx );
78  }
79 
80  // ensure that l1 descriptor is in use before closing
81  if ( L1desc[l1descInx].inuseFlag != FD_INUSE ) {
82  rodsLog(
83  LOG_ERROR,
84  "rsDataObjClose: l1descInx %d out of range",
85  l1descInx );
86  return BAD_INPUT_DESC_INDEX;
87  }
88 
89  // sanity check for in-flight l1 descriptor
90  if( !L1desc[l1descInx].dataObjInp ) {
91  rodsLog(
92  LOG_ERROR,
93  "rsDataObjClose: invalid dataObjInp for index %d",
94  l1descInx );
96  }
97 
98  if ( outDataObjInfo != NULL ) {
99  *outDataObjInfo = NULL;
100  }
101  if ( L1desc[l1descInx].remoteZoneHost != NULL ) {
102  /* cross zone operation */
103  dataObjCloseInp->l1descInx = L1desc[l1descInx].remoteL1descInx;
104  /* XXXXX outDataObjInfo will not be returned in this call.
105  * The only call that requires outDataObjInfo to be returned is
106  * _rsDataObjReplS which does a remote repl early for cross zone */
107  status = rcDataObjClose( L1desc[l1descInx].remoteZoneHost->conn, dataObjCloseInp );
108  dataObjCloseInp->l1descInx = l1descInx;
109  }
110  else {
111  status = _rsDataObjClose( rsComm, dataObjCloseInp );
112  // =-=-=-=-=-=-=-
113  // JMC - backport 4640
114  if ( L1desc[l1descInx].lockFd > 0 ) {
115  char fd_string[NAME_LEN];
116  snprintf( fd_string, sizeof( fd_string ), "%-d", L1desc[l1descInx].lockFd );
117  addKeyVal( &L1desc[l1descInx].dataObjInp->condInput, LOCK_FD_KW, fd_string );
120  rsComm,
121  L1desc[l1descInx].dataObjInp,
122  NULL,
123  ( void** ) NULL,
124  NULL );
125 
126  L1desc[l1descInx].lockFd = -1;
127  }
128  // =-=-=-=-=-=-=-
129 
130  if ( status >= 0 && L1desc[l1descInx].oprStatus >= 0 ) {
131  /* note : this may overlap with acPostProcForPut or
132  * acPostProcForCopy */
133  if ( L1desc[l1descInx].openType == CREATE_TYPE ) {
134  initReiWithDataObjInp( &rei, rsComm,
135  L1desc[l1descInx].dataObjInp );
136  rei.doi = L1desc[l1descInx].dataObjInfo;
137  rei.status = status;
138 
139  // make resource properties available as rule session variables
141 
142  rei.status = applyRule( "acPostProcForCreate", NULL, &rei,
143  NO_SAVE_REI );
144  /* doi might have changed */
145  L1desc[l1descInx].dataObjInfo = rei.doi;
147  free(rei.condInputData);
148  }
149  else if ( L1desc[l1descInx].openType == OPEN_FOR_READ_TYPE ||
150  L1desc[l1descInx].openType == OPEN_FOR_WRITE_TYPE ) {
151  initReiWithDataObjInp( &rei, rsComm,
152  L1desc[l1descInx].dataObjInp );
153  rei.doi = L1desc[l1descInx].dataObjInfo;
154  rei.status = status;
155 
156  // make resource properties available as rule session variables
158 
159  rei.status = applyRule( "acPostProcForOpen", NULL, &rei,
160  NO_SAVE_REI );
161  /* doi might have changed */
162  L1desc[l1descInx].dataObjInfo = rei.doi;
163  // =-=-=-=-=-=-=-
164  // JMC - bacport 4623
166  free(rei.condInputData);
167  }
168  else if ( L1desc[l1descInx].oprType == REPLICATE_DEST ) {
169  initReiWithDataObjInp( &rei, rsComm,
170  L1desc[l1descInx].dataObjInp );
171  rei.doi = L1desc[l1descInx].dataObjInfo;
172  rei.status = status;
173  rei.status = applyRule( "acPostProcForRepl", NULL, &rei,
174  NO_SAVE_REI );
175  /* doi might have changed */
176  L1desc[l1descInx].dataObjInfo = rei.doi;
177  // =-=-=-=-=-=-=-
179  free(rei.condInputData);
180  }
181 
182  if ( L1desc[l1descInx].oprType == COPY_DEST ) {
183  /* have to put copy first because the next test could
184  * trigger put rule for copy operation */
185  initReiWithDataObjInp( &rei, rsComm,
186  L1desc[l1descInx].dataObjInp );
187  rei.doi = L1desc[l1descInx].dataObjInfo;
188  rei.status = status;
189 
190  // make resource properties available as rule session variables
192 
193  rei.status = applyRule( "acPostProcForCopy", NULL, &rei,
194  NO_SAVE_REI );
195  /* doi might have changed */
196  L1desc[l1descInx].dataObjInfo = rei.doi;
198  free(rei.condInputData);
199  }
200  else if ( L1desc[l1descInx].oprType == PUT_OPR ||
201  L1desc[l1descInx].openType == CREATE_TYPE ||
202  ( L1desc[l1descInx].openType == OPEN_FOR_WRITE_TYPE &&
203  ( L1desc[l1descInx].bytesWritten > 0 ||
204  dataObjCloseInp->bytesWritten > 0 ) ) ) {
205  initReiWithDataObjInp( &rei, rsComm,
206  L1desc[l1descInx].dataObjInp );
207  rei.doi = L1desc[l1descInx].dataObjInfo;
208  rei.status = status;
209 
210  // make resource properties available as rule session variables
212 
213  rei.status = applyRule( "acPostProcForPut", NULL, &rei,
214  NO_SAVE_REI );
215  /* doi might have changed */
216  L1desc[l1descInx].dataObjInfo = rei.doi;
218  free(rei.condInputData);
219  }
220  else if ( L1desc[l1descInx].dataObjInp != NULL &&
221  L1desc[l1descInx].dataObjInp->oprType == PHYMV_OPR ) {
222  initReiWithDataObjInp( &rei, rsComm,
223  L1desc[l1descInx].dataObjInp );
224  rei.doi = L1desc[l1descInx].dataObjInfo;
225  rei.status = status;
226  rei.status = applyRule( "acPostProcForPhymv", NULL, &rei,
227  NO_SAVE_REI );
228  /* doi might have changed */
229  L1desc[l1descInx].dataObjInfo = rei.doi;
231  free(rei.condInputData);
232 
233  }
234  }
235  }
236 
237  srcL1descInx = L1desc[l1descInx].srcL1descInx;
238  if ( ( L1desc[l1descInx].oprType == REPLICATE_DEST ||
239  L1desc[l1descInx].oprType == COPY_DEST ) &&
240  srcL1descInx > 2 ) {
241  memset( &myDataObjCloseInp, 0, sizeof( myDataObjCloseInp ) );
242  myDataObjCloseInp.l1descInx = srcL1descInx;
243  rsDataObjClose( rsComm, &myDataObjCloseInp );
244  }
245 
246  if ( outDataObjInfo != NULL ) {
247  *outDataObjInfo = L1desc[l1descInx].dataObjInfo;
248  L1desc[l1descInx].dataObjInfo = NULL;
249  }
250 
251  freeL1desc( l1descInx );
252 
253  return status;
254 }
255 
257  rsComm_t* _comm,
258  int _l1descInx,
259  dataObjInfo_t* _info ) {
260 
261  keyValPair_t regParam;
262  modDataObjMeta_t modDataObjMetaInp;
263  memset( &regParam, 0, sizeof( regParam ) );
264  char tmpStr[MAX_NAME_LEN];
265  snprintf( tmpStr, sizeof( tmpStr ), "%ji", ( intmax_t ) _info->dataSize );
266  addKeyVal( &regParam, DATA_SIZE_KW, tmpStr );
267  addKeyVal( &regParam, IN_PDMO_KW, _info->rescHier ); // to stop resource hierarchy recursion
268  if ( getValByKey(
269  &L1desc[_l1descInx].dataObjInp->condInput,
270  ADMIN_KW ) != NULL ) {
271  addKeyVal( &regParam, ADMIN_KW, "" );
272  }
273 
274  modDataObjMetaInp.dataObjInfo = _info;
275  modDataObjMetaInp.regParam = &regParam;
276  int status = rsModDataObjMeta( _comm, &modDataObjMetaInp );
277  if ( status < 0 ) {
279  "_modDataObjSize: rsModDataObjMeta failed, dataSize [%d] status = %d",
280  _info->dataSize, status );
281  }
282  return status;
283 }
284 
285 int
287  rsComm_t *rsComm,
288  openedDataObjInp_t *dataObjCloseInp ) {
289  int status = 0;
290  int l1descInx, l3descInx;
291  keyValPair_t regParam;
292  memset( &regParam, 0, sizeof( regParam ) );
293  rodsLong_t newSize;
294  char tmpStr[MAX_NAME_LEN];
295  modDataObjMeta_t modDataObjMetaInp;
296  dataObjInfo_t *destDataObjInfo, *srcDataObjInfo;
297  int srcL1descInx;
298  regReplica_t regReplicaInp;
299  int noChkCopyLenFlag = 0;
300  int updateChksumFlag = 0;
301 
302  l1descInx = dataObjCloseInp->l1descInx;
303  l3descInx = L1desc[l1descInx].l3descInx;
304 
305  // Store openType in key/val in case a hop occurs
306  addKeyVal(&regParam, OPEN_TYPE_KW, std::to_string(L1desc[l1descInx].openType).c_str());
307 
308  if ( l3descInx > 2 ) {
309  /* it could be -ive for parallel I/O */
310  status = l3Close( rsComm, l1descInx );
311 
312  if ( status < 0 ) {
314  "_rsDataObjClose: l3Close of %d failed, status = %d",
315  l3descInx, status );
316  return status;
317  }
318  }
319 
320  if ( L1desc[l1descInx].oprStatus < 0 ) {
321  // #3674 - elide any additional errors for catalog update if this is a newly created replica
322  if(L1desc[l1descInx].replStatus == NEWLY_CREATED_COPY) {
323  if( L1desc[l1descInx].oprType == REPLICATE_OPR ||
324  L1desc[l1descInx].oprType == REPLICATE_DEST ||
325  L1desc[l1descInx].oprType == REPLICATE_SRC ) {
326  return L1desc[l1descInx].oprStatus;
327  }
328  }
329 
330  const rodsLong_t vault_size = getSizeInVault(
331  rsComm,
332  L1desc[l1descInx].dataObjInfo );
333  if ( vault_size < 0 ) {
335  "_rsDataObjClose - getSizeInVault failed [%ld]",
336  vault_size );
337  return vault_size;
338  }
339 
340  if ( L1desc[l1descInx].dataObjInfo->dataSize != vault_size ) {
341  L1desc[l1descInx].dataObjInfo->dataSize = vault_size;
342  int status = _modDataObjSize(
343  rsComm,
344  l1descInx,
345  L1desc[l1descInx].dataObjInfo );
346  if ( status < 0 ) {
348  "_rsDataObjClose - _modDataObjSize failed [%d]",
349  status );
350  return status;
351  }
352  }
353 
354  /* an error has occurred */
355  return L1desc[l1descInx].oprStatus;
356  }
357 
358  if ( dataObjCloseInp->bytesWritten > 0 &&
359  L1desc[l1descInx].bytesWritten <= 0 ) {
360  /* dataObjCloseInp->bytesWritten is used to specify bytesWritten
361  * for cross zone operation */
362  L1desc[l1descInx].bytesWritten =
363  dataObjCloseInp->bytesWritten;
364  }
365 
366  /* note that bytesWritten only indicates whether the file has been written
367  * to. Not necessarily the size of the file */
368  if ( L1desc[l1descInx].bytesWritten < 0 &&
369  L1desc[l1descInx].oprType != REPLICATE_DEST &&
370  L1desc[l1descInx].oprType != PHYMV_DEST &&
371  L1desc[l1descInx].oprType != COPY_DEST ) {
372  /* no write */
373  // =-=-=-=-=-=-=-
374  // JMC - backport 4537
375  if ( L1desc[l1descInx].purgeCacheFlag > 0 ) {
376  int status1 = trimDataObjInfo( rsComm,
377  L1desc[l1descInx].dataObjInfo );
378  if ( status1 < 0 ) {
379  rodsLogError( LOG_ERROR, status1,
380  "_rsDataObjClose: trimDataObjInfo error for %s",
381  L1desc[l1descInx].dataObjInfo->objPath );
382  }
383  }
384 
385  try {
386  applyMetadataFromKVP(rsComm, L1desc[l1descInx].dataObjInp);
387  applyACLFromKVP(rsComm, L1desc[l1descInx].dataObjInp);
388  }
389  catch ( const irods::exception& e ) {
390  rodsLog( LOG_ERROR, "%s", e.what() );
391  if ( L1desc[l1descInx].dataObjInp->oprType == PUT_OPR ) {
392  rsDataObjUnlink( rsComm, L1desc[l1descInx].dataObjInp );
393  }
394  return e.code();
395  }
396 
397  if ( L1desc[l1descInx].chksumFlag != 0 && L1desc[l1descInx].oprType == PUT_OPR ) {
398  char *chksumStr = NULL;
399  status = procChksumForClose( rsComm, l1descInx, &chksumStr );
400  if (status >= 0) {
401  std::string checksum = std::string( chksumStr );
402  free( chksumStr );
403 
404  if ( !checksum.empty() ) {
405  addKeyVal( &regParam, CHKSUM_KW, checksum.c_str() );
406  }
407 
408  modDataObjMetaInp.dataObjInfo = L1desc[l1descInx].dataObjInfo;
409  modDataObjMetaInp.regParam = &regParam;
410  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
411  }
412  }
413 
414  return status;
415  }
416 
417  if ( getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
418  NO_CHK_COPY_LEN_KW ) != NULL ) {
419  noChkCopyLenFlag = 1;
420  }
421 
422  newSize = getSizeInVault( rsComm, L1desc[l1descInx].dataObjInfo );
423 
424  // since we are not filtering out writes to archive resources, the
425  // archive plugins report UNKNOWN_FILE_SZ as their size since they may
426  // not be able to stat the file. filter that out and trust the plugin
427  // in this instance
428  if ( newSize == UNKNOWN_FILE_SZ && L1desc[l1descInx].dataSize >= 0 ) {
429  newSize = L1desc[l1descInx].dataSize;
430  }
431  /* check for consistency of the write operation */
432  else if ( newSize < 0 && newSize != UNKNOWN_FILE_SZ ) {
433  status = ( int ) newSize;
435  "_rsDataObjClose: getSizeInVault error for %s, status = %d",
436  L1desc[l1descInx].dataObjInfo->objPath, status );
437  return status;
438  }
439  else if ( L1desc[l1descInx].dataSize > 0 ) {
440  if ( newSize != L1desc[l1descInx].dataSize && noChkCopyLenFlag == 0 ) {
442  "_rsDataObjClose: size in vault %lld != target size %lld",
443  newSize, L1desc[l1descInx].dataSize );
444  return SYS_COPY_LEN_ERR;
445  }
446  }
447  // If an object with a checksum was written to, checksum needs updating
448  if ( ( OPEN_FOR_WRITE_TYPE == L1desc[l1descInx].openType ||
449  CREATE_TYPE == L1desc[l1descInx].openType ) &&
450  strlen( L1desc[l1descInx].dataObjInfo->chksum ) > 0 ) {
451 
452  L1desc[l1descInx].chksumFlag = REG_CHKSUM;
453  updateChksumFlag = 1;
454 
455  }
456 
457  // need a checksum check
458  std::string checksum;
459  if ( !noChkCopyLenFlag || updateChksumFlag ) {
460  char *chksumStr = NULL;
461  status = procChksumForClose( rsComm, l1descInx, &chksumStr );
462  if ( status < 0 ) {
463  return status;
464  }
465  if ( chksumStr != NULL ) {
466  checksum = std::string( chksumStr );
467  free( chksumStr );
468  }
469  }
470 
471  if ( L1desc[l1descInx].oprType == PHYMV_DEST ) {
472  /* a phymv */
473  destDataObjInfo = L1desc[l1descInx].dataObjInfo;
474  srcL1descInx = L1desc[l1descInx].srcL1descInx;
475  if ( srcL1descInx <= 2 ) {
477  "_rsDataObjClose: srcL1descInx %d out of range",
478  srcL1descInx );
480  }
481  srcDataObjInfo = L1desc[srcL1descInx].dataObjInfo;
482 
483  if ( !checksum.empty() ) {
484  addKeyVal( &regParam, CHKSUM_KW, checksum.c_str() );
485  }
486  addKeyVal( &regParam, FILE_PATH_KW, destDataObjInfo->filePath );
487  addKeyVal( &regParam, RESC_NAME_KW, destDataObjInfo->rescName );
488  addKeyVal( &regParam, RESC_HIER_STR_KW, destDataObjInfo->rescHier );
489  if ( getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
490  ADMIN_KW ) != NULL ) {
491  addKeyVal( &regParam, ADMIN_KW, "" );
492  }
493  char* pdmo_kw = getValByKey( &dataObjCloseInp->condInput, IN_PDMO_KW );
494  if ( pdmo_kw != NULL ) {
495  addKeyVal( &regParam, IN_PDMO_KW, pdmo_kw );
496  }
497  modDataObjMetaInp.dataObjInfo = destDataObjInfo;
498  modDataObjMetaInp.regParam = &regParam;
499  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
500  clearKeyVal( &regParam );
501  /* have to handle the l3Close here because the need to
502  * unlink the srcDataObjInfo */
503  if ( status >= 0 ) {
504  if ( L1desc[srcL1descInx].l3descInx > 2 ) {
505  int status1;
506  status1 = l3Close( rsComm, srcL1descInx );
507  if ( status1 < 0 ) {
509  "_rsDataObjClose: l3Close of %s error. status = %d",
510  srcDataObjInfo->objPath, status1 );
511  }
512  }
513  l3Unlink( rsComm, srcDataObjInfo );
514  updatequotaOverrun( destDataObjInfo->rescHier,
515  destDataObjInfo->dataSize, RESC_QUOTA );
516  }
517  else {
518  if ( L1desc[srcL1descInx].l3descInx > 2 ) {
519  l3Close( rsComm, srcL1descInx );
520  }
521  }
522  freeL1desc( srcL1descInx );
523  L1desc[l1descInx].srcL1descInx = 0;
524  }
525  else if ( L1desc[l1descInx].oprType == REPLICATE_DEST ) {
526  destDataObjInfo = L1desc[l1descInx].dataObjInfo;
527  srcL1descInx = L1desc[l1descInx].srcL1descInx;
528  if ( srcL1descInx <= 2 ) {
530  "_rsDataObjClose: srcL1descInx %d out of range",
531  srcL1descInx );
533  }
534  srcDataObjInfo = L1desc[srcL1descInx].dataObjInfo;
535 
536  if ( L1desc[l1descInx].replStatus & OPEN_EXISTING_COPY ) {
537  /* repl to an existing copy */
538  snprintf( tmpStr, MAX_NAME_LEN, "%d", srcDataObjInfo->replStatus );
539  addKeyVal( &regParam, REPL_STATUS_KW, tmpStr );
540  snprintf( tmpStr, MAX_NAME_LEN, "%lld", srcDataObjInfo->dataSize );
541  addKeyVal( &regParam, DATA_SIZE_KW, tmpStr );
542  snprintf( tmpStr, MAX_NAME_LEN, "%d", ( int ) time( NULL ) );
543  addKeyVal( &regParam, DATA_MODIFY_KW, tmpStr );
544  if ( !checksum.empty() ) {
545  addKeyVal( &regParam, CHKSUM_KW, checksum.c_str() );
546  }
547 
548  if ( getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
549  ADMIN_KW ) != NULL ) {
550  addKeyVal( &regParam, ADMIN_KW, "" );
551  }
552  if ( ( L1desc[l1descInx].replStatus & FILE_PATH_HAS_CHG ) != 0 ) {
553  /* path has changed */
554  addKeyVal( &regParam, FILE_PATH_KW, destDataObjInfo->filePath );
555  }
556  char* pdmo_kw = getValByKey( &dataObjCloseInp->condInput, IN_PDMO_KW );
557  if ( pdmo_kw != NULL ) {
558  addKeyVal( &regParam, IN_PDMO_KW, pdmo_kw );
559  }
560  modDataObjMetaInp.dataObjInfo = destDataObjInfo;
561  modDataObjMetaInp.regParam = &regParam;
562  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
563  }
564  else {
565  /* repl to a new copy */
566  memset( &regReplicaInp, 0, sizeof( regReplicaInp ) );
567  if ( destDataObjInfo->dataId <= 0 ) {
568  destDataObjInfo->dataId = srcDataObjInfo->dataId;
569  }
570  regReplicaInp.srcDataObjInfo = srcDataObjInfo;
571  regReplicaInp.destDataObjInfo = destDataObjInfo;
572  if ( getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
573  SU_CLIENT_USER_KW ) != NULL ) {
574  addKeyVal( &regReplicaInp.condInput, SU_CLIENT_USER_KW, "" );
575  addKeyVal( &regReplicaInp.condInput, ADMIN_KW, "" );
576  }
577  else if ( getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
578  ADMIN_KW ) != NULL ) {
579  addKeyVal( &regReplicaInp.condInput, ADMIN_KW, "" );
580  }
581 
582  char* pdmo_kw = getValByKey( &dataObjCloseInp->condInput, IN_PDMO_KW );
583  if ( pdmo_kw ) {
584  addKeyVal( &regReplicaInp.condInput, IN_PDMO_KW, pdmo_kw );
585  }
586  // Store openType in key/val in case a hop occurs
587  addKeyVal(&regReplicaInp.condInput, OPEN_TYPE_KW, std::to_string(L1desc[l1descInx].openType).c_str());
588 
589  status = rsRegReplica( rsComm, &regReplicaInp );
590  clearKeyVal( &regReplicaInp.condInput );
591 
592  // update datasize in catalog if there is a mismatch between
593  // what is expected and what was actually written to the resource
594  if ( srcDataObjInfo->dataSize != newSize ) {
595  srcDataObjInfo->dataSize = newSize;
596  status = _modDataObjSize( rsComm, l1descInx, srcDataObjInfo );
597  if ( status < 0 ) {
599  "_rsDataObjClose: _modDataObjSize srcDataObjInfo failed, status = [%d]", status );
600  return status;
601  }
602  }
603  if ( destDataObjInfo->dataSize != newSize ) {
604  destDataObjInfo->dataSize = newSize;
605  status = _modDataObjSize( rsComm, l1descInx, destDataObjInfo );
606  if ( status < 0 ) {
608  "_rsDataObjClose: _modDataObjSize destDataObjInfo failed, status = [%d]", status );
609  return status;
610  }
611  }
612 
613  /* update quota overrun */
614  updatequotaOverrun( destDataObjInfo->rescHier,
615  destDataObjInfo->dataSize, ALL_QUOTA );
616 
617  }
618 
619  clearKeyVal( &regParam );
620 
621  if ( status < 0 ) {
622  L1desc[l1descInx].oprStatus = status;
623  // =-=-=-=-=-=-=-
624  // JMC - backport 4608
625  /* don't delete replica with the same filePath */
627  l3Unlink( rsComm, L1desc[l1descInx].dataObjInfo );
628  }
629  // =-=-=-=-=-=-=-
631  "_rsDataObjClose: RegReplica/ModDataObjMeta %s err. stat = %d",
632  destDataObjInfo->objPath, status );
633  return status;
634  }
635  }
636  else if ( L1desc[l1descInx].dataObjInfo->specColl == NULL ) {
637  /* put or copy */
638  if ( l3descInx < 2 &&
639  getValByKey( &L1desc[l1descInx].dataObjInp->condInput,
640  CROSS_ZONE_CREATE_KW ) != NULL &&
641  L1desc[l1descInx].replStatus == NEWLY_CREATED_COPY ) {
642  /* the comes from a cross zone copy. have not been
643  * registered yet */
644  status = svrRegDataObj( rsComm, L1desc[l1descInx].dataObjInfo );
645  if ( status < 0 ) {
646  L1desc[l1descInx].oprStatus = status;
648  "_rsDataObjClose: svrRegDataObj for %s failed, status = %d",
649  L1desc[l1descInx].dataObjInfo->objPath, status );
650  }
651  }
652 
653  if ( L1desc[l1descInx].dataObjInfo->dataSize != newSize ) {
654  snprintf( tmpStr, MAX_NAME_LEN, "%lld", newSize );
655  addKeyVal( &regParam, DATA_SIZE_KW, tmpStr );
656  /* update this in case we need to replicate it */
657  L1desc[l1descInx].dataObjInfo->dataSize = newSize;
658  }
659 
660  if ( !checksum.empty() ) {
661  addKeyVal( &regParam, CHKSUM_KW, checksum.c_str() );
662  }
663 
664  if ( L1desc[l1descInx].replStatus & OPEN_EXISTING_COPY ) {
665  addKeyVal( &regParam, ALL_REPL_STATUS_KW, "TRUE" );
666  snprintf( tmpStr, MAX_NAME_LEN, "%d", ( int ) time( NULL ) );
667  addKeyVal( &regParam, DATA_MODIFY_KW, tmpStr );
668  }
669  else {
670  snprintf( tmpStr, MAX_NAME_LEN, "%d", NEWLY_CREATED_COPY );
671  addKeyVal( &regParam, REPL_STATUS_KW, tmpStr );
672  }
673  modDataObjMetaInp.dataObjInfo = L1desc[l1descInx].dataObjInfo;
674  modDataObjMetaInp.regParam = &regParam;
675  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
676  clearKeyVal( &regParam );
677 
678  if ( status < 0 ) {
679  return status;
680  }
681 
682 
683  try {
684  applyACLFromKVP(rsComm, L1desc[l1descInx].dataObjInp);
685  applyMetadataFromKVP(rsComm, L1desc[l1descInx].dataObjInp);
686  }
687  catch ( const irods::exception& e ) {
688  rodsLog( LOG_ERROR, "%s", e.what() );
689  if ( L1desc[l1descInx].dataObjInp->oprType == PUT_OPR ) {
690  rsDataObjUnlink( rsComm, L1desc[l1descInx].dataObjInp );
691  }
692  return e.code();
693  }
694 
695  if ( L1desc[l1descInx].replStatus == NEWLY_CREATED_COPY ) {
696  /* update quota overrun */
697  updatequotaOverrun( L1desc[l1descInx].dataObjInfo->rescHier,
698  newSize, ALL_QUOTA );
699  }
700  }
701 
702  // =-=-=-=-=-=-=-
703  // JMC - backport 4537
704  /* purge the cache copy */
705  if ( L1desc[l1descInx].purgeCacheFlag > 0 ) {
706  int status1 = trimDataObjInfo( rsComm,
707  L1desc[l1descInx].dataObjInfo );
708  if ( status1 < 0 ) {
709  rodsLogError( LOG_ERROR, status1,
710  "_rsDataObjClose: trimDataObjInfo error for %s",
711  L1desc[l1descInx].dataObjInfo->objPath );
712  }
713  }
714 
715  /* for post processing */
716  L1desc[l1descInx].bytesWritten =
717  L1desc[l1descInx].dataObjInfo->dataSize = newSize;
718 
719  return status;
720 }
721 
722 int
723 l3Close( rsComm_t *rsComm, int l1descInx ) {
724  fileCloseInp_t fileCloseInp;
725  int status = 0;
726  dataObjInfo_t* dataObjInfo = L1desc[l1descInx].dataObjInfo;
727 
728  std::string location;
729  irods::error ret = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
730  if ( !ret.ok() ) {
731  irods::log( PASSMSG( "l3Close - failed in get_loc_for_hier_string", ret ) );
732  return -1;
733  }
734 
735 
736  if ( getStructFileType( dataObjInfo->specColl ) >= 0 ) {
737  subStructFileFdOprInp_t subStructFileCloseInp;
738  memset( &subStructFileCloseInp, 0, sizeof( subStructFileCloseInp ) );
739  subStructFileCloseInp.type = dataObjInfo->specColl->type;
740  subStructFileCloseInp.fd = L1desc[l1descInx].l3descInx;
741  rstrcpy( subStructFileCloseInp.addr.hostAddr, location.c_str(), NAME_LEN );
742  rstrcpy( subStructFileCloseInp.resc_hier, dataObjInfo->rescHier, MAX_NAME_LEN );
743  status = rsSubStructFileClose( rsComm, &subStructFileCloseInp );
744  }
745  else {
746  memset( &fileCloseInp, 0, sizeof( fileCloseInp ) );
747  fileCloseInp.fileInx = L1desc[l1descInx].l3descInx;
748  rstrcpy( fileCloseInp.in_pdmo, L1desc[l1descInx].in_pdmo, MAX_NAME_LEN );
749  status = rsFileClose( rsComm, &fileCloseInp );
750 
751  }
752  return status;
753 }
754 
755 int
756 _l3Close( rsComm_t *rsComm, int l3descInx ) {
757  fileCloseInp_t fileCloseInp;
758  int status;
759 
760  memset( &fileCloseInp, 0, sizeof( fileCloseInp ) );
761  fileCloseInp.fileInx = l3descInx;
762  status = rsFileClose( rsComm, &fileCloseInp );
763 
764  return status;
765 }
766 
767 int
768 l3Stat( rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, rodsStat_t **myStat ) {
769  fileStatInp_t fileStatInp;
770  int status;
771 
772  if ( getStructFileType( dataObjInfo->specColl ) >= 0 ) {
773 
774  std::string location;
775  irods::error ret = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
776  if ( !ret.ok() ) {
777  irods::log( PASSMSG( "l3Stat - failed in get_loc_for_hier_string", ret ) );
778  return -1;
779  }
780 
781  subFile_t subFile;
782  memset( &subFile, 0, sizeof( subFile ) );
783  rstrcpy( subFile.subFilePath, dataObjInfo->subPath, MAX_NAME_LEN );
784  rstrcpy( subFile.addr.hostAddr, location.c_str(), NAME_LEN );
785 
786  subFile.specColl = dataObjInfo->specColl;
787  status = rsSubStructFileStat( rsComm, &subFile, myStat );
788  }
789  else {
790  memset( &fileStatInp, 0, sizeof( fileStatInp ) );
791  rstrcpy( fileStatInp.fileName, dataObjInfo->filePath,
792  MAX_NAME_LEN );
793  //rstrcpy( fileStatInp.addr.hostAddr, dataObjInfo->rescInfo->rescLoc, NAME_LEN );
794  rstrcpy( fileStatInp.rescHier, dataObjInfo->rescHier, MAX_NAME_LEN );
795  rstrcpy( fileStatInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN );
796  status = rsFileStat( rsComm, &fileStatInp, myStat );
797  }
798  return status;
799 }
800 
801 /* procChksumForClose - handle checksum issues on close. Returns a non-null
802  * chksumStr if it needs to be registered.
803  */
804 int
806  rsComm_t *rsComm,
807  int l1descInx,
808  char **chksumStr ) {
809  int status = 0;
810  dataObjInfo_t *dataObjInfo = L1desc[l1descInx].dataObjInfo;
811  int oprType = L1desc[l1descInx].oprType;
812  int srcL1descInx = 0;
813  dataObjInfo_t *srcDataObjInfo;
814 
815  *chksumStr = NULL;
816  if ( oprType == REPLICATE_DEST || oprType == PHYMV_DEST ) {
817  srcL1descInx = L1desc[l1descInx].srcL1descInx;
818  if ( srcL1descInx <= 2 ) {
820  "procChksumForClose: srcL1descInx %d out of range",
821  srcL1descInx );
823  }
824 
825  srcDataObjInfo = L1desc[srcL1descInx].dataObjInfo;
826  if ( strlen( srcDataObjInfo->chksum ) > 0 ) {
827  addKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW, srcDataObjInfo->chksum );
828  }
829 
830  if ( strlen( srcDataObjInfo->chksum ) > 0 &&
831  srcDataObjInfo->replStatus > 0 ) {
832  /* the source has chksum. Must verify chksum */
833  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
834  if ( status < 0 ) {
835  dataObjInfo->chksum[0] = '\0';
836  if ( status == DIRECT_ARCHIVE_ACCESS ) {
837  *chksumStr = strdup( srcDataObjInfo->chksum );
838  rstrcpy( dataObjInfo->chksum, *chksumStr, NAME_LEN );
839  return 0;
840  }
841  else {
843  "procChksumForClose: _dataObjChksum error for %s, status = %d",
844  dataObjInfo->objPath, status );
845  return status;
846  }
847  }
848  else if ( *chksumStr == NULL ) {
849  rodsLog( LOG_ERROR, "chksumStr is NULL" );
851  }
852  else {
853  rstrcpy( dataObjInfo->chksum, *chksumStr, NAME_LEN );
854  if ( strcmp( srcDataObjInfo->chksum, *chksumStr ) != 0 ) {
856  "procChksumForClose: chksum mismatch for %s src [%s] new [%s]",
857  dataObjInfo->objPath, srcDataObjInfo->chksum, *chksumStr );
858  free( *chksumStr );
859  *chksumStr = NULL;
860  return USER_CHKSUM_MISMATCH;
861  }
862  else {
863  return 0;
864  }
865  }
866  }
867  }
868 
869  /* overwriting an old copy. need to verify the chksum again */
870  if ( strlen( L1desc[l1descInx].dataObjInfo->chksum ) > 0 && !L1desc[l1descInx].chksumFlag ) {
871  L1desc[l1descInx].chksumFlag = VERIFY_CHKSUM;
872  }
873 
874  if ( L1desc[l1descInx].chksumFlag == 0 ) {
875  return 0;
876  }
877  else if ( L1desc[l1descInx].chksumFlag == VERIFY_CHKSUM ) {
878  if ( strlen( L1desc[l1descInx].chksum ) > 0 ) {
879  if ( strlen( L1desc[l1descInx].chksum ) > 0 ) {
880  addKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW, L1desc[l1descInx].chksum );
881  }
882 
883  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
884 
885  rmKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW );
886  if ( status < 0 ) {
887  return status;
888  }
889  /* from a put type operation */
890  /* verify against the input value. */
891  if ( strcmp( L1desc[l1descInx].chksum, *chksumStr ) != 0 ) {
893  "procChksumForClose: mismatch chksum for %s.inp=%s,compute %s",
894  dataObjInfo->objPath,
895  L1desc[l1descInx].chksum, *chksumStr );
896  free( *chksumStr );
897  *chksumStr = NULL;
898  return USER_CHKSUM_MISMATCH;
899  }
900 
901  if ( strcmp( dataObjInfo->chksum, *chksumStr ) == 0 ) {
902  /* the same as in rcat */
903  free( *chksumStr );
904  *chksumStr = NULL;
905  }
906  }
907  else if ( oprType == REPLICATE_DEST ) {
908  if ( strlen( dataObjInfo->chksum ) > 0 ) {
909  addKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW, dataObjInfo->chksum );
910 
911  }
912  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
913  if ( status < 0 ) {
914  return status;
915  }
916  if ( *chksumStr == NULL ) {
917  rodsLog( LOG_ERROR, "chksumStr is NULL" );
919  }
920 
921  if ( strlen( dataObjInfo->chksum ) > 0 ) {
922  rmKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW );
923 
924  /* for replication, the chksum in dataObjInfo was duplicated */
925  if ( strcmp( dataObjInfo->chksum, *chksumStr ) != 0 ) {
927  "procChksumForClose:mismach chksum for %s.Rcat=%s,comp %s",
928  dataObjInfo->objPath, dataObjInfo->chksum, *chksumStr );
930  }
931  else {
932  /* not need to register because reg repl will do it */
933  free( *chksumStr );
934  *chksumStr = NULL;
935  status = 0;
936  }
937  }
938  return status;
939  }
940  else if ( oprType == COPY_DEST ) {
941  /* created through copy */
942  srcL1descInx = L1desc[l1descInx].srcL1descInx;
943  if ( srcL1descInx <= 2 ) {
944  /* not a valid srcL1descInx */
946  "procChksumForClose: invalid srcL1descInx %d for copy",
947  srcL1descInx );
948  /* just register it for now */
949  return 0;
950  }
951  srcDataObjInfo = L1desc[srcL1descInx].dataObjInfo;
952  if ( strlen( srcDataObjInfo->chksum ) > 0 ) {
953  addKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW, srcDataObjInfo->chksum );
954 
955  }
956  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
957  if ( status < 0 ) {
958  return status;
959  }
960  if ( *chksumStr == NULL ) {
961  rodsLog( LOG_ERROR, "chkSumStr is null." );
963  }
964  if ( strlen( srcDataObjInfo->chksum ) > 0 ) {
965  rmKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW );
966  if ( strcmp( srcDataObjInfo->chksum, *chksumStr ) != 0 ) {
968  "procChksumForClose:mismach chksum for %s.Rcat=%s,comp %s",
969  dataObjInfo->objPath, srcDataObjInfo->chksum, *chksumStr );
970  free( *chksumStr );
971  *chksumStr = NULL;
972  return USER_CHKSUM_MISMATCH;
973  }
974  }
975  /* just register it */
976  return 0;
977  }
978  }
979  else { /* REG_CHKSUM */
980  if ( strlen( L1desc[l1descInx].chksum ) > 0 ) {
981  addKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW, L1desc[l1descInx].chksum );
982  }
983 
984  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
985  if ( status < 0 ) {
986  return status;
987  }
988 
989  if ( strlen( L1desc[l1descInx].chksum ) > 0 ) {
990  rmKeyVal( &dataObjInfo->condInput, ORIG_CHKSUM_KW );
991  /* from a put type operation */
992 
993  if ( strcmp( dataObjInfo->chksum, L1desc[l1descInx].chksum ) == 0 ) {
994  /* same as in icat */
995  free( *chksumStr );
996  *chksumStr = NULL;
997  }
998  return 0;
999  }
1000  else if ( oprType == COPY_DEST ) {
1001  /* created through copy */
1002  srcL1descInx = L1desc[l1descInx].srcL1descInx;
1003  if ( srcL1descInx <= 2 ) {
1004  /* not a valid srcL1descInx */
1005  rodsLog( LOG_DEBUG,
1006  "procChksumForClose: invalid srcL1descInx %d for copy",
1007  srcL1descInx );
1008  return 0;
1009  }
1010  srcDataObjInfo = L1desc[srcL1descInx].dataObjInfo;
1011  if ( strlen( srcDataObjInfo->chksum ) == 0 ) {
1012  free( *chksumStr );
1013  *chksumStr = NULL;
1014  }
1015  }
1016  return 0;
1017  }
1018  return status;
1019 }
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
OpenedDataObjInp
Definition: dataObjInpOut.h:104
L1desc
l1desc_t L1desc[1026]
Definition: irods_server_globals.cpp:29
RESC_NAME_KW
#define RESC_NAME_KW
Definition: rodsKeyWdDef.h:19
NULL
#define NULL
Definition: rodsDef.h:70
regDataObj.h
SubStructFileFdOpr::addr
rodsHostAddr_t addr
Definition: subStructFileRead.h:9
rsComm_t
Definition: rcConnect.h:145
applyMetadataFromKVP
void applyMetadataFromKVP(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: miscServerFunct.cpp:3199
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
UNKNOWN_FILE_SZ
#define UNKNOWN_FILE_SZ
Definition: rodsDef.h:92
NEWLY_CREATED_COPY
#define NEWLY_CREATED_COPY
Definition: objInfo.h:115
DATA_MODIFY_KW
#define DATA_MODIFY_KW
Definition: rodsKeyWdDef.h:42
irods_server_properties.hpp
modDataObjMeta.h
rsGetRescQuota.hpp
Subfile
Definition: objInfo.h:316
FILE_PATH_HAS_CHG
#define FILE_PATH_HAS_CHG
Definition: objInfo.h:117
irods_file_object.hpp
irods_stacktrace.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
l1desc::lockFd
int lockFd
Definition: objDesc.hpp:55
l1desc::dataSize
rodsLong_t dataSize
Definition: objDesc.hpp:46
Subfile::subFilePath
char subFilePath[(1024+64)]
Definition: objInfo.h:318
CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME
@ CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME
Definition: rodsErrorTable.h:424
OpenedDataObjInp::l1descInx
int l1descInx
Definition: dataObjInpOut.h:105
REPLICATE_SRC
#define REPLICATE_SRC
Definition: dataObjInpOut.h:174
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
irods_exception.hpp
CHKSUM_KW
#define CHKSUM_KW
Definition: rodsKeyWdDef.h:25
rsFileStat
int rsFileStat(rsComm_t *rsComm, fileStatInp_t *fileStatInp, rodsStat_t **fileStatOut)
Definition: rsFileStat.cpp:18
applyACLFromKVP
void applyACLFromKVP(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: miscServerFunct.cpp:3227
_l3Close
int _l3Close(rsComm_t *rsComm, int l3descInx)
Definition: rsDataObjClose.cpp:756
l1desc::oprStatus
int oprStatus
Definition: objDesc.hpp:39
l1desc::remoteL1descInx
int remoteL1descInx
Definition: objDesc.hpp:52
PUT_OPR
#define PUT_OPR
Definition: dataObjInpOut.h:167
rsSubStructFileClose.hpp
fileStatInp_t
Definition: fileStat.h:7
SpecColl::type
structFileType_t type
Definition: objInfo.h:78
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
RuleExecInfo::doi
dataObjInfo_t * doi
Definition: irods_re_structs.hpp:28
DataObjInfo::condInput
keyValPair_t condInput
Definition: objInfo.h:161
irods_resource_backport.hpp
Subfile::specColl
specColl_t * specColl
Definition: objInfo.h:322
l1desc::oprType
int oprType
Definition: objDesc.hpp:37
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
l1desc::in_pdmo
char in_pdmo[(1024+64)]
Definition: objDesc.hpp:60
l1desc::chksumFlag
int chksumFlag
Definition: objDesc.hpp:49
fileStat.h
rcGlobalExtern.h
DataObjInfo::filePath
char filePath[(1024+64)]
Definition: objInfo.h:137
FileCloseInp::in_pdmo
char in_pdmo[(1024+64)]
Definition: fileClose.h:8
CROSS_ZONE_CREATE_KW
#define CROSS_ZONE_CREATE_KW
Definition: rodsKeyWdDef.h:83
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
rsDataObjTrim.hpp
DATA_SIZE_KW
#define DATA_SIZE_KW
Definition: rodsKeyWdDef.h:24
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
DataObjInfo::dataId
rodsLong_t dataId
Definition: objInfo.h:143
ALL_QUOTA
#define ALL_QUOTA
Definition: getRescQuota.h:16
DataObjInfo::specColl
specColl_t * specColl
Definition: objInfo.h:158
l1desc::openType
int openType
Definition: objDesc.hpp:38
REPL_STATUS_KW
#define REPL_STATUS_KW
Definition: rodsKeyWdDef.h:32
CREATE_TYPE
#define CREATE_TYPE
Definition: dataObjInpOut.h:193
regReplica_t::condInput
keyValPair_t condInput
Definition: regReplica.h:10
l1desc::chksum
char chksum[64]
Definition: objDesc.hpp:51
rsFileClose.hpp
irods::get_resc_properties_as_kvp
error get_resc_properties_as_kvp(const std::string &, keyValPair_t *)
Definition: irods_resource_backport.cpp:500
SubStructFileFdOpr
Definition: subStructFileRead.h:8
fileClose.h
rsSubStructFileStat
int rsSubStructFileStat(rsComm_t *rsComm, subFile_t *subFile, rodsStat_t **subStructFileStatOut)
Definition: rsSubStructFileStat.cpp:14
initReiWithDataObjInp
int initReiWithDataObjInp(ruleExecInfo_t *rei, rsComm_t *rsComm, dataObjInp_t *dataObjIn)
Definition: irods_re_structs.cpp:164
FileCloseInp
Definition: fileClose.h:6
PHYMV_OPR
#define PHYMV_OPR
Definition: dataObjInpOut.h:181
irods_serialization.hpp
regReplica_t::destDataObjInfo
dataObjInfo_t * destDataObjInfo
Definition: regReplica.h:9
RuleExecInfo::condInputData
keyValPair_t * condInputData
Definition: irods_re_structs.hpp:34
rsGlobalExtern.hpp
rsFileStat.hpp
rodsStat
Definition: rodsType.h:52
RESC_HIER_STR_KW
#define RESC_HIER_STR_KW
Definition: rodsKeyWdDef.h:225
fileStatInp_t::rescHier
char rescHier[(1024+64)]
Definition: fileStat.h:10
SYS_COPY_LEN_ERR
@ SYS_COPY_LEN_ERR
Definition: rodsErrorTable.h:95
fileStatInp_t::objPath
char objPath[(1024+64)]
Definition: fileStat.h:11
FileCloseInp::fileInx
int fileInx
Definition: fileClose.h:7
PHYMV_DEST
#define PHYMV_DEST
Definition: dataObjInpOut.h:183
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
OpenedDataObjInp::bytesWritten
rodsLong_t bytesWritten
Definition: dataObjInpOut.h:110
ruleExecSubmit.h
OPEN_TYPE_KW
#define OPEN_TYPE_KW
Definition: rodsKeyWdDef.h:95
rsRegReplica
int rsRegReplica(rsComm_t *rsComm, regReplica_t *regReplicaInp)
Definition: rsRegReplica.cpp:187
rsDataObjClose.hpp
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
getRescQuota.h
OPEN_EXISTING_COPY
#define OPEN_EXISTING_COPY
Definition: objInfo.h:116
RESC_QUOTA
#define RESC_QUOTA
Definition: getRescQuota.h:15
Subfile::addr
rodsHostAddr_t addr
Definition: objInfo.h:317
rmKeyVal
int rmKeyVal(keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:710
SU_CLIENT_USER_KW
#define SU_CLIENT_USER_KW
Definition: rodsKeyWdDef.h:86
ADMIN_KW
#define ADMIN_KW
Definition: rodsKeyWdDef.h:62
REG_CHKSUM
#define REG_CHKSUM
Definition: objDesc.hpp:29
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irsDataObjClose
int irsDataObjClose(rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp, dataObjInfo_t **outDataObjInfo)
Definition: rsDataObjClose.cpp:63
updatequotaOverrun
int updatequotaOverrun(const char *_resc_hier, rodsLong_t dataSize, int flags)
Definition: rsGetRescQuota.cpp:296
l1desc::srcL1descInx
int srcL1descInx
Definition: objDesc.hpp:50
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
modDataObjMeta_t::regParam
keyValPair_t * regParam
Definition: modDataObjMeta.h:9
rsFileClose
int rsFileClose(rsComm_t *rsComm, fileCloseInp_t *fileCloseInp)
Definition: rsFileClose.cpp:18
rsSubStructFileStat.hpp
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
dataObjClose.h
getSizeInVault
rodsLong_t getSizeInVault(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:396
regReplica.h
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
NUM_L1_DESC
#define NUM_L1_DESC
Definition: objDesc.hpp:24
regReplica_t::srcDataObjInfo
dataObjInfo_t * srcDataObjInfo
Definition: regReplica.h:8
int
typedef int((*funcPtr)())
modDataObjMeta_t::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: modDataObjMeta.h:8
OPEN_FOR_READ_TYPE
#define OPEN_FOR_READ_TYPE
Definition: dataObjInpOut.h:194
trimDataObjInfo
int trimDataObjInfo(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: rsDataObjTrim.cpp:159
dataObjRepl.h
apiNumber.h
DataObjInfo::chksum
char chksum[64]
Definition: objInfo.h:135
NO_CHK_COPY_LEN_KW
#define NO_CHK_COPY_LEN_KW
Definition: rodsKeyWdDef.h:108
BAD_INPUT_DESC_INDEX
@ BAD_INPUT_DESC_INDEX
Definition: rodsErrorTable.h:266
FD_INUSE
#define FD_INUSE
Definition: fileOpr.hpp:21
SubStructFileFdOpr::resc_hier
char resc_hier[(1024+64)]
Definition: subStructFileRead.h:13
subStructFileStat.h
OpenedDataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:111
IN_PDMO_KW
#define IN_PDMO_KW
Definition: rodsKeyWdDef.h:227
REPLICATE_OPR
#define REPLICATE_OPR
Definition: dataObjInpOut.h:172
SubStructFileFdOpr::fd
int fd
Definition: subStructFileRead.h:11
irods_hierarchy_parser.hpp
_modDataObjSize
int _modDataObjSize(rsComm_t *_comm, int _l1descInx, dataObjInfo_t *_info)
Definition: rsDataObjClose.cpp:256
SubStructFileFdOpr::type
structFileType_t type
Definition: subStructFileRead.h:10
COPY_DEST
#define COPY_DEST
Definition: dataObjInpOut.h:175
ORIG_CHKSUM_KW
#define ORIG_CHKSUM_KW
Definition: rodsKeyWdDef.h:26
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
fileStatInp_t::fileName
char fileName[(1024+64)]
Definition: fileStat.h:9
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
DATA_OBJ_UNLOCK_AN
#define DATA_OBJ_UNLOCK_AN
Definition: apiNumber.h:109
l1desc::bytesWritten
rodsLong_t bytesWritten
Definition: objDesc.hpp:45
RuleExecInfo
Definition: irods_re_structs.hpp:18
rsModDataObjMeta
int rsModDataObjMeta(rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
Definition: rsModDataObjMeta.cpp:23
modAVUMetadata.h
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
l3Stat
int l3Stat(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, rodsStat_t **myStat)
Definition: rsDataObjClose.cpp:768
rsModDataObjMeta.hpp
irods_server_api_call.hpp
applyRule
int applyRule(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:65
subStructFileClose.h
resource.hpp
irods::exception
Definition: irods_exception.hpp:15
rsRegReplica.hpp
l1desc::replStatus
int replStatus
Definition: objDesc.hpp:48
rsSubStructFileClose
int rsSubStructFileClose(rsComm_t *rsComm, subStructFileFdOprInp_t *subStructFileCloseInp)
Definition: rsSubStructFileClose.cpp:12
ALL_REPL_STATUS_KW
#define ALL_REPL_STATUS_KW
Definition: rodsKeyWdDef.h:33
DataObjInfo::objPath
char objPath[(1024+64)]
Definition: objInfo.h:130
l3Close
int l3Close(rsComm_t *rsComm, int l1descInx)
Definition: rsDataObjClose.cpp:723
rsRegDataObj.hpp
rsDataObjClose
int rsDataObjClose(rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp)
Definition: rsDataObjClose.cpp:56
_dataObjChksum
int _dataObjChksum(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, char **chksumStr)
Definition: physPath.cpp:421
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
dataObjOpr.hpp
dataObjLock.h
modDataObjMeta_t
Definition: modDataObjMeta.h:7
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_FILE_DESC_OUT_OF_RANGE
@ SYS_FILE_DESC_OUT_OF_RANGE
Definition: rodsErrorTable.h:87
REPLICATE_DEST
#define REPLICATE_DEST
Definition: dataObjInpOut.h:173
regReplica_t
Definition: regReplica.h:7
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
freeL1desc
int freeL1desc(int l1descInx)
Definition: objDesc.cpp:124
KeyValPair
Definition: objInfo.h:120
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
_rsDataObjClose
int _rsDataObjClose(rsComm_t *rsComm, openedDataObjInp_t *dataObjCloseInp)
Definition: rsDataObjClose.cpp:286
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
FILE_PATH_KW
#define FILE_PATH_KW
Definition: rodsKeyWdDef.h:28
procChksumForClose
int procChksumForClose(rsComm_t *rsComm, int l1descInx, char **chksumStr)
Definition: rsDataObjClose.cpp:805
DataObjInfo
Definition: objInfo.h:129
dataObjTrim.h
DataObjInfo::dataSize
rodsLong_t dataSize
Definition: objInfo.h:134
DIRECT_ARCHIVE_ACCESS
@ DIRECT_ARCHIVE_ACCESS
Definition: rodsErrorTable.h:763
USER_CHKSUM_MISMATCH
@ USER_CHKSUM_MISMATCH
Definition: rodsErrorTable.h:245
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
VERIFY_CHKSUM
#define VERIFY_CHKSUM
Definition: objDesc.hpp:30
objMetaOpr.hpp
DataObjInfo::subPath
char subPath[(1024+64)]
Definition: objInfo.h:157
rcDataObjClose
int rcDataObjClose(rcComm_t *conn, openedDataObjInp_t *dataObjCloseInp)
Definition: rcDataObjClose.cpp:63
subStructFileRead.h