43 memset( &genQueryInp, 0,
sizeof( genQueryInp ) );
45 snprintf( condStr,
MAX_NAME_LEN,
"parent_of '%s'", objPath );
95 char *tmpDataId, *tmpOwnerName, *tmpOwnerZone, *tmpCreateTime,
96 *tmpModifyTime, *tmpCollType, *tmpCollection, *tmpCollInfo1,
102 "queueSpecCollCache: getSqlResultByInx for COL_COLL_ID failed" );
108 "queueSpecCollCache:getSqlResultByInx for COL_COLL_OWNER_NAME failed" );
114 "queueSpecCollCache:getSqlResultByInx for COL_COLL_OWNER_ZONE failed" );
120 "queueSpecCollCache:getSqlResultByInx for COL_COLL_CREATE_TIME failed" );
126 "queueSpecCollCache:getSqlResultByInx for COL_COLL_MODIFY_TIME failed" );
132 "queueSpecCollCache:getSqlResultByInx for COL_COLL_TYPE failed" );
138 "queueSpecCollCache:getSqlResultByInx for COL_COLL_NAME failed" );
144 "queueSpecCollCache:getSqlResultByInx for COL_COLL_INFO1 failed" );
150 "queueSpecCollCache:getSqlResultByInx for COL_COLL_INFO2 failed" );
154 for ( i = 0; i <= genQueryOut->
rowCnt; i++ ) {
158 tmpCollection = &collection->
value[collection->
len * i];
160 len = strlen( tmpCollection );
161 tmpPtr = objPath + len;
163 if ( *tmpPtr ==
'\0' || *tmpPtr ==
'/' ) {
167 tmpDataId = &dataId->
value[dataId->
len * i];
168 tmpOwnerName = &ownerName->
value[ownerName->
len * i];
169 tmpOwnerZone = &ownerZone->
value[ownerZone->
len * i];
170 tmpCreateTime = &createTime->
value[createTime->
len * i];
171 tmpModifyTime = &modifyTime->
value[modifyTime->
len * i];
173 tmpCollInfo1 = &collInfo1->
value[collInfo1->
len * i];
174 tmpCollInfo2 = &collInfo2->
value[collInfo2->
len * i];
176 specColl = &tmpSpecCollCache->
specColl;
179 free( tmpSpecCollCache );
190 rodsLog(
LOG_ERROR,
"queueSpecCollCache - getPhyPath failed for [%s] on resource [%s] with cache dir [%s] and collection [%s]",
192 free( tmpSpecCollCache );
239 while ( tmpSpecCollCache !=
NULL ) {
243 char *tmpPtr = objPath + len;
245 if ( *tmpPtr ==
'\0' || *tmpPtr ==
'/' ) {
246 return tmpSpecCollCache;
249 tmpSpecCollCache = tmpSpecCollCache->
next;
263 else if ( inCachOnly > 0 ) {
291 memset( &modCollInp, 0,
sizeof( modCollInp ) );
295 if ( clearFlag > 0 ) {
305 "tarSubStructFileWrite:rsModColl error for Coll %s,stat=%d",
327 &specCollCache ) ) < 0 ) {
331 "statPathInSpecColl: getSpecCollCache for %s, status = %d",
337 if ( *rodsObjStatOut ==
NULL ) {
341 specColl = &specCollCache->
specColl;
349 if ( dataObjInfo !=
NULL ) {
351 ( *rodsObjStatOut )->specColl = dataObjInfo->
specColl;
355 &( *rodsObjStatOut )->specColl );
358 rstrcpy( ( *rodsObjStatOut )->specColl->objPath,
362 ( *rodsObjStatOut )->specColl->objPath[0] =
'\0';
376 ( *rodsObjStatOut )->specColl = dataObjInfo->
specColl;
384 snprintf( ( *rodsObjStatOut )->dataId,
NAME_LEN,
"%lld",
387 rstrcpy( ( *rodsObjStatOut )->specColl->objPath,
391 ( *rodsObjStatOut )->objSize = dataObjInfo->
dataSize;
416 if ( dataObjInfo ==
NULL ) {
466 curSpecColl = specColl;
469 curSpecColl->
phyPath, subPath, newPath );
478 if ( specCollCache !=
NULL &&
482 newPath, specCollPerm, dataObjInfo );
485 bzero( &myDataObjInp,
sizeof( myDataObjInp ) );
489 if (
status >= 0 &&
NULL != rodsObjStatOut ) {
490 myDataObjInfo = *dataObjInfo =
495 myDataObjInfo->
dataId = strtoll( rodsObjStatOut->
dataId, 0, 0 );
519 myDataObjInfo = *dataObjInfo =
525 "specCollSubStat: getDataObjInfo error for %s, status = %d",
530 replSpecColl( curSpecColl, &( *dataObjInfo )->specColl );
540 bzero( &myDataObjInp,
sizeof( myDataObjInp ) );
547 "specCollSubStat: getDataObjInfo error for %s, status = %d",
557 "specCollSubStat: sortObjInfoForOpen error for %s. status = %d",
562 if ( strlen( specColl->
resource ) > 0 ) {
565 if ( strstr( ( *dataObjInfo )->rescHier,
568 "specCollSubStat: %s in %s does not match cache resc %s",
569 myDataObjInp.
objPath, ( *dataObjInfo )->rescName,
578 "specCollSubStat: requeDataObjInfoByResc %s, resc %s error",
587 if ( ( *dataObjInfo )->next !=
NULL ) {
589 ( *dataObjInfo )->next =
NULL;
593 tmpDataObjInfo = *dataObjInfo;
601 if ( strcmp( ( *dataObjInfo )->subPath, specColl->
collection ) == 0 ) {
608 "specCollSubStat: Unknown specColl collClass = %d",
651 if ( objPath ==
NULL ) {
655 &specCollCache ) ) < 0 ) {
660 cachedSpecColl = &specCollCache->
specColl;
671 if ( specCollCache->
perm < specCollPerm ) {
676 "resolvePathInSpecColl:checkCollAccessPerm err for %s,stat=%d",
681 specCollCache->
perm = specCollPerm;
687 specCollPerm, dataObjInfo );
690 if ( *dataObjInfo !=
NULL ) {
695 "resolvePathInSpecColl: specCollSubStat error for %s, status = %d",
700 if ( *dataObjInfo !=
NULL ) {
702 ( *dataObjInfo )->writeFlag = 1;
719 *specCollCache =
NULL;
727 ( *specCollCache )->specColl.collClass ==
LINKED_COLL ) {
728 oldSpecCollCache = *specCollCache;
731 "resolveLinkedPath: linkCnt for %s exceeds %d",
736 curSpecColl = &( *specCollCache )->specColl;
737 if ( strcmp( curSpecColl->
collection, objPath ) == 0 &&
743 curSpecColl->
phyPath, prevNewPath, objPath );
748 if ( *specCollCache ==
NULL ) {
749 *specCollCache = oldSpecCollCache;