nfs4: Fix cookie and vnode creation in create() hook
This commit is contained in:
parent
e36a54427c
commit
636e922e5c
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user