Removed the fs_vnode_ops::create_dir() parameter for returning the ID of the
newly created dir. The VFS really doesn't need it and for some file systems it might not be easy to get by. Several file systems (e.g. rootfs and fat) were ignoring the parameter anyway. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29719 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -184,7 +184,7 @@ struct fs_vnode_ops {
|
|||||||
|
|
||||||
/* directory operations */
|
/* directory operations */
|
||||||
status_t (*create_dir)(fs_volume *volume, fs_vnode *parent,
|
status_t (*create_dir)(fs_volume *volume, fs_vnode *parent,
|
||||||
const char *name, int perms, ino_t *_newVnodeID);
|
const char *name, int perms);
|
||||||
status_t (*remove_dir)(fs_volume *volume, fs_vnode *parent,
|
status_t (*remove_dir)(fs_volume *volume, fs_vnode *parent,
|
||||||
const char *name);
|
const char *name);
|
||||||
status_t (*open_dir)(fs_volume *volume, fs_vnode *vnode,
|
status_t (*open_dir)(fs_volume *volume, fs_vnode *vnode,
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ struct fssh_fs_vnode_ops {
|
|||||||
|
|
||||||
/* directory operations */
|
/* directory operations */
|
||||||
fssh_status_t (*create_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
|
fssh_status_t (*create_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
|
||||||
const char *name, int perms, fssh_vnode_id *_newVnodeID);
|
const char *name, int perms);
|
||||||
fssh_status_t (*remove_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
|
fssh_status_t (*remove_dir)(fssh_fs_volume *volume, fssh_fs_vnode *parent,
|
||||||
const char *name);
|
const char *name);
|
||||||
fssh_status_t (*open_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
|
fssh_status_t (*open_dir)(fssh_fs_volume *volume, fssh_fs_vnode *vnode,
|
||||||
|
|||||||
@@ -954,8 +954,6 @@ public:
|
|||||||
class CreateDirReply : public ReplyRequest {
|
class CreateDirReply : public ReplyRequest {
|
||||||
public:
|
public:
|
||||||
CreateDirReply() : ReplyRequest(CREATE_DIR_REPLY) {}
|
CreateDirReply() : ReplyRequest(CREATE_DIR_REPLY) {}
|
||||||
|
|
||||||
ino_t newDir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// RemoveDirRequest
|
// RemoveDirRequest
|
||||||
|
|||||||
@@ -1439,7 +1439,7 @@ bfs_read_link(fs_volume* _volume, fs_vnode* _node, char* buffer,
|
|||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
bfs_create_dir(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
bfs_create_dir(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
||||||
int mode, ino_t* _newVnodeID)
|
int mode)
|
||||||
{
|
{
|
||||||
FUNCTION_START(("name = \"%s\", perms = %d\n", name, mode));
|
FUNCTION_START(("name = \"%s\", perms = %d\n", name, mode));
|
||||||
|
|
||||||
@@ -1464,7 +1464,6 @@ bfs_create_dir(fs_volume* _volume, fs_vnode* _directory, const char* name,
|
|||||||
status = Inode::Create(transaction, directory, name,
|
status = Inode::Create(transaction, directory, name,
|
||||||
S_DIRECTORY | (mode & S_IUMSK), 0, 0, NULL, &id);
|
S_DIRECTORY | (mode & S_IUMSK), 0, 0, NULL, &id);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
*_newVnodeID = id;
|
|
||||||
put_vnode(volume->FSVolume(), id);
|
put_vnode(volume->FSVolume(), id);
|
||||||
|
|
||||||
entry_cache_add(volume->ID(), directory->ID(), name, id);
|
entry_cache_add(volume->ID(), directory->ID(), name, id);
|
||||||
|
|||||||
@@ -925,8 +925,7 @@ bi: if (result != B_OK) free(cookie);
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
dosfs_mkdir(fs_volume *_vol, fs_vnode *_dir, const char *name, int perms,
|
dosfs_mkdir(fs_volume *_vol, fs_vnode *_dir, const char *name, int perms)
|
||||||
ino_t *_vnid)
|
|
||||||
{
|
{
|
||||||
nspace *vol = (nspace *)_vol->private_volume;
|
nspace *vol = (nspace *)_vol->private_volume;
|
||||||
vnode *dir = (vnode *)_dir->private_node, dummy;
|
vnode *dir = (vnode *)_dir->private_node, dummy;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ status_t dosfs_remove_vnode(fs_volume *vol, fs_vnode *node, bool reenter);
|
|||||||
status_t dosfs_create(fs_volume *vol, fs_vnode *dir, const char *name,
|
status_t dosfs_create(fs_volume *vol, fs_vnode *dir, const char *name,
|
||||||
int omode, int perms, void **cookie, ino_t *vnid);
|
int omode, int perms, void **cookie, ino_t *vnid);
|
||||||
status_t dosfs_mkdir(fs_volume *vol, fs_vnode *dir, const char *name,
|
status_t dosfs_mkdir(fs_volume *vol, fs_vnode *dir, const char *name,
|
||||||
int perms, ino_t *_vnid);
|
int perms);
|
||||||
status_t dosfs_rename(fs_volume *vol, fs_vnode *olddir, const char *oldname,
|
status_t dosfs_rename(fs_volume *vol, fs_vnode *olddir, const char *oldname,
|
||||||
fs_vnode *newdir, const char *newname);
|
fs_vnode *newdir, const char *newname);
|
||||||
status_t dosfs_unlink(fs_volume *vol, fs_vnode *dir, const char *name);
|
status_t dosfs_unlink(fs_volume *vol, fs_vnode *dir, const char *name);
|
||||||
|
|||||||
@@ -527,8 +527,16 @@ AttributeFile::WriteAttributeFile(fs_volume *overlay, fs_volume *volume,
|
|||||||
|
|
||||||
// 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);
|
||||||
&fAttributeDirInode);
|
|
||||||
|
if (result == B_OK) {
|
||||||
|
result = currentVnode.ops->lookup(volume, ¤tVnode,
|
||||||
|
ATTRIBUTE_OVERLAY_ATTRIBUTE_DIR_NAME, &fAttributeDirInode);
|
||||||
|
|
||||||
|
// lookup() got us a reference we don't need -- put it
|
||||||
|
if (result == B_OK)
|
||||||
|
put_vnode(volume, fAttributeDirInode);
|
||||||
|
}
|
||||||
|
|
||||||
put_vnode(volume, fDirectoryInode);
|
put_vnode(volume, fDirectoryInode);
|
||||||
|
|
||||||
@@ -1290,9 +1298,9 @@ overlay_write(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
|
|||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
overlay_create_dir(fs_volume *volume, fs_vnode *vnode, const char *name,
|
overlay_create_dir(fs_volume *volume, fs_vnode *vnode, const char *name,
|
||||||
int perms, ino_t *newVnodeID)
|
int perms)
|
||||||
{
|
{
|
||||||
OVERLAY_CALL(create_dir, name, perms, newVnodeID)
|
OVERLAY_CALL(create_dir, name, perms)
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,8 +118,7 @@ public:
|
|||||||
status_t Write(void *cookie, off_t position,
|
status_t Write(void *cookie, off_t position,
|
||||||
const void *buffer, size_t *length);
|
const void *buffer, size_t *length);
|
||||||
|
|
||||||
status_t CreateDir(const char *name,
|
status_t CreateDir(const char *name, int perms);
|
||||||
int perms, ino_t *newInodeNumber);
|
|
||||||
status_t RemoveDir(const char *name);
|
status_t RemoveDir(const char *name);
|
||||||
status_t OpenDir(void **cookie);
|
status_t OpenDir(void **cookie);
|
||||||
status_t CloseDir(void *cookie);
|
status_t CloseDir(void *cookie);
|
||||||
@@ -565,9 +564,9 @@ OverlayInode::Write(void *_cookie, off_t position, const void *buffer,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
OverlayInode::CreateDir(const char *name, int perms, ino_t *newInodeNumber)
|
OverlayInode::CreateDir(const char *name, int perms)
|
||||||
{
|
{
|
||||||
return _CreateCommon(name, S_IFDIR, perms, newInodeNumber, NULL);
|
return _CreateCommon(name, S_IFDIR, perms, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1247,11 +1246,10 @@ overlay_write(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
|
|||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
overlay_create_dir(fs_volume *volume, fs_vnode *vnode, const char *name,
|
overlay_create_dir(fs_volume *volume, fs_vnode *vnode, const char *name,
|
||||||
int perms, ino_t *newVnodeID)
|
int perms)
|
||||||
{
|
{
|
||||||
TRACE("create_dir: \"%s\"\n", name);
|
TRACE("create_dir: \"%s\"\n", name);
|
||||||
return ((OverlayInode *)vnode->private_node)->CreateDir(name, perms,
|
return ((OverlayInode *)vnode->private_node)->CreateDir(name, perms);
|
||||||
newVnodeID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1979,7 +1979,7 @@ fs_remove_vnode(fs_volume *_volume, fs_vnode *_node, bool r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
fs_mkdir(fs_volume *_volume, fs_vnode *_dir, const char *name, int perms, ino_t *_newVnodeID)
|
fs_mkdir(fs_volume *_volume, fs_vnode *_dir, const char *name, int perms)
|
||||||
{
|
{
|
||||||
fs_nspace *ns;
|
fs_nspace *ns;
|
||||||
fs_node *dir;
|
fs_node *dir;
|
||||||
@@ -2066,8 +2066,6 @@ fs_mkdir(fs_volume *_volume, fs_vnode *_dir, const char *name, int perms, ino_t
|
|||||||
newNode->fhandle=fhandle;
|
newNode->fhandle=fhandle;
|
||||||
newNode->vnid=st.st_ino;
|
newNode->vnid=st.st_ino;
|
||||||
|
|
||||||
*_newVnodeID = newNode->vnid;
|
|
||||||
|
|
||||||
insert_node (ns,newNode);
|
insert_node (ns,newNode);
|
||||||
|
|
||||||
XDRInPacketDestroy (&reply);
|
XDRInPacketDestroy (&reply);
|
||||||
|
|||||||
@@ -1285,7 +1285,7 @@ exit:
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
fs_mkdir(fs_volume *_vol, fs_vnode *_dir, const char *name, int perms, ino_t *_vnid)
|
fs_mkdir(fs_volume *_vol, fs_vnode *_dir, const char *name, int perms)
|
||||||
{
|
{
|
||||||
nspace *ns = (nspace*)_vol->private_volume;
|
nspace *ns = (nspace*)_vol->private_volume;
|
||||||
vnode *dir = (vnode*)_dir->private_node;
|
vnode *dir = (vnode*)_dir->private_node;
|
||||||
@@ -1345,8 +1345,6 @@ fs_mkdir(fs_volume *_vol, fs_vnode *_dir, const char *name, int perms, ino_t *_v
|
|||||||
|
|
||||||
result = publish_vnode(_vol, vnid, (void*)newNode,&gNTFSVnodeOps, 0777, 0);
|
result = publish_vnode(_vol, vnid, (void*)newNode,&gNTFSVnodeOps, 0777, 0);
|
||||||
|
|
||||||
*_vnid = vnid;
|
|
||||||
|
|
||||||
put_vnode(_vol, MREF(ni->mft_no));
|
put_vnode(_vol, MREF(ni->mft_no));
|
||||||
|
|
||||||
ntfs_mark_free_space_outdated(ns);
|
ntfs_mark_free_space_outdated(ns);
|
||||||
|
|||||||
@@ -1075,8 +1075,7 @@ vint32 DirectoryCookie::fNextIteratorID = 0;
|
|||||||
|
|
||||||
// ramfs_create_dir
|
// ramfs_create_dir
|
||||||
static status_t
|
static status_t
|
||||||
ramfs_create_dir(fs_volume fs, fs_vnode _dir, const char *name,
|
ramfs_create_dir(fs_volume fs, fs_vnode _dir, const char *name, int mode)
|
||||||
int mode, ino_t *_vnid)
|
|
||||||
{
|
{
|
||||||
FUNCTION(("name: `%s', mode: %x\n", name, mode));
|
FUNCTION(("name: `%s', mode: %x\n", name, mode));
|
||||||
Volume *volume = (Volume*)fs;
|
Volume *volume = (Volume*)fs;
|
||||||
@@ -1115,7 +1114,6 @@ ramfs_create_dir(fs_volume fs, fs_vnode _dir, const char *name,
|
|||||||
node->SetGID(getegid());
|
node->SetGID(getegid());
|
||||||
// put the node
|
// put the node
|
||||||
volume->PutVNode(node->GetID());
|
volume->PutVNode(node->GetID());
|
||||||
*_vnid = node->GetID();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2182,7 +2182,7 @@ Volume::Write(void* _node, void* cookie, off_t pos, const void* buffer,
|
|||||||
|
|
||||||
// CreateDir
|
// CreateDir
|
||||||
status_t
|
status_t
|
||||||
Volume::CreateDir(void* _dir, const char* name, int mode, ino_t *newDir)
|
Volume::CreateDir(void* _dir, const char* name, int mode)
|
||||||
{
|
{
|
||||||
VNode* vnode = (VNode*)_dir;
|
VNode* vnode = (VNode*)_dir;
|
||||||
|
|
||||||
@@ -2221,7 +2221,6 @@ Volume::CreateDir(void* _dir, const char* name, int mode, ino_t *newDir)
|
|||||||
// process the reply
|
// process the reply
|
||||||
if (reply->error != B_OK)
|
if (reply->error != B_OK)
|
||||||
return reply->error;
|
return reply->error;
|
||||||
*newDir = reply->newDir;
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public:
|
|||||||
|
|
||||||
// directories
|
// directories
|
||||||
status_t CreateDir(void* dir, const char* name,
|
status_t CreateDir(void* dir, const char* name,
|
||||||
int mode, ino_t *newDir);
|
int mode);
|
||||||
status_t RemoveDir(void* dir, const char* name);
|
status_t RemoveDir(void* dir, const char* name);
|
||||||
status_t OpenDir(void* node, void** cookie);
|
status_t OpenDir(void* node, void** cookie);
|
||||||
status_t CloseDir(void* node, void* cookie);
|
status_t CloseDir(void* node, void* cookie);
|
||||||
|
|||||||
@@ -545,14 +545,13 @@ userlandfs_write(fs_volume* fsVolume, fs_vnode* fsNode, void* cookie, off_t pos,
|
|||||||
// userlandfs_create_dir
|
// userlandfs_create_dir
|
||||||
static status_t
|
static status_t
|
||||||
userlandfs_create_dir(fs_volume* fsVolume, fs_vnode* fsParent, const char* name,
|
userlandfs_create_dir(fs_volume* fsVolume, fs_vnode* fsParent, const char* name,
|
||||||
int perms, ino_t* newDir)
|
int perms)
|
||||||
{
|
{
|
||||||
Volume* volume = (Volume*)fsVolume->private_volume;
|
Volume* volume = (Volume*)fsVolume->private_volume;
|
||||||
PRINT(("userlandfs_create_dir(%p, %p, `%s', %d, %p)\n", volume,
|
PRINT(("userlandfs_create_dir(%p, %p, `%s', %#x)\n", volume,
|
||||||
fsParent->private_node, name, perms, newDir));
|
fsParent->private_node, name, perms));
|
||||||
status_t error = volume->CreateDir(fsParent->private_node, name, perms,
|
status_t error = volume->CreateDir(fsParent->private_node, name, perms);
|
||||||
newDir);
|
PRINT(("userlandfs_create_dir() done: (%lx)\n", error));
|
||||||
PRINT(("userlandfs_create_dir() done: (%lx, %lld)\n", error, *newDir));
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
// UserlandRequestHandler.cpp
|
/*
|
||||||
|
* Copyright 2001-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "UserlandRequestHandler.h"
|
#include "UserlandRequestHandler.h"
|
||||||
|
|
||||||
@@ -1314,11 +1317,10 @@ UserlandRequestHandler::_HandleRequest(CreateDirRequest* request)
|
|||||||
if (!volume)
|
if (!volume)
|
||||||
result = B_BAD_VALUE;
|
result = B_BAD_VALUE;
|
||||||
|
|
||||||
ino_t newDir = 0;
|
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
RequestThreadContext context(volume);
|
RequestThreadContext context(volume);
|
||||||
result = volume->CreateDir(request->node,
|
result = volume->CreateDir(request->node,
|
||||||
(const char*)request->name.GetData(), request->mode, &newDir);
|
(const char*)request->name.GetData(), request->mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare the reply
|
// prepare the reply
|
||||||
@@ -1329,7 +1331,6 @@ UserlandRequestHandler::_HandleRequest(CreateDirRequest* request)
|
|||||||
RETURN_ERROR(error);
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
reply->error = result;
|
reply->error = result;
|
||||||
reply->newDir = newDir;
|
|
||||||
|
|
||||||
// send the reply
|
// send the reply
|
||||||
return _SendReply(allocator, false);
|
return _SendReply(allocator, false);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// UserlandRequestHandler.h
|
/*
|
||||||
|
* Copyright 2001-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
#ifndef USERLAND_FS_USERLAND_REQUEST_HANDLER_H
|
#ifndef USERLAND_FS_USERLAND_REQUEST_HANDLER_H
|
||||||
#define USERLAND_FS_USERLAND_REQUEST_HANDLER_H
|
#define USERLAND_FS_USERLAND_REQUEST_HANDLER_H
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ Volume::Write(void* node, void* cookie, off_t pos, const void* buffer,
|
|||||||
|
|
||||||
// CreateDir
|
// CreateDir
|
||||||
status_t
|
status_t
|
||||||
Volume::CreateDir(void* dir, const char* name, int mode, ino_t *newDir)
|
Volume::CreateDir(void* dir, const char* name, int mode)
|
||||||
{
|
{
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
|
|
||||||
// directories
|
// directories
|
||||||
virtual status_t CreateDir(void* dir, const char* name,
|
virtual status_t CreateDir(void* dir, const char* name,
|
||||||
int mode, ino_t *newDir);
|
int mode);
|
||||||
virtual status_t RemoveDir(void* dir, const char* name);
|
virtual status_t RemoveDir(void* dir, const char* name);
|
||||||
virtual status_t OpenDir(void* node, void** cookie);
|
virtual status_t OpenDir(void* node, void** cookie);
|
||||||
virtual status_t CloseDir(void* node, void* cookie);
|
virtual status_t CloseDir(void* node, void* cookie);
|
||||||
|
|||||||
@@ -431,27 +431,12 @@ BeOSKernelVolume::Write(void* node, void* cookie, off_t pos,
|
|||||||
|
|
||||||
// CreateDir
|
// CreateDir
|
||||||
status_t
|
status_t
|
||||||
BeOSKernelVolume::CreateDir(void* dir, const char* name, int mode,
|
BeOSKernelVolume::CreateDir(void* dir, const char* name, int mode)
|
||||||
ino_t *newDir)
|
|
||||||
{
|
{
|
||||||
if (!fFSOps->mkdir || !fFSOps->walk) // we need walk() too
|
if (!fFSOps->mkdir)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
status_t error = fFSOps->mkdir(fVolumeCookie, dir, name, mode);
|
return fFSOps->mkdir(fVolumeCookie, dir, name, mode);
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
// we need to get the node ID by invoking walk()
|
|
||||||
ino_t id;
|
|
||||||
error = fFSOps->walk(fVolumeCookie, dir, name, NULL, &id);
|
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
// put the node for walk()'s get_vnode()
|
|
||||||
UserlandFS::KernelEmu::put_vnode(GetID(), id);
|
|
||||||
|
|
||||||
*newDir = id;
|
|
||||||
return B_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveDir
|
// RemoveDir
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
|
|
||||||
// directories
|
// directories
|
||||||
virtual status_t CreateDir(void* dir, const char* name,
|
virtual status_t CreateDir(void* dir, const char* name,
|
||||||
int mode, ino_t *newDir);
|
int mode);
|
||||||
virtual status_t RemoveDir(void* dir, const char* name);
|
virtual status_t RemoveDir(void* dir, const char* name);
|
||||||
virtual status_t OpenDir(void* node, void** cookie);
|
virtual status_t OpenDir(void* node, void** cookie);
|
||||||
virtual status_t CloseDir(void* node, void* cookie);
|
virtual status_t CloseDir(void* node, void* cookie);
|
||||||
|
|||||||
@@ -1155,7 +1155,7 @@ FUSEVolume::Write(void* _node, void* _cookie, off_t pos, const void* buffer,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
FUSEVolume::CreateDir(void* _dir, const char* name, int mode, ino_t *newDir)
|
FUSEVolume::CreateDir(void* _dir, const char* name, int mode)
|
||||||
{
|
{
|
||||||
FUSENode* dir = (FUSENode*)_dir;
|
FUSENode* dir = (FUSENode*)_dir;
|
||||||
PRINT(("FUSEVolume::CreateDir(%p (%lld), \"%s\", %#x)\n", dir, dir->id, name,
|
PRINT(("FUSEVolume::CreateDir(%p (%lld), \"%s\", %#x)\n", dir, dir->id, name,
|
||||||
@@ -1184,9 +1184,6 @@ mode));
|
|||||||
|
|
||||||
// TODO: Node monitoring!
|
// TODO: Node monitoring!
|
||||||
|
|
||||||
*newDir = 0;
|
|
||||||
// TODO: This is really superfluous!
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
|
|
||||||
// directories
|
// directories
|
||||||
virtual status_t CreateDir(void* dir, const char* name,
|
virtual status_t CreateDir(void* dir, const char* name,
|
||||||
int mode, ino_t *newDir);
|
int mode);
|
||||||
virtual status_t RemoveDir(void* dir, const char* name);
|
virtual status_t RemoveDir(void* dir, const char* name);
|
||||||
virtual status_t OpenDir(void* node, void** cookie);
|
virtual status_t OpenDir(void* node, void** cookie);
|
||||||
virtual status_t CloseDir(void* node, void* cookie);
|
virtual status_t CloseDir(void* node, void* cookie);
|
||||||
|
|||||||
@@ -738,14 +738,13 @@ HaikuKernelVolume::Write(void* _node, void* cookie, off_t pos,
|
|||||||
|
|
||||||
// CreateDir
|
// CreateDir
|
||||||
status_t
|
status_t
|
||||||
HaikuKernelVolume::CreateDir(void* _dir, const char* name, int mode,
|
HaikuKernelVolume::CreateDir(void* _dir, const char* name, int mode)
|
||||||
ino_t *newDir)
|
|
||||||
{
|
{
|
||||||
HaikuKernelNode* dir = (HaikuKernelNode*)_dir;
|
HaikuKernelNode* dir = (HaikuKernelNode*)_dir;
|
||||||
|
|
||||||
if (!dir->ops->create_dir)
|
if (!dir->ops->create_dir)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
return dir->ops->create_dir(&fVolume, dir, name, mode, newDir);
|
return dir->ops->create_dir(&fVolume, dir, name, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveDir
|
// RemoveDir
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public:
|
|||||||
|
|
||||||
// directories
|
// directories
|
||||||
virtual status_t CreateDir(void* dir, const char* name,
|
virtual status_t CreateDir(void* dir, const char* name,
|
||||||
int mode, ino_t *newDir);
|
int mode);
|
||||||
virtual status_t RemoveDir(void* dir, const char* name);
|
virtual status_t RemoveDir(void* dir, const char* name);
|
||||||
virtual status_t OpenDir(void* node, void** cookie);
|
virtual status_t OpenDir(void* node, void** cookie);
|
||||||
virtual status_t CloseDir(void* node, void* cookie);
|
virtual status_t CloseDir(void* node, void* cookie);
|
||||||
|
|||||||
@@ -1271,7 +1271,7 @@ devfs_write(fs_volume* _volume, fs_vnode* _vnode, void* _cookie, off_t pos,
|
|||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
devfs_create_dir(fs_volume *_volume, fs_vnode *_dir, const char *name,
|
devfs_create_dir(fs_volume *_volume, fs_vnode *_dir, const char *name,
|
||||||
int perms, ino_t *_newVnodeID)
|
int perms)
|
||||||
{
|
{
|
||||||
struct devfs *fs = (struct devfs *)_volume->private_volume;
|
struct devfs *fs = (struct devfs *)_volume->private_volume;
|
||||||
struct devfs_vnode *dir = (struct devfs_vnode *)_dir->private_node;
|
struct devfs_vnode *dir = (struct devfs_vnode *)_dir->private_node;
|
||||||
@@ -1294,7 +1294,6 @@ devfs_create_dir(fs_volume *_volume, fs_vnode *_dir, const char *name,
|
|||||||
hash_insert(sDeviceFileSystem->vnode_hash, vnode);
|
hash_insert(sDeviceFileSystem->vnode_hash, vnode);
|
||||||
devfs_insert_in_dir(dir, vnode);
|
devfs_insert_in_dir(dir, vnode);
|
||||||
|
|
||||||
*_newVnodeID = vnode->id;
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -607,15 +607,15 @@ rootfs_write(fs_volume *_volume, fs_vnode *vnode, void *cookie,
|
|||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
rootfs_create_dir(fs_volume *_volume, fs_vnode *_dir, const char *name,
|
rootfs_create_dir(fs_volume *_volume, fs_vnode *_dir, const char *name,
|
||||||
int mode, ino_t *_newID)
|
int mode)
|
||||||
{
|
{
|
||||||
struct rootfs *fs = (rootfs*)_volume->private_volume;
|
struct rootfs *fs = (rootfs*)_volume->private_volume;
|
||||||
struct rootfs_vnode *dir = (rootfs_vnode*)_dir->private_node;
|
struct rootfs_vnode *dir = (rootfs_vnode*)_dir->private_node;
|
||||||
struct rootfs_vnode *vnode;
|
struct rootfs_vnode *vnode;
|
||||||
status_t status = 0;
|
status_t status = 0;
|
||||||
|
|
||||||
TRACE(("rootfs_create_dir: dir %p, name = '%s', perms = %d, id = 0x%Lx pointer id = %p\n",
|
TRACE(("rootfs_create_dir: dir %p, name = '%s', perms = %d\n", dir, name,
|
||||||
dir, name, mode,*_newID, _newID));
|
mode));
|
||||||
|
|
||||||
mutex_lock(&fs->lock);
|
mutex_lock(&fs->lock);
|
||||||
|
|
||||||
|
|||||||
@@ -5394,7 +5394,6 @@ dir_create_entry_ref(dev_t mountID, ino_t parentID, const char* name, int perms,
|
|||||||
bool kernel)
|
bool kernel)
|
||||||
{
|
{
|
||||||
struct vnode* vnode;
|
struct vnode* vnode;
|
||||||
ino_t newID;
|
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
if (name == NULL || *name == '\0')
|
if (name == NULL || *name == '\0')
|
||||||
@@ -5408,7 +5407,7 @@ dir_create_entry_ref(dev_t mountID, ino_t parentID, const char* name, int perms,
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (HAS_FS_CALL(vnode, create_dir))
|
if (HAS_FS_CALL(vnode, create_dir))
|
||||||
status = FS_CALL(vnode, create_dir, name, perms, &newID);
|
status = FS_CALL(vnode, create_dir, name, perms);
|
||||||
else
|
else
|
||||||
status = EROFS;
|
status = EROFS;
|
||||||
|
|
||||||
@@ -5422,7 +5421,6 @@ dir_create(int fd, char* path, int perms, bool kernel)
|
|||||||
{
|
{
|
||||||
char filename[B_FILE_NAME_LENGTH];
|
char filename[B_FILE_NAME_LENGTH];
|
||||||
struct vnode* vnode;
|
struct vnode* vnode;
|
||||||
ino_t newID;
|
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
FUNCTION(("dir_create: path '%s', perms %d, kernel %d\n", path, perms, kernel));
|
FUNCTION(("dir_create: path '%s', perms %d, kernel %d\n", path, perms, kernel));
|
||||||
@@ -5432,7 +5430,7 @@ dir_create(int fd, char* path, int perms, bool kernel)
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (HAS_FS_CALL(vnode, create_dir)) {
|
if (HAS_FS_CALL(vnode, create_dir)) {
|
||||||
status = FS_CALL(vnode, create_dir, filename, perms, &newID);
|
status = FS_CALL(vnode, create_dir, filename, perms);
|
||||||
} else
|
} else
|
||||||
status = EROFS;
|
status = EROFS;
|
||||||
|
|
||||||
|
|||||||
@@ -3221,7 +3221,6 @@ static fssh_status_t
|
|||||||
dir_create_entry_ref(fssh_mount_id mountID, fssh_vnode_id parentID, const char *name, int perms, bool kernel)
|
dir_create_entry_ref(fssh_mount_id mountID, fssh_vnode_id parentID, const char *name, int perms, bool kernel)
|
||||||
{
|
{
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
fssh_vnode_id newID;
|
|
||||||
fssh_status_t status;
|
fssh_status_t status;
|
||||||
|
|
||||||
if (name == NULL || *name == '\0')
|
if (name == NULL || *name == '\0')
|
||||||
@@ -3234,7 +3233,7 @@ dir_create_entry_ref(fssh_mount_id mountID, fssh_vnode_id parentID, const char *
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (HAS_FS_CALL(vnode, create_dir))
|
if (HAS_FS_CALL(vnode, create_dir))
|
||||||
status = FS_CALL(vnode, create_dir, name, perms, &newID);
|
status = FS_CALL(vnode, create_dir, name, perms);
|
||||||
else
|
else
|
||||||
status = FSSH_EROFS;
|
status = FSSH_EROFS;
|
||||||
|
|
||||||
@@ -3248,7 +3247,6 @@ dir_create(int fd, char *path, int perms, bool kernel)
|
|||||||
{
|
{
|
||||||
char filename[FSSH_B_FILE_NAME_LENGTH];
|
char filename[FSSH_B_FILE_NAME_LENGTH];
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
fssh_vnode_id newID;
|
|
||||||
fssh_status_t status;
|
fssh_status_t status;
|
||||||
|
|
||||||
FUNCTION(("dir_create: path '%s', perms %d, kernel %d\n", path, perms, kernel));
|
FUNCTION(("dir_create: path '%s', perms %d, kernel %d\n", path, perms, kernel));
|
||||||
@@ -3258,7 +3256,7 @@ dir_create(int fd, char *path, int perms, bool kernel)
|
|||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (HAS_FS_CALL(vnode, create_dir))
|
if (HAS_FS_CALL(vnode, create_dir))
|
||||||
status = FS_CALL(vnode, create_dir, filename, perms, &newID);
|
status = FS_CALL(vnode, create_dir, filename, perms);
|
||||||
else
|
else
|
||||||
status = FSSH_EROFS;
|
status = FSSH_EROFS;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user