nfs4: Add node to inode to file handle map before notifying
This commit is contained in:
@@ -252,6 +252,25 @@ DirectoryCache::NotifyChanges(DirectoryCacheSnapshot* oldSnapshot,
|
|||||||
} else {
|
} else {
|
||||||
notify_entry_created(fInode->GetFileSystem()->DevId(),
|
notify_entry_created(fInode->GetFileSystem()->DevId(),
|
||||||
fInode->ID(), newCurrent->fName, newCurrent->fNode);
|
fInode->ID(), newCurrent->fName, newCurrent->fNode);
|
||||||
|
|
||||||
|
FileInfo fi;
|
||||||
|
fi.fFileId = newCurrent->fNode;
|
||||||
|
fi.fParent = fInode->fInfo.fHandle;
|
||||||
|
fi.fName = strdup(newCurrent->fName);
|
||||||
|
if (fi.fName != NULL) {
|
||||||
|
size_t pathLength = strlen(newCurrent->fName) + 2 +
|
||||||
|
strlen(fInode->fInfo.fPath);
|
||||||
|
char* path = reinterpret_cast<char*>(malloc(pathLength));
|
||||||
|
if (path != NULL) {
|
||||||
|
strcpy(path, fInode->fInfo.fPath);
|
||||||
|
strcat(path, "/");
|
||||||
|
strcat(path, newCurrent->fName);
|
||||||
|
fi.fPath = path;
|
||||||
|
|
||||||
|
fInode->GetFileSystem()->InoIdMap()->AddEntry(fi,
|
||||||
|
Inode::FileIdToInoT(newCurrent->fNode));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
oldSnapshot->fEntries.Remove(prev, oldCurrent);
|
oldSnapshot->fEntries.Remove(prev, oldCurrent);
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public:
|
|||||||
|
|
||||||
status_t LoadAttrDirHandle();
|
status_t LoadAttrDirHandle();
|
||||||
|
|
||||||
|
static inline ino_t FileIdToInoT(uint64 fileid);
|
||||||
protected:
|
protected:
|
||||||
Inode();
|
Inode();
|
||||||
|
|
||||||
@@ -133,8 +134,6 @@ protected:
|
|||||||
|
|
||||||
static inline status_t CheckLockType(short ltype, uint32 mode);
|
static inline status_t CheckLockType(short ltype, uint32 mode);
|
||||||
|
|
||||||
static inline ino_t FileIdToInoT(uint64 fileid);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 fType;
|
uint32 fType;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "ReplyInterpreter.h"
|
#include "ReplyInterpreter.h"
|
||||||
|
|
||||||
|
|
||||||
class NFS4Inode : protected NFS4Object {
|
class NFS4Inode : public NFS4Object {
|
||||||
public:
|
public:
|
||||||
status_t GetChangeInfo(uint64* change, bool attrDir = false);
|
status_t GetChangeInfo(uint64* change, bool attrDir = false);
|
||||||
status_t ReadLink(void* buffer, size_t* length);
|
status_t ReadLink(void* buffer, size_t* length);
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
|||||||
|
|
||||||
if (result != B_TIMED_OUT) {
|
if (result != B_TIMED_OUT) {
|
||||||
release_sem(cookie->fSnoozeCancel);
|
release_sem(cookie->fSnoozeCancel);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sequence != NULL)
|
if (sequence != NULL)
|
||||||
@@ -80,9 +80,9 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
|||||||
|
|
||||||
if (result != B_TIMED_OUT) {
|
if (result != B_TIMED_OUT) {
|
||||||
release_sem(cookie->fSnoozeCancel);
|
release_sem(cookie->fSnoozeCancel);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sequence != NULL)
|
if (sequence != NULL)
|
||||||
@@ -104,7 +104,8 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// FileHandle has expired
|
// FileHandle has expired or is invalid
|
||||||
|
case NFS4ERR_BADHANDLE:
|
||||||
case NFS4ERR_FHEXPIRED:
|
case NFS4ERR_FHEXPIRED:
|
||||||
if (fInfo.UpdateFileHandles(fFileSystem) == B_OK)
|
if (fInfo.UpdateFileHandles(fFileSystem) == B_OK)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user