|
@@ -889,13 +889,11 @@ public:
|
|
|
|
|
|
IDistributedFile *lookup(const char *_logicalname, IUserDescriptor *user, bool writeattr, bool hold, IDistributedFileTransaction *transaction, unsigned timeout);
|
|
|
IDistributedFile *lookup(CDfsLogicalFileName &logicalname, IUserDescriptor *user, bool writeattr, bool hold, IDistributedFileTransaction *transaction, unsigned timeout);
|
|
|
-
|
|
|
- IDistributedFile *createNew(IFileDescriptor * fdesc, const char *lname,bool includeports=false);
|
|
|
- IDistributedFile *createNew(IFileDescriptor * fdesc, bool includeports=false)
|
|
|
- {
|
|
|
- return createNew(fdesc,NULL,includeports);
|
|
|
- }
|
|
|
- IDistributedFile *createNew(IPropertyTree *tree,bool ignoregroup);
|
|
|
+
|
|
|
+ /* createNew always creates an unnamed unattached distributed file
|
|
|
+ * The caller must associated it with a name and credentials when it is attached (attach())
|
|
|
+ */
|
|
|
+ IDistributedFile *createNew(IFileDescriptor * fdesc, bool includeports=false);
|
|
|
IDistributedSuperFile *createSuperFile(const char *logicalname,IUserDescriptor *user,bool interleaved,bool ifdoesnotexist,IDistributedFileTransaction *transaction=NULL);
|
|
|
void removeSuperFile(const char *_logicalname, bool delSubs, IUserDescriptor *user, IDistributedFileTransaction *transaction);
|
|
|
|
|
@@ -3197,7 +3195,7 @@ public:
|
|
|
//shrinkFileTree(root); // enable when safe!
|
|
|
}
|
|
|
|
|
|
- CDistributedFile(CDistributedFileDirectory *_parent, IFileDescriptor *fdesc, bool includeports)
|
|
|
+ CDistributedFile(CDistributedFileDirectory *_parent, IFileDescriptor *fdesc, IUserDescriptor *user, bool includeports)
|
|
|
{
|
|
|
#ifdef EXTRA_LOGGING
|
|
|
LOGFDESC("CDistributedFile.b fdesc",fdesc);
|
|
@@ -3210,6 +3208,7 @@ public:
|
|
|
setPreferredClusters(_parent->defprefclusters);
|
|
|
saveClusters();
|
|
|
setParts(fdesc,true);
|
|
|
+ udesc.set(user);
|
|
|
#ifdef EXTRA_LOGGING
|
|
|
LOGPTREE("CDistributedFile.b root.1",root);
|
|
|
#endif
|
|
@@ -3739,6 +3738,7 @@ public:
|
|
|
setFileAttrs(fdesc,false);
|
|
|
setClusters(fdesc);
|
|
|
setParts(fdesc,false);
|
|
|
+ setUserDescriptor(udesc, user);
|
|
|
#ifdef EXTRA_LOGGING
|
|
|
LOGFDESC("CDistributedFile::attach fdesc",fdesc);
|
|
|
LOGPTREE("CDistributedFile::attach root.2",root);
|
|
@@ -7161,10 +7161,10 @@ IDistributedFile *CDistributedFileDirectory::createExternal(const CDfsLogicalFil
|
|
|
fileDesc->setPart(i,rfn);
|
|
|
}
|
|
|
fileDesc->queryPartDiskMapping(0).defaultCopies = DFD_NoCopies;
|
|
|
- IDistributedFile * ret = createNew(fileDesc,logicalname.get(),true); // set modified
|
|
|
- if (ret&&moddtset) {
|
|
|
+ CDistributedFile *ret = new CDistributedFile(this, fileDesc, NULL, true); // sets modified
|
|
|
+ ret->setLogicalName(logicalname.get());
|
|
|
+ if (moddtset)
|
|
|
ret->setModificationTime(moddt);
|
|
|
- }
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -7333,12 +7333,9 @@ bool CDistributedFileDirectory::existsPhysical(const char *_logicalname, IUserDe
|
|
|
return file->existsPhysicalPartFiles(0);
|
|
|
}
|
|
|
|
|
|
-IDistributedFile *CDistributedFileDirectory::createNew(IFileDescriptor *fdesc,const char *lname, bool includeports)
|
|
|
+IDistributedFile *CDistributedFileDirectory::createNew(IFileDescriptor *fdesc, bool includeports)
|
|
|
{
|
|
|
- CDistributedFile *file = new CDistributedFile(this, fdesc, includeports);
|
|
|
- if (file&&lname&&*lname&&file->isAnon())
|
|
|
- file->setLogicalName(lname);
|
|
|
- return file;
|
|
|
+ return new CDistributedFile(this, fdesc, NULL, includeports);
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////
|
|
@@ -10134,7 +10131,8 @@ IDistributedFile *CDistributedFileDirectory::getFile(const char *lname,IUserDesc
|
|
|
if (!fdesc)
|
|
|
return NULL;
|
|
|
fdesc->setTraceName(lname);
|
|
|
- IDistributedFile *ret = createNew(fdesc,lname,true);
|
|
|
+ CDistributedFile *ret = new CDistributedFile(this, fdesc, user, true);
|
|
|
+ ret->setLogicalName(lname);
|
|
|
const char *date = tree->queryProp("@modified");
|
|
|
if (ret) {
|
|
|
CDateTime dt;
|