Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not
needed at all when used as intended. Thanks Ingo for the explanation on how this is intended to work. Adjusted the overlay fs accordingly and updated/reverted the changes to the other filesystems. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29250 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -310,7 +310,7 @@ extern status_t publish_vnode(fs_volume *volume, ino_t vnodeID,
|
|||||||
void *privateNode, fs_vnode_ops *ops, int type,
|
void *privateNode, fs_vnode_ops *ops, int type,
|
||||||
uint32 flags);
|
uint32 flags);
|
||||||
extern status_t get_vnode(fs_volume *volume, ino_t vnodeID,
|
extern status_t get_vnode(fs_volume *volume, ino_t vnodeID,
|
||||||
void **_privateNode, fs_vnode_ops **_vnodeOps);
|
void **_privateNode);
|
||||||
extern status_t put_vnode(fs_volume *volume, ino_t vnodeID);
|
extern status_t put_vnode(fs_volume *volume, ino_t vnodeID);
|
||||||
extern status_t acquire_vnode(fs_volume *volume, ino_t vnodeID);
|
extern status_t acquire_vnode(fs_volume *volume, ino_t vnodeID);
|
||||||
extern status_t remove_vnode(fs_volume *volume, ino_t vnodeID);
|
extern status_t remove_vnode(fs_volume *volume, ino_t vnodeID);
|
||||||
|
|||||||
@@ -344,8 +344,7 @@ extern fssh_status_t fssh_publish_vnode(fssh_fs_volume *volume,
|
|||||||
fssh_vnode_id vnodeID, void *privateNode,
|
fssh_vnode_id vnodeID, void *privateNode,
|
||||||
fssh_fs_vnode_ops *ops, int type, uint32_t flags);
|
fssh_fs_vnode_ops *ops, int type, uint32_t flags);
|
||||||
extern fssh_status_t fssh_get_vnode(fssh_fs_volume *volume,
|
extern fssh_status_t fssh_get_vnode(fssh_fs_volume *volume,
|
||||||
fssh_vnode_id vnodeID, void **_privateNode,
|
fssh_vnode_id vnodeID, void **_privateNode);
|
||||||
fssh_fs_vnode_ops **_vnodeOps);
|
|
||||||
extern fssh_status_t fssh_put_vnode(fssh_fs_volume *volume,
|
extern fssh_status_t fssh_put_vnode(fssh_fs_volume *volume,
|
||||||
fssh_vnode_id vnodeID);
|
fssh_vnode_id vnodeID);
|
||||||
extern fssh_status_t fssh_acquire_vnode(fssh_fs_volume *volume,
|
extern fssh_status_t fssh_acquire_vnode(fssh_fs_volume *volume,
|
||||||
|
|||||||
@@ -2701,7 +2701,7 @@ AttributeIterator::GetNext(char* name, size_t* _length, uint32* _type,
|
|||||||
// if you haven't yet access to the attributes directory, get it
|
// if you haven't yet access to the attributes directory, get it
|
||||||
if (fAttributes == NULL) {
|
if (fAttributes == NULL) {
|
||||||
if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()),
|
if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()),
|
||||||
(void**)&fAttributes, NULL) != B_OK) {
|
(void**)&fAttributes) != B_OK) {
|
||||||
FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t"
|
FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t"
|
||||||
" = %Ld,name = \"%s\")\n", fInode->ID(), name));
|
" = %Ld,name = \"%s\")\n", fInode->ID(), name));
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|||||||
@@ -354,8 +354,7 @@ public:
|
|||||||
{
|
{
|
||||||
Unset();
|
Unset();
|
||||||
|
|
||||||
return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode,
|
return fStatus = get_vnode(volume->FSVolume(), id, (void**)&fInode);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t SetTo(Volume* volume, block_run run)
|
status_t SetTo(Volume* volume, block_run run)
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ bfs_lookup(fs_volume* _volume, fs_vnode* _directory, const char* file,
|
|||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
|
|
||||||
Inode* inode;
|
Inode* inode;
|
||||||
status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode, NULL);
|
status = get_vnode(volume->FSVolume(), *_vnodeID, (void**)&inode);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
REPORT_ERROR(status);
|
REPORT_ERROR(status);
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|||||||
@@ -1493,7 +1493,7 @@ cdda_lookup(fs_volume* _volume, fs_vnode* _dir, const char* name, ino_t* _id)
|
|||||||
if (inode == NULL)
|
if (inode == NULL)
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
status = get_vnode(volume->FSVolume(), inode->ID(), NULL, NULL);
|
status = get_vnode(volume->FSVolume(), inode->ID(), NULL);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
if ((fBlockCache = opener.InitCache(NumBlocks(), fBlockSize)) == NULL)
|
if ((fBlockCache = opener.InitCache(NumBlocks(), fBlockSize)) == NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode, NULL);
|
status = get_vnode(fFSVolume, EXT2_ROOT_NODE, (void**)&fRootNode);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE("could not create root node: get_vnode() failed!\n");
|
TRACE("could not create root node: get_vnode() failed!\n");
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ ext2_lookup(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return get_vnode(volume->FSVolume(), *_vnodeID, NULL, NULL);
|
return get_vnode(volume->FSVolume(), *_vnodeID, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ findfile(nspace *vol, vnode *dir, const char *file, ino_t *vnid,
|
|||||||
if (vnid)
|
if (vnid)
|
||||||
*vnid = found_vnid;
|
*vnid = found_vnid;
|
||||||
if (node)
|
if (node)
|
||||||
result = get_vnode(vol->volume, found_vnid, (void **)node, NULL);
|
result = get_vnode(vol->volume, found_vnid, (void **)node);
|
||||||
result = B_OK;
|
result = B_OK;
|
||||||
} else {
|
} else {
|
||||||
result = ENOENT;
|
result = ENOENT;
|
||||||
|
|||||||
@@ -890,7 +890,7 @@ dosfs_create(fs_volume *_vol, fs_vnode *_dir, const char *name, int omode,
|
|||||||
*vnid = dummy.vnid;
|
*vnid = dummy.vnid;
|
||||||
dummy.magic = ~VNODE_MAGIC;
|
dummy.magic = ~VNODE_MAGIC;
|
||||||
|
|
||||||
result = get_vnode(_vol, *vnid, (void **)&file, NULL);
|
result = get_vnode(_vol, *vnid, (void **)&file);
|
||||||
if (result < B_OK) {
|
if (result < B_OK) {
|
||||||
if (vol->fs_flags & FS_FLAGS_OP_SYNC)
|
if (vol->fs_flags & FS_FLAGS_OP_SYNC)
|
||||||
_dosfs_sync(vol);
|
_dosfs_sync(vol);
|
||||||
@@ -1155,7 +1155,7 @@ dosfs_rename(fs_volume *_vol, fs_vnode *_odir, const char *oldname,
|
|||||||
if (vnid == vol->root_vnode.vnid)
|
if (vnid == vol->root_vnode.vnid)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
result = get_vnode(_vol, vnid, (void **)&dir, NULL);
|
result = get_vnode(_vol, vnid, (void **)&dir);
|
||||||
if (result < B_OK)
|
if (result < B_OK)
|
||||||
goto bi1;
|
goto bi1;
|
||||||
parent = dir->dir_vnid;
|
parent = dir->dir_vnid;
|
||||||
|
|||||||
@@ -225,12 +225,12 @@ fs_walk(fs_volume *_vol, fs_vnode *_base, const char *file, ino_t *_vnodeID)
|
|||||||
// base directory
|
// base directory
|
||||||
TRACE(("fs_walk - found \".\" file.\n"));
|
TRACE(("fs_walk - found \".\" file.\n"));
|
||||||
*_vnodeID = baseNode->id;
|
*_vnodeID = baseNode->id;
|
||||||
return get_vnode(_vol, *_vnodeID, NULL, NULL);
|
return get_vnode(_vol, *_vnodeID, NULL);
|
||||||
} else if (strcmp(file, "..") == 0) {
|
} else if (strcmp(file, "..") == 0) {
|
||||||
// parent directory
|
// parent directory
|
||||||
TRACE(("fs_walk - found \"..\" file.\n"));
|
TRACE(("fs_walk - found \"..\" file.\n"));
|
||||||
*_vnodeID = baseNode->parID;
|
*_vnodeID = baseNode->parID;
|
||||||
return get_vnode(_vol, *_vnodeID, NULL, NULL);
|
return get_vnode(_vol, *_vnodeID, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// look up file in the directory
|
// look up file in the directory
|
||||||
@@ -273,7 +273,7 @@ fs_walk(fs_volume *_vol, fs_vnode *_base, const char *file, ino_t *_vnodeID)
|
|||||||
TRACE(("fs_walk - New vnode id is %Ld\n", *_vnodeID));
|
TRACE(("fs_walk - New vnode id is %Ld\n", *_vnodeID));
|
||||||
|
|
||||||
result = get_vnode(_vol, *_vnodeID,
|
result = get_vnode(_vol, *_vnodeID,
|
||||||
(void **)&newNode, NULL);
|
(void **)&newNode);
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
newNode->parID = baseNode->id;
|
newNode->parID = baseNode->id;
|
||||||
done = true;
|
done = true;
|
||||||
|
|||||||
@@ -898,7 +898,7 @@ fs_walk(fs_volume *_volume, fs_vnode *_base, const char *file, ino_t *vnid)
|
|||||||
isLink=S_ISLNK(st.st_mode);
|
isLink=S_ISLNK(st.st_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result=get_vnode (_volume,*vnid,(void **)&dummy,NULL))<B_OK)
|
if ((result=get_vnode (_volume,*vnid,(void **)&dummy))<B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -1755,7 +1755,7 @@ fs_create(fs_volume *_volume, fs_vnode *_dir, const char *name, int omode, int p
|
|||||||
|
|
||||||
*vnid=st.st_ino;
|
*vnid=st.st_ino;
|
||||||
|
|
||||||
if ((result=get_vnode(_volume,*vnid,&dummy,NULL))<B_OK)
|
if ((result=get_vnode(_volume,*vnid,&dummy))<B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
if (S_ISDIR(st.st_mode))
|
if (S_ISDIR(st.st_mode))
|
||||||
@@ -1901,7 +1901,7 @@ fs_unlink(fs_volume *_volume, fs_vnode *_dir, const char *name)
|
|||||||
|
|
||||||
insert_node (ns,newNode);
|
insert_node (ns,newNode);
|
||||||
|
|
||||||
if ((result=get_vnode(_volume,st.st_ino,(void **)&dummy,NULL))<B_OK)
|
if ((result=get_vnode(_volume,st.st_ino,(void **)&dummy))<B_OK)
|
||||||
{
|
{
|
||||||
XDRInPacketDestroy (&reply);
|
XDRInPacketDestroy (&reply);
|
||||||
XDROutPacketDestroy (&call);
|
XDROutPacketDestroy (&call);
|
||||||
@@ -2195,7 +2195,7 @@ fs_rmdir(fs_volume *_volume, fs_vnode *_dir, const char *name)
|
|||||||
|
|
||||||
insert_node (ns,newNode);
|
insert_node (ns,newNode);
|
||||||
|
|
||||||
if ((result=get_vnode(_volume,st.st_ino,(void **)&dummy,NULL))<B_OK)
|
if ((result=get_vnode(_volume,st.st_ino,(void **)&dummy))<B_OK)
|
||||||
{
|
{
|
||||||
XDRInPacketDestroy(&reply);
|
XDRInPacketDestroy(&reply);
|
||||||
XDROutPacketDestroy(&call);
|
XDROutPacketDestroy(&call);
|
||||||
@@ -2341,7 +2341,7 @@ fs_symlink(fs_volume *_volume, fs_vnode *_dir, const char *name, const char *pat
|
|||||||
if (result==B_OK)
|
if (result==B_OK)
|
||||||
{
|
{
|
||||||
void *dummy;
|
void *dummy;
|
||||||
if ((result=get_vnode(_volume,st.st_ino,&dummy,NULL))<B_OK)
|
if ((result=get_vnode(_volume,st.st_ino,&dummy))<B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
XDRInPacketDestroy (&reply);
|
XDRInPacketDestroy (&reply);
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public:
|
|||||||
|
|
||||||
status_t AllLayersMounted();
|
status_t AllLayersMounted();
|
||||||
|
|
||||||
|
fs_volume * Volume() { return fVolume; }
|
||||||
fs_volume * SuperVolume() { return fVolume->super_volume; }
|
fs_volume * SuperVolume() { return fVolume->super_volume; }
|
||||||
|
|
||||||
bool WriteSupport() { return fWriteSupport; }
|
bool WriteSupport() { return fWriteSupport; }
|
||||||
@@ -83,6 +84,7 @@ public:
|
|||||||
|
|
||||||
status_t InitCheck();
|
status_t InitCheck();
|
||||||
|
|
||||||
|
fs_volume * Volume() { return fVolume->Volume(); }
|
||||||
fs_volume * SuperVolume() { return fVolume->SuperVolume(); }
|
fs_volume * SuperVolume() { return fVolume->SuperVolume(); }
|
||||||
fs_vnode * SuperVnode() { return &fSuperVnode; }
|
fs_vnode * SuperVnode() { return &fSuperVnode; }
|
||||||
ino_t InodeNumber() { return fInodeNumber; }
|
ino_t InodeNumber() { return fInodeNumber; }
|
||||||
@@ -114,7 +116,8 @@ private:
|
|||||||
|
|
||||||
class AttributeFile {
|
class AttributeFile {
|
||||||
public:
|
public:
|
||||||
AttributeFile(fs_volume *volume, fs_vnode *vnode);
|
AttributeFile(fs_volume *overlay, fs_volume *volume,
|
||||||
|
fs_vnode *vnode);
|
||||||
~AttributeFile();
|
~AttributeFile();
|
||||||
|
|
||||||
status_t InitCheck() { return fStatus; }
|
status_t InitCheck() { return fStatus; }
|
||||||
@@ -123,8 +126,8 @@ public:
|
|||||||
ino_t FileInode() { return fFileInode; }
|
ino_t FileInode() { return fFileInode; }
|
||||||
|
|
||||||
status_t CreateEmpty();
|
status_t CreateEmpty();
|
||||||
status_t WriteAttributeFile(fs_volume *volume,
|
status_t WriteAttributeFile(fs_volume *overlay,
|
||||||
fs_vnode *vnode);
|
fs_volume *volume, fs_vnode *vnode);
|
||||||
|
|
||||||
status_t ReadAttributeDir(struct dirent *dirent,
|
status_t ReadAttributeDir(struct dirent *dirent,
|
||||||
size_t bufferSize, uint32 *numEntries,
|
size_t bufferSize, uint32 *numEntries,
|
||||||
@@ -286,8 +289,8 @@ status_t
|
|||||||
OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
|
OverlayInode::GetAttributeFile(AttributeFile **attributeFile)
|
||||||
{
|
{
|
||||||
if (fAttributeFile == NULL) {
|
if (fAttributeFile == NULL) {
|
||||||
fAttributeFile = new(std::nothrow) AttributeFile(SuperVolume(),
|
fAttributeFile = new(std::nothrow) AttributeFile(Volume(),
|
||||||
&fSuperVnode);
|
SuperVolume(), &fSuperVnode);
|
||||||
if (fAttributeFile == NULL) {
|
if (fAttributeFile == NULL) {
|
||||||
TRACE_ALWAYS("no memory to allocate attribute file\n");
|
TRACE_ALWAYS("no memory to allocate attribute file\n");
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -321,7 +324,8 @@ OverlayInode::WriteAttributeFile()
|
|||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
return fAttributeFile->WriteAttributeFile(SuperVolume(), &fSuperVnode);
|
return fAttributeFile->WriteAttributeFile(Volume(), SuperVolume(),
|
||||||
|
&fSuperVnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -553,7 +557,8 @@ OverlayInode::Write(void *_cookie, off_t position, const void *buffer,
|
|||||||
// #pragma mark AttributeFile
|
// #pragma mark AttributeFile
|
||||||
|
|
||||||
|
|
||||||
AttributeFile::AttributeFile(fs_volume *volume, fs_vnode *vnode)
|
AttributeFile::AttributeFile(fs_volume *overlay, fs_volume *volume,
|
||||||
|
fs_vnode *vnode)
|
||||||
: fStatus(B_NO_INIT),
|
: fStatus(B_NO_INIT),
|
||||||
fVolumeID(volume->id),
|
fVolumeID(volume->id),
|
||||||
fFileInode(0),
|
fFileInode(0),
|
||||||
@@ -633,13 +638,14 @@ AttributeFile::AttributeFile(fs_volume *volume, fs_vnode *vnode)
|
|||||||
else if (i == 2)
|
else if (i == 2)
|
||||||
fAttributeFileInode = inodeNumber;
|
fAttributeFileInode = inodeNumber;
|
||||||
|
|
||||||
fStatus = get_vnode(volume, inodeNumber, ¤tVnode.private_node,
|
OverlayInode *overlayInode = NULL;
|
||||||
¤tVnode.ops);
|
fStatus = get_vnode(overlay, inodeNumber, (void **)&overlayInode);
|
||||||
if (fStatus != B_OK) {
|
if (fStatus != B_OK) {
|
||||||
TRACE_ALWAYS("getting vnode failed: %s\n", strerror(fStatus));
|
TRACE_ALWAYS("getting vnode failed: %s\n", strerror(fStatus));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentVnode = *overlayInode->SuperVnode();
|
||||||
lastInodeNumber = inodeNumber;
|
lastInodeNumber = inodeNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,7 +773,8 @@ AttributeFile::CreateEmpty()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
|
AttributeFile::WriteAttributeFile(fs_volume *overlay, fs_volume *volume,
|
||||||
|
fs_vnode *vnode)
|
||||||
{
|
{
|
||||||
if (fFile == NULL)
|
if (fFile == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
@@ -787,15 +794,17 @@ AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fs_vnode currentVnode;
|
fs_vnode currentVnode;
|
||||||
|
OverlayInode *overlayInode = NULL;
|
||||||
if (fAttributeDirInode == 0) {
|
if (fAttributeDirInode == 0) {
|
||||||
result = get_vnode(volume, fDirectoryInode,
|
result = get_vnode(overlay, fDirectoryInode, (void **)&overlayInode);
|
||||||
¤tVnode.private_node, ¤tVnode.ops);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
TRACE_ALWAYS("failed to get directory vnode: %s\n",
|
TRACE_ALWAYS("failed to get directory vnode: %s\n",
|
||||||
strerror(result));
|
strerror(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentVnode = *overlayInode->SuperVnode();
|
||||||
|
|
||||||
// create the attribute directory
|
// create the attribute directory
|
||||||
result = currentVnode.ops->create_dir(volume, ¤tVnode,
|
result = currentVnode.ops->create_dir(volume, ¤tVnode,
|
||||||
ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, S_IRWXU | S_IRWXG | S_IRWXO,
|
ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, S_IRWXU | S_IRWXG | S_IRWXO,
|
||||||
@@ -813,14 +822,15 @@ AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
|
|||||||
|
|
||||||
void *attrFileCookie = NULL;
|
void *attrFileCookie = NULL;
|
||||||
if (fAttributeFileInode == 0) {
|
if (fAttributeFileInode == 0) {
|
||||||
result = get_vnode(volume, fAttributeDirInode,
|
result = get_vnode(overlay, fAttributeDirInode, (void **)&overlayInode);
|
||||||
¤tVnode.private_node, ¤tVnode.ops);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
TRACE_ALWAYS("failed to get attribute directory vnode: %s\n",
|
TRACE_ALWAYS("failed to get attribute directory vnode: %s\n",
|
||||||
strerror(result));
|
strerror(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentVnode = *overlayInode->SuperVnode();
|
||||||
|
|
||||||
// create the attribute file
|
// create the attribute file
|
||||||
result = currentVnode.ops->create(volume, ¤tVnode,
|
result = currentVnode.ops->create(volume, ¤tVnode,
|
||||||
nameBuffer, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP
|
nameBuffer, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP
|
||||||
@@ -835,22 +845,24 @@ AttributeFile::WriteAttributeFile(fs_volume *volume, fs_vnode *vnode)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = get_vnode(volume, fAttributeFileInode,
|
result = get_vnode(overlay, fAttributeFileInode, (void **)&overlayInode);
|
||||||
¤tVnode.private_node, ¤tVnode.ops);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
TRACE_ALWAYS("getting attribute file vnode after create failed: %s\n",
|
TRACE_ALWAYS("getting attribute file vnode after create failed: %s\n",
|
||||||
strerror(result));
|
strerror(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentVnode = *overlayInode->SuperVnode();
|
||||||
} else {
|
} else {
|
||||||
result = get_vnode(volume, fAttributeFileInode,
|
result = get_vnode(overlay, fAttributeFileInode, (void **)&overlayInode);
|
||||||
¤tVnode.private_node, ¤tVnode.ops);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
TRACE_ALWAYS("getting attribute file vnode failed: %s\n",
|
TRACE_ALWAYS("getting attribute file vnode failed: %s\n",
|
||||||
strerror(result));
|
strerror(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentVnode = *overlayInode->SuperVnode();
|
||||||
|
|
||||||
// open the attribute file
|
// open the attribute file
|
||||||
result = currentVnode.ops->open(volume, ¤tVnode, O_RDWR | O_TRUNC,
|
result = currentVnode.ops->open(volume, ¤tVnode, O_RDWR | O_TRUNC,
|
||||||
&attrFileCookie);
|
&attrFileCookie);
|
||||||
@@ -1296,6 +1308,11 @@ static status_t
|
|||||||
overlay_get_super_vnode(fs_volume *volume, fs_vnode *vnode,
|
overlay_get_super_vnode(fs_volume *volume, fs_vnode *vnode,
|
||||||
fs_volume *superVolume, fs_vnode *_superVnode)
|
fs_volume *superVolume, fs_vnode *_superVnode)
|
||||||
{
|
{
|
||||||
|
if (volume == superVolume) {
|
||||||
|
*_superVnode = *vnode;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
OverlayInode *node = (OverlayInode *)vnode->private_node;
|
OverlayInode *node = (OverlayInode *)vnode->private_node;
|
||||||
fs_vnode *superVnode = node->SuperVnode();
|
fs_vnode *superVnode = node->SuperVnode();
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ Volume::GetKeyOffsetForName(const char *name, int len, uint64 *result)
|
|||||||
status_t
|
status_t
|
||||||
Volume::GetVNode(ino_t id, VNode **node)
|
Volume::GetVNode(ino_t id, VNode **node)
|
||||||
{
|
{
|
||||||
return get_vnode(GetFSVolume(), id, (void**)node, NULL);
|
return get_vnode(GetFSVolume(), id, (void**)node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutVNode
|
// PutVNode
|
||||||
|
|||||||
@@ -407,8 +407,7 @@ add_partition(struct devfs* fs, struct devfs_vnode* device, const char* name,
|
|||||||
|
|
||||||
// increase reference count of raw device -
|
// increase reference count of raw device -
|
||||||
// the partition device really needs it
|
// the partition device really needs it
|
||||||
status = get_vnode(fs->volume, device->id, (void**)&partition->raw_device,
|
status = get_vnode(fs->volume, device->id, (void**)&partition->raw_device);
|
||||||
NULL);
|
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
goto err1;
|
goto err1;
|
||||||
|
|
||||||
@@ -959,7 +958,7 @@ devfs_lookup(fs_volume *_volume, fs_vnode *_dir, const char *name, ino_t *_id)
|
|||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = get_vnode(fs->volume, vnode->id, NULL, NULL);
|
status = get_vnode(fs->volume, vnode->id, NULL);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@@ -1063,7 +1062,7 @@ devfs_create(fs_volume* _volume, fs_vnode* _dir, const char* name, int openMode,
|
|||||||
if (openMode & O_EXCL)
|
if (openMode & O_EXCL)
|
||||||
return B_FILE_EXISTS;
|
return B_FILE_EXISTS;
|
||||||
|
|
||||||
status = get_vnode(fs->volume, vnode->id, NULL, NULL);
|
status = get_vnode(fs->volume, vnode->id, NULL);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@@ -2092,7 +2091,7 @@ devfs_unpublish_device(BaseDevice* device, bool disconnect)
|
|||||||
{
|
{
|
||||||
devfs_vnode* node;
|
devfs_vnode* node;
|
||||||
status_t status = get_vnode(sDeviceFileSystem->volume, device->ID(),
|
status_t status = get_vnode(sDeviceFileSystem->volume, device->ID(),
|
||||||
(void**)&node, NULL);
|
(void**)&node);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ remove_node(struct rootfs *fs, struct rootfs_vnode *directory,
|
|||||||
{
|
{
|
||||||
// schedule this vnode to be removed when it's ref goes to zero
|
// schedule this vnode to be removed when it's ref goes to zero
|
||||||
|
|
||||||
bool gotNode = (get_vnode(fs->volume, vnode->id, NULL, NULL) == B_OK);
|
bool gotNode = (get_vnode(fs->volume, vnode->id, NULL) == B_OK);
|
||||||
|
|
||||||
status_t status = B_OK;
|
status_t status = B_OK;
|
||||||
if (gotNode)
|
if (gotNode)
|
||||||
@@ -447,7 +447,7 @@ rootfs_lookup(fs_volume *_volume, fs_vnode *_dir, const char *name, ino_t *_id)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = get_vnode(fs->volume, vnode->id, NULL, NULL);
|
status = get_vnode(fs->volume, vnode->id, NULL);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
|||||||
@@ -3626,8 +3626,7 @@ publish_vnode(fs_volume *volume, ino_t vnodeID, void *privateNode,
|
|||||||
|
|
||||||
|
|
||||||
extern "C" status_t
|
extern "C" status_t
|
||||||
get_vnode(fs_volume *volume, ino_t vnodeID, void **_privateNode,
|
get_vnode(fs_volume *volume, ino_t vnodeID, void **_privateNode)
|
||||||
fs_vnode_ops **_vnodeOps)
|
|
||||||
{
|
{
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
|
|
||||||
@@ -3653,14 +3652,8 @@ get_vnode(fs_volume *volume, ino_t vnodeID, void **_privateNode,
|
|||||||
|
|
||||||
if (_privateNode != NULL)
|
if (_privateNode != NULL)
|
||||||
*_privateNode = resolvedNode.private_node;
|
*_privateNode = resolvedNode.private_node;
|
||||||
if (_vnodeOps != NULL)
|
} else if (_privateNode != NULL)
|
||||||
*_vnodeOps = resolvedNode.ops;
|
*_privateNode = vnode->private_node;
|
||||||
} else {
|
|
||||||
if (_privateNode != NULL)
|
|
||||||
*_privateNode = vnode->private_node;
|
|
||||||
if (_vnodeOps != NULL)
|
|
||||||
*_vnodeOps = vnode->ops;
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -4054,7 +4047,7 @@ vfs_get_fs_node_from_path(fs_volume *volume, const char *path, bool kernel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use get_vnode() to resolve the cookie for the right layer.
|
// Use get_vnode() to resolve the cookie for the right layer.
|
||||||
status = get_vnode(volume, vnode->id, _node, NULL);
|
status = get_vnode(volume, vnode->id, _node);
|
||||||
put_vnode(vnode);
|
put_vnode(vnode);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -1986,7 +1986,7 @@ fssh_publish_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID,
|
|||||||
|
|
||||||
extern "C" fssh_status_t
|
extern "C" fssh_status_t
|
||||||
fssh_get_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID,
|
fssh_get_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID,
|
||||||
void **privateNode, fssh_fs_vnode_ops **vnodeOps)
|
void **privateNode)
|
||||||
{
|
{
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
|
|
||||||
@@ -2012,14 +2012,8 @@ fssh_get_vnode(fssh_fs_volume *volume, fssh_vnode_id vnodeID,
|
|||||||
|
|
||||||
if (privateNode != NULL)
|
if (privateNode != NULL)
|
||||||
*privateNode = resolvedNode.private_node;
|
*privateNode = resolvedNode.private_node;
|
||||||
if (vnodeOps != NULL)
|
} else if (privateNode != NULL)
|
||||||
*vnodeOps = resolvedNode.ops;
|
*privateNode = vnode->private_node;
|
||||||
} else {
|
|
||||||
if (privateNode != NULL)
|
|
||||||
*privateNode = vnode->private_node;
|
|
||||||
if (vnodeOps != NULL)
|
|
||||||
*vnodeOps = vnode->ops;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FSSH_B_OK;
|
return FSSH_B_OK;
|
||||||
}
|
}
|
||||||
@@ -2451,7 +2445,7 @@ vfs_get_fs_node_from_path(fssh_fs_volume *volume, const char *path, bool kernel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use get_vnode() to resolve the cookie for the right layer.
|
// Use get_vnode() to resolve the cookie for the right layer.
|
||||||
status = ::fssh_get_vnode(volume, vnode->id, _node, NULL);
|
status = ::fssh_get_vnode(volume, vnode->id, _node);
|
||||||
put_vnode(vnode);
|
put_vnode(vnode);
|
||||||
|
|
||||||
return FSSH_B_OK;
|
return FSSH_B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user