nfs4: Fix cookie and vnode creation in create() hook

This commit is contained in:
Pawel Dziepak 2012-06-26 17:21:06 +02:00
parent e36a54427c
commit 636e922e5c
4 changed files with 12 additions and 7 deletions

View File

@ -77,7 +77,7 @@ Cookie::CancelAll()
mutex_lock(&fRequestLock);
RequestEntry* ent = fRequests;
while (ent != NULL) {
fInode->FileSystem()->Server()->WakeCall(ent->fRequest);
fFilesystem->Server()->WakeCall(ent->fRequest);
ent = ent->fNext;
}
mutex_unlock(&fRequestLock);

View File

@ -13,7 +13,6 @@
#include "Filesystem.h"
class Inode;
struct Cookie {
struct RequestEntry {
@ -21,7 +20,7 @@ struct Cookie {
RequestEntry* fNext;
};
Inode* fInode;
Filesystem* fFilesystem;
RequestEntry* fRequests;
mutex fRequestLock;

View File

@ -712,8 +712,6 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
bool confirm;
status_t result;
cookie->fInode = this;
cookie->fHandle = fHandle;
cookie->fMode = mode;
cookie->fSequence = 0;
@ -811,6 +809,9 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
fFilesystem->InoIdMap()->AddEntry(fi, *id);
cookie->fFilesystem = fFilesystem;
cookie->fHandle = fh;
break;
} while (true);
@ -829,7 +830,7 @@ Inode::Open(int mode, OpenFileCookie* cookie)
bool confirm;
status_t result;
cookie->fInode = this;
cookie->fFilesystem = fFilesystem;
cookie->fHandle = fHandle;
cookie->fMode = mode;
cookie->fSequence = 0;
@ -1131,7 +1132,7 @@ Inode::OpenDir(OpenDirCookie* cookie)
if (allowed & ACCESS4_READ != ACCESS4_READ)
return B_PERMISSION_DENIED;
cookie->fInode = this;
cookie->fFilesystem = fFilesystem;
cookie->fCookie = 0;
cookie->fCookieVerf = 2;

View File

@ -278,6 +278,11 @@ nfs4_create(fs_volume* volume, fs_vnode* dir, const char* name, int openMode,
if (result != B_OK)
delete cookie;
void* ptr;
result = get_vnode(volume, *_newVnodeID, &ptr);
if (result != B_OK)
delete cookie;
return result;
}