change legacy fs_cookie to void**; tweak a few node function parameters

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42038 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-06-08 00:58:50 +00:00
parent f76a033d04
commit 84a474186f

View File

@ -234,7 +234,7 @@ static status_t
ramfs_read_vnode(fs_volume* _volume, ino_t vnid, fs_vnode* node, bool reenter)
{
// FUNCTION_START();
FUNCTION(("node: %Ld\n", vnid));
FUNCTION(("node: %Ld\n", vnid));
Volume* volume = (Volume*)_volume->private_volume;
Node *foundNode = NULL;
status_t error = B_OK;
@ -266,12 +266,12 @@ ramfs_write_vnode(fs_volume /*fs*/, fs_vnode DARG(_node), bool /*reenter*/)
// ramfs_remove_vnode
static status_t
ramfs_remove_vnode(fs_volume* _volume, fs_vnode _node, bool /*reenter*/)
ramfs_remove_vnode(fs_volume* _volume, fs_vnode* _node, bool /*reenter*/)
{
FUNCTION(("node: %Ld\n", ((Node*)_node)->GetID()));
Volume* volume = (Volume*)_volume->private_volume;
Node* node = (Node*)_node;
Node *node = (Node*)_node;
status_t error = B_OK;
if (VolumeWriteLocker locker = volume) {
volume->NodeRemoved(node);
@ -287,7 +287,7 @@ ramfs_remove_vnode(fs_volume* _volume, fs_vnode _node, bool /*reenter*/)
// ramfs_ioctl
static status_t
ramfs_ioctl(fs_volume* _volume, fs_vnode /*node*/, fs_cookie /*cookie*/,
ramfs_ioctl(fs_volume* _volume, fs_vnode /*node*/, void** /*cookie*/,
uint32 cmd, void *buffer, size_t /*length*/)
{
FUNCTION_START();
@ -337,7 +337,7 @@ PRINT((" RAMFS_IOCTL_DUMP_INDEX, `%s'\n", name));
// ramfs_set_flags
static status_t
ramfs_set_flags(fs_volume /*fs*/, fs_vnode /*node*/, fs_cookie /*cookie*/,
ramfs_set_flags(fs_volume /*fs*/, fs_vnode /*node*/, void** /*cookie*/,
int /*flags*/)
{
FUNCTION_START();
@ -720,8 +720,8 @@ ramfs_write_stat(fs_volume* _volume, fs_vnode _node, const struct stat *st,
if (error == B_OK) {
// permissions
if (mask & B_STAT_MODE) {
node->SetMode(node->GetMode() & ~S_IUMSK
| st->st_mode & S_IUMSK);
node->SetMode((node->GetMode() & ~S_IUMSK)
| (st->st_mode & S_IUMSK));
}
// UID
if (mask & B_STAT_UID)
@ -780,7 +780,7 @@ private:
// ramfs_create
static status_t
ramfs_create(fs_volume* _volume, fs_vnode _dir, const char *name, int openMode,
int mode, fs_cookie *_cookie, ino_t *vnid)
int mode, void** _cookie, ino_t *vnid)
{
// FUNCTION_START();
FUNCTION(("name: `%s', open mode: %x, mode: %x\n", name, openMode, mode));
@ -864,7 +864,7 @@ ramfs_create(fs_volume* _volume, fs_vnode _dir, const char *name, int openMode,
// ramfs_open
static status_t
ramfs_open(fs_volume* _volume, fs_vnode _node, int openMode, fs_cookie *_cookie)
ramfs_open(fs_volume* _volume, fs_vnode _node, int openMode, void** _cookie)
{
// FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -907,7 +907,7 @@ ramfs_open(fs_volume* _volume, fs_vnode _node, int openMode, fs_cookie *_cookie)
// ramfs_close
static status_t
ramfs_close(fs_volume* _volume, fs_vnode _node, fs_cookie /*cookie*/)
ramfs_close(fs_volume* _volume, fs_vnode _node, void** /*cookie*/)
{
// FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -927,7 +927,7 @@ ramfs_close(fs_volume* _volume, fs_vnode _node, fs_cookie /*cookie*/)
// ramfs_free_cookie
static status_t
ramfs_free_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
ramfs_free_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
FileCookie *cookie = (FileCookie*)_cookie;
@ -938,7 +938,7 @@ ramfs_free_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
// ramfs_read
static status_t
ramfs_read(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie, off_t pos,
ramfs_read(fs_volume* _volume, fs_vnode _node, void** _cookie, off_t pos,
void *buffer, size_t *bufferSize)
{
// FUNCTION_START();
@ -975,7 +975,7 @@ ramfs_read(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie, off_t pos,
// ramfs_write
static status_t
ramfs_write(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie, off_t pos,
ramfs_write(fs_volume* _volume, fs_vnode _node, void** _cookie, off_t pos,
const void *buffer, size_t *bufferSize)
{
// FUNCTION_START();
@ -1209,7 +1209,7 @@ ramfs_remove_dir(fs_volume* _volume, fs_vnode _dir, const char *name)
// ramfs_open_dir
static status_t
ramfs_open_dir(fs_volume /*fs*/, fs_vnode _node, fs_cookie *_cookie)
ramfs_open_dir(fs_volume /*fs*/, fs_vnode _node, void** _cookie)
{
// FUNCTION_START();
// Volume *volume = (Volume*)fs;
@ -1245,7 +1245,7 @@ FUNCTION(("dir: (%Lu)\n", node->GetID()));
// ramfs_close_dir
static status_t
ramfs_close_dir(fs_volume /*fs*/, fs_vnode DARG(_node), fs_cookie _cookie)
ramfs_close_dir(fs_volume /*fs*/, fs_vnode DARG(_node), void** _cookie)
{
FUNCTION_START();
FUNCTION(("dir: (%Lu)\n", ((Node*)_node)->GetID()));
@ -1259,7 +1259,7 @@ FUNCTION(("dir: (%Lu)\n", ((Node*)_node)->GetID()));
// ramfs_free_dir_cookie
static status_t
ramfs_free_dir_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
ramfs_free_dir_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
DirectoryCookie *cookie = (DirectoryCookie*)_cookie;
@ -1270,7 +1270,7 @@ ramfs_free_dir_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
// ramfs_read_dir
static status_t
ramfs_read_dir(fs_volume* _volume, fs_vnode DARG(_node), fs_cookie _cookie,
ramfs_read_dir(fs_volume* _volume, fs_vnode DARG(_node), void** _cookie,
struct dirent *buffer, size_t bufferSize, uint32 *count)
{
FUNCTION_START();
@ -1316,7 +1316,7 @@ ramfs_read_dir(fs_volume* _volume, fs_vnode DARG(_node), fs_cookie _cookie,
// ramfs_rewind_dir
static status_t
ramfs_rewind_dir(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
ramfs_rewind_dir(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
// No locking needed, since the Directory is guaranteed to live at this
@ -1333,7 +1333,7 @@ ramfs_rewind_dir(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
// ramfs_open_attr_dir
static status_t
ramfs_open_attr_dir(fs_volume* _volume, fs_vnode _node, fs_cookie *cookie)
ramfs_open_attr_dir(fs_volume* _volume, fs_vnode _node, void** _cookie)
{
FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -1354,7 +1354,7 @@ ramfs_open_attr_dir(fs_volume* _volume, fs_vnode _node, fs_cookie *cookie)
}
// set result / cleanup on failure
if (error == B_OK)
*cookie = iterator;
*_cookie = iterator;
else
delete iterator;
} else
@ -1365,12 +1365,12 @@ ramfs_open_attr_dir(fs_volume* _volume, fs_vnode _node, fs_cookie *cookie)
// ramfs_close_attr_dir
static status_t
ramfs_close_attr_dir(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie cookie)
ramfs_close_attr_dir(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
// No locking needed, since the Node is guaranteed to live at this time
// and for iterators there is a separate locking.
AttributeIterator *iterator = (AttributeIterator*)cookie;
AttributeIterator *iterator = (AttributeIterator*)_cookie;
iterator->Unset();
return B_OK;
}
@ -1379,12 +1379,12 @@ ramfs_close_attr_dir(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie cookie)
// ramfs_free_attr_dir_cookie
static status_t
ramfs_free_attr_dir_cookie(fs_volume /*fs*/, fs_vnode /*_node*/,
fs_cookie cookie)
void** _cookie)
{
FUNCTION_START();
// No locking needed, since the Node is guaranteed to live at this time
// and for iterators there is a separate locking.
AttributeIterator *iterator = (AttributeIterator*)cookie;
AttributeIterator *iterator = (AttributeIterator*)_cookie;
delete iterator;
return B_OK;
}
@ -1392,13 +1392,13 @@ ramfs_free_attr_dir_cookie(fs_volume /*fs*/, fs_vnode /*_node*/,
// ramfs_read_attr_dir
static status_t
ramfs_read_attr_dir(fs_volume* _volume, fs_vnode _node, fs_cookie cookie,
ramfs_read_attr_dir(fs_volume* _volume, fs_vnode _node, void** _cookie,
struct dirent *buffer, size_t bufferSize, uint32 *count)
{
FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
AttributeIterator *iterator = (AttributeIterator*)cookie;
AttributeIterator *iterator = (AttributeIterator*)_cookie;
status_t error = B_OK;
if (VolumeReadLocker locker = volume) {
error = iterator->Resume();
@ -1435,12 +1435,12 @@ ramfs_read_attr_dir(fs_volume* _volume, fs_vnode _node, fs_cookie cookie,
// ramfs_rewind_attr_dir
static status_t
ramfs_rewind_attr_dir(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie cookie)
ramfs_rewind_attr_dir(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
// No locking needed, since the Node is guaranteed to live at this time
// and for iterators there is a separate locking.
AttributeIterator *iterator = (AttributeIterator*)cookie;
AttributeIterator *iterator = (AttributeIterator*)_cookie;
// no need to Resume(), iterator remains suspended
status_t error = iterator->Rewind();
RETURN_ERROR(error);
@ -1491,7 +1491,7 @@ private:
// ramfs_create_attr
static status_t
ramfs_create_attr(fs_volume* _volume, fs_vnode _node, const char *name,
uint32 type, int openMode, fs_cookie *_cookie)
uint32 type, int openMode, void** _cookie)
{
Volume* volume = (Volume*)_volume->private_volume;
@ -1562,7 +1562,7 @@ ramfs_create_attr(fs_volume* _volume, fs_vnode _node, const char *name,
// ramfs_open_attr
static status_t
ramfs_open_attr(fs_volume* _volume, fs_vnode _node, const char *name,
int openMode, fs_cookie *_cookie)
int openMode, void** _cookie)
{
// FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -1621,7 +1621,7 @@ ramfs_open_attr(fs_volume* _volume, fs_vnode _node, const char *name,
// ramfs_close_attr
static status_t
ramfs_close_attr(fs_volume* _volume, fs_vnode _node, fs_cookie cookie)
ramfs_close_attr(fs_volume* _volume, fs_vnode _node, void** _cookie)
{
// FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -1642,7 +1642,7 @@ ramfs_close_attr(fs_volume* _volume, fs_vnode _node, fs_cookie cookie)
// ramfs_free_attr_cookie
static status_t
ramfs_free_attr_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
ramfs_free_attr_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, void** _cookie)
{
FUNCTION_START();
AttributeCookie *cookie = (AttributeCookie*)_cookie;
@ -1653,7 +1653,7 @@ ramfs_free_attr_cookie(fs_volume /*fs*/, fs_vnode /*_node*/, fs_cookie _cookie)
// ramfs_read_attr
static status_t
ramfs_read_attr(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie, off_t pos,
ramfs_read_attr(fs_volume* _volume, fs_vnode _node, void** _cookie, off_t pos,
void *buffer, size_t *bufferSize)
{
// FUNCTION_START();
@ -1684,7 +1684,7 @@ ramfs_read_attr(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie, off_t pos
// ramfs_write_attr
static status_t
ramfs_write_attr(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie,
ramfs_write_attr(fs_volume* _volume, fs_vnode _node, void** _cookie,
off_t pos, const void *buffer, size_t *bufferSize)
{
// FUNCTION_START();
@ -1733,7 +1733,7 @@ ramfs_write_attr(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie,
// ramfs_read_attr_stat
static status_t
ramfs_read_attr_stat(fs_volume* _volume, fs_vnode _node, fs_cookie _cookie,
ramfs_read_attr_stat(fs_volume* _volume, fs_vnode _node, void** _cookie,
struct stat *st)
{
// FUNCTION_START();
@ -1825,7 +1825,7 @@ public:
// ramfs_open_index_dir
static status_t
ramfs_open_index_dir(fs_volume* _volume, fs_cookie *_cookie)
ramfs_open_index_dir(fs_volume* _volume, void** _cookie)
{
FUNCTION_START();
Volume* volume = (Volume*)_volume->private_volume;
@ -1848,7 +1848,7 @@ ramfs_open_index_dir(fs_volume* _volume, fs_cookie *_cookie)
// ramfs_close_index_dir
static status_t
ramfs_close_index_dir(fs_volume /*fs*/, fs_cookie /*_cookie*/)
ramfs_close_index_dir(fs_volume /*fs*/, void** /*_cookie*/)
{
FUNCTION_START();
return B_OK;
@ -1857,7 +1857,7 @@ ramfs_close_index_dir(fs_volume /*fs*/, fs_cookie /*_cookie*/)
// ramfs_free_index_dir_cookie
static status_t
ramfs_free_index_dir_cookie(fs_volume /*fs*/, fs_cookie _cookie)
ramfs_free_index_dir_cookie(fs_volume /*fs*/, void** _cookie)
{
FUNCTION_START();
IndexDirCookie *cookie = (IndexDirCookie*)_cookie;
@ -1868,7 +1868,7 @@ ramfs_free_index_dir_cookie(fs_volume /*fs*/, fs_cookie _cookie)
// ramfs_read_index_dir
static status_t
ramfs_read_index_dir(fs_volume* _volume, fs_cookie _cookie,
ramfs_read_index_dir(fs_volume* _volume, void** _cookie,
struct dirent *buffer, size_t bufferSize, uint32 *count)
{
FUNCTION_START();
@ -1907,7 +1907,7 @@ ramfs_read_index_dir(fs_volume* _volume, fs_cookie _cookie,
// ramfs_rewind_index_dir
static status_t
ramfs_rewind_index_dir(fs_volume /*fs*/, fs_cookie _cookie)
ramfs_rewind_index_dir(fs_volume /*fs*/, void** _cookie)
{
FUNCTION_START();
IndexDirCookie *cookie = (IndexDirCookie*)_cookie;
@ -2018,7 +2018,7 @@ ramfs_read_index_stat(fs_volume* _volume, const char *name, struct stat *st)
// ramfs_open_query
static status_t
ramfs_open_query(fs_volume* _volume, const char *queryString, uint32 flags,
port_id port, uint32 token, fs_cookie *cookie)
port_id port, uint32 token, void** _cookie)
{
FUNCTION_START();
PRINT(("query = \"%s\", flags = %lu, port_id = %ld, token = %ld\n",
@ -2054,7 +2054,7 @@ ramfs_open_query(fs_volume* _volume, const char *queryString, uint32 flags,
if (flags & B_LIVE_QUERY)
query->SetLiveMode(port, token);
*cookie = (void *)query;
*_cookie = (void *)query;
return B_OK;
}
@ -2062,7 +2062,7 @@ ramfs_open_query(fs_volume* _volume, const char *queryString, uint32 flags,
// ramfs_close_query
static status_t
ramfs_close_query(fs_volume /*fs*/, fs_cookie /*cookie*/)
ramfs_close_query(fs_volume /*fs*/, void** /*cookie*/)
{
FUNCTION_START();
return B_OK;
@ -2071,7 +2071,7 @@ ramfs_close_query(fs_volume /*fs*/, fs_cookie /*cookie*/)
// ramfs_free_query_cookie
static status_t
ramfs_free_query_cookie(fs_volume* _volume, fs_cookie cookie)
ramfs_free_query_cookie(fs_volume* _volume, void** _cookie)
{
FUNCTION_START();
@ -2082,7 +2082,7 @@ ramfs_free_query_cookie(fs_volume* _volume, fs_cookie cookie)
if (!locker.IsLocked())
RETURN_ERROR(B_ERROR);
Query *query = (Query *)cookie;
Query *query = (Query *)_cookie;
Expression *expression = query->GetExpression();
delete query;
delete expression;
@ -2093,11 +2093,11 @@ ramfs_free_query_cookie(fs_volume* _volume, fs_cookie cookie)
// ramfs_read_query
static status_t
ramfs_read_query(fs_volume* _volume, fs_cookie cookie, struct dirent *buffer,
ramfs_read_query(fs_volume* _volume, void** _cookie, struct dirent *buffer,
size_t bufferSize, uint32 *count)
{
FUNCTION_START();
Query *query = (Query *)cookie;
Query *query = (Query *)_cookie;
Volume* volume = (Volume*)_volume->private_volume;
// lock the volume
@ -2117,7 +2117,7 @@ ramfs_read_query(fs_volume* _volume, fs_cookie cookie, struct dirent *buffer,
}
// TODO: status_t (*rewind_query)(fs_volume fs, fs_cookie cookie);
// TODO: status_t (*rewind_query)(fs_volume fs, void** _cookie);
// #pragma mark - Module Interface