nfs4: Add node to inode to file handle map before notifying

This commit is contained in:
Pawel Dziepak
2012-08-16 02:24:53 +02:00
parent cd2c1203d3
commit 376eef4a9b
4 changed files with 27 additions and 8 deletions
@@ -252,6 +252,25 @@ DirectoryCache::NotifyChanges(DirectoryCacheSnapshot* oldSnapshot,
} else {
notify_entry_created(fInode->GetFileSystem()->DevId(),
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
oldSnapshot->fEntries.Remove(prev, oldCurrent);
+1 -2
View File
@@ -109,6 +109,7 @@ public:
status_t LoadAttrDirHandle();
static inline ino_t FileIdToInoT(uint64 fileid);
protected:
Inode();
@@ -133,8 +134,6 @@ protected:
static inline status_t CheckLockType(short ltype, uint32 mode);
static inline ino_t FileIdToInoT(uint64 fileid);
private:
uint32 fType;
@@ -20,7 +20,7 @@
#include "ReplyInterpreter.h"
class NFS4Inode : protected NFS4Object {
class NFS4Inode : public NFS4Object {
public:
status_t GetChangeInfo(uint64* change, bool attrDir = false);
status_t ReadLink(void* buffer, size_t* length);
@@ -50,9 +50,9 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
if (result != B_TIMED_OUT) {
release_sem(cookie->fSnoozeCancel);
return true;
return false;
}
return false;
return true;
}
if (sequence != NULL)
@@ -80,9 +80,9 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
if (result != B_TIMED_OUT) {
release_sem(cookie->fSnoozeCancel);
return true;
return false;
}
return false;
return true;
}
if (sequence != NULL)
@@ -104,7 +104,8 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
}
return false;
// FileHandle has expired
// FileHandle has expired or is invalid
case NFS4ERR_BADHANDLE:
case NFS4ERR_FHEXPIRED:
if (fInfo.UpdateFileHandles(fFileSystem) == B_OK)
return true;