Change int into status_t, and other changes for better BeOS type compatiblitly.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@975 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-09-03 02:19:22 +00:00
parent 35931182a2
commit 90abd04b34
16 changed files with 292 additions and 233 deletions
+5 -5
View File
@@ -8,7 +8,7 @@
.text
/* int atomic_add(int *val, int incr) */
/* int32 atomic_add(vint32 *val, int32 incr) */
FUNCTION(atomic_add):
movl 4(%esp),%edx
movl 8(%esp),%eax
@@ -16,7 +16,7 @@ FUNCTION(atomic_add):
xaddl %eax,(%edx)
ret
/* int atomic_and(int *val, int incr) */
/* int32 atomic_and(vint32 *val, int32 incr) */
FUNCTION(atomic_and):
movl 4(%esp),%edx
@@ -32,7 +32,7 @@ _atomic_and1:
ret
/* int atomic_or(int *val, int incr) */
/* int32 atomic_or(vint32 *val, int32 incr) */
FUNCTION(atomic_or):
movl 4(%esp),%edx
@@ -48,14 +48,14 @@ _atomic_or1:
ret
/* int atomic_set(int *val, int set_to) */
/* int32 atomic_set(vint32 *val, int32 set_to) */
FUNCTION(atomic_set):
movl 4(%esp),%edx
movl 8(%esp),%eax
xchg %eax,(%edx)
ret
/* int test_and_set(int *val, int set_to, int test_val) */
/* int32 test_and_set(vint32 *val, int32 set_to, int32 test_val) */
FUNCTION(test_and_set):
movl 4(%esp),%edx
movl 8(%esp),%ecx
+27 -17
View File
@@ -33,21 +33,23 @@ int cpu_preboot_init(kernel_args *ka)
return arch_cpu_preboot_init(ka);
}
int user_atomic_add(int *uval, int incr)
int32 user_atomic_add(vint32 *uval, int32 incr)
{
int val;
int ret;
int32 val;
int32 ret;
if((addr)uval >= KERNEL_BASE && (addr)uval <= KERNEL_TOP)
goto error;
if(user_memcpy(&val, uval, sizeof(val)) < 0)
if(user_memcpy(&val, (int32 *)uval, sizeof(val)) < 0)
goto error;
// XXX broken on non SH4-systems, or when interrupts are enabled
// XXX x86 must use the assembly functions directly in userspace and not this ones
ret = val;
val += incr;
if(user_memcpy(uval, &val, sizeof(val)) < 0)
if(user_memcpy((int32 *)uval, &val, sizeof(val)) < 0)
goto error;
return ret;
@@ -57,7 +59,7 @@ error:
return -1;
}
int user_atomic_and(int *uval, int incr)
int32 user_atomic_and(vint32 *uval, int32 incr)
{
int val;
int ret;
@@ -65,13 +67,15 @@ int user_atomic_and(int *uval, int incr)
if((addr)uval >= KERNEL_BASE && (addr)uval <= KERNEL_TOP)
goto error;
if(user_memcpy(&val, uval, sizeof(val)) < 0)
if(user_memcpy(&val, (int32 *)uval, sizeof(val)) < 0)
goto error;
// XXX broken on non SH4-systems, or when interrupts are enabled
// XXX x86 must use the assembly functions directly in userspace and not this ones
ret = val;
val &= incr;
if(user_memcpy(uval, &val, sizeof(val)) < 0)
if(user_memcpy((int32 *)uval, &val, sizeof(val)) < 0)
goto error;
return ret;
@@ -81,7 +85,7 @@ error:
return -1;
}
int user_atomic_or(int *uval, int incr)
int32 user_atomic_or(vint32 *uval, int32 incr)
{
int val;
int ret;
@@ -89,13 +93,15 @@ int user_atomic_or(int *uval, int incr)
if((addr)uval >= KERNEL_BASE && (addr)uval <= KERNEL_TOP)
goto error;
if(user_memcpy(&val, uval, sizeof(val)) < 0)
if(user_memcpy(&val, (int32 *)uval, sizeof(val)) < 0)
goto error;
// XXX broken on non SH4-systems, or when interrupts are enabled
// XXX x86 must use the assembly functions directly in userspace and not this ones
ret = val;
val |= incr;
if(user_memcpy(uval, &val, sizeof(val)) < 0)
if(user_memcpy((int32 *)uval, &val, sizeof(val)) < 0)
goto error;
return ret;
@@ -105,7 +111,7 @@ error:
return -1;
}
int user_atomic_set(int *uval, int set_to)
int32 user_atomic_set(vint32 *uval, int32 set_to)
{
int val;
int ret;
@@ -113,13 +119,15 @@ int user_atomic_set(int *uval, int set_to)
if((addr)uval >= KERNEL_BASE && (addr)uval <= KERNEL_TOP)
goto error;
if(user_memcpy(&val, uval, sizeof(val)) < 0)
if(user_memcpy(&val, (int32 *)uval, sizeof(val)) < 0)
goto error;
// XXX broken on non SH4-systems, or when interrupts are enabled
// XXX x86 must use the assembly functions directly in userspace and not this ones
ret = val;
val = set_to;
if(user_memcpy(uval, &val, sizeof(val)) < 0)
if(user_memcpy((int32 *)uval, &val, sizeof(val)) < 0)
goto error;
return ret;
@@ -129,7 +137,7 @@ error:
return -1;
}
int user_test_and_set(int *uval, int set_to, int test_val)
int32 user_test_and_set(vint32 *uval, int32 set_to, int32 test_val)
{
int val;
int ret;
@@ -137,13 +145,15 @@ int user_test_and_set(int *uval, int set_to, int test_val)
if((addr)uval >= KERNEL_BASE && (addr)uval <= KERNEL_TOP)
goto error;
if(user_memcpy(&val, uval, sizeof(val)) < 0)
if(user_memcpy(&val, (int32 *)uval, sizeof(val)) < 0)
goto error;
// XXX broken on non SH4-systems, or when interrupts are enabled
// XXX x86 must use the assembly functions directly in userspace and not this ones
ret = val;
if(val == test_val) {
val = set_to;
if(user_memcpy(uval, &val, sizeof(val)) < 0)
if(user_memcpy((int32 *)uval, &val, sizeof(val)) < 0)
goto error;
}
+37 -36
View File
@@ -137,7 +137,7 @@ bootfs_create_vnode(struct bootfs *fs, const char *name)
}
static int
static status_t
bootfs_delete_vnode(struct bootfs *fs, struct bootfs_vnode *v, bool force_delete)
{
// cant delete it if it's in a directory or is a directory
@@ -219,7 +219,7 @@ bootfs_find_in_dir(struct bootfs_vnode *dir, const char *path)
}
static int
static status_t
bootfs_insert_in_dir(struct bootfs_vnode *dir, struct bootfs_vnode *v)
{
if(dir->stream.type != STREAM_TYPE_DIR)
@@ -233,7 +233,7 @@ bootfs_insert_in_dir(struct bootfs_vnode *dir, struct bootfs_vnode *v)
}
static int
static status_t
bootfs_remove_from_dir(struct bootfs_vnode *dir, struct bootfs_vnode *findit)
{
struct bootfs_vnode *v;
@@ -256,13 +256,15 @@ bootfs_remove_from_dir(struct bootfs_vnode *dir, struct bootfs_vnode *findit)
}
static int
/* XXX seems to be unused
static bool
bootfs_is_dir_empty(struct bootfs_vnode *dir)
{
if(dir->stream.type != STREAM_TYPE_DIR)
return false;
return !dir->stream.u.dir.dir_head;
}
*/
/** Creates a path of vnodes up to the last part of the passed in path.
@@ -337,7 +339,7 @@ bootfs_create_path(struct bootfs *fs, char *path, struct bootfs_vnode *base, cha
}
static int
static status_t
bootfs_create_vnode_tree(struct bootfs *fs, struct bootfs_vnode *root)
{
int i;
@@ -384,12 +386,12 @@ bootfs_create_vnode_tree(struct bootfs *fs, struct bootfs_vnode *root)
// #pragma mark -
static int
static status_t
bootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id *root_vnid)
{
struct bootfs *fs;
struct bootfs_vnode *v;
int err;
status_t err;
TRACE(("bootfs_mount: entry\n"));
@@ -454,7 +456,7 @@ err:
}
static int
static status_t
bootfs_unmount(fs_cookie _fs)
{
struct bootfs *fs = _fs;
@@ -478,7 +480,7 @@ bootfs_unmount(fs_cookie _fs)
}
static int
static status_t
bootfs_sync(fs_cookie fs)
{
TRACE(("bootfs_sync: entry\n"));
@@ -487,13 +489,13 @@ bootfs_sync(fs_cookie fs)
}
static int
static status_t
bootfs_lookup(fs_cookie _fs, fs_vnode _dir, const char *name, vnode_id *_id, int *_type)
{
struct bootfs *fs = (struct bootfs *)_fs;
struct bootfs_vnode *dir = (struct bootfs_vnode *)_dir;
struct bootfs_vnode *vnode, *vdummy;
int status;
status_t status;
TRACE(("bootfs_lookup: entry dir %p, name '%s'\n", dir, name));
@@ -523,7 +525,7 @@ err:
}
static int
static status_t
bootfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t bufferSize)
{
struct bootfs_vnode *vnode = (struct bootfs_vnode *)_vnode;
@@ -535,11 +537,10 @@ bootfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t buffe
}
static int
static status_t
bootfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *v, bool r)
{
struct bootfs *fs = (struct bootfs *)_fs;
int err;
TRACE(("bootfs_get_vnode: asking for vnode 0x%Lx, r %d\n", id, r));
@@ -560,7 +561,7 @@ bootfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *v, bool r)
}
static int
static status_t
bootfs_put_vnode(fs_cookie _fs, fs_vnode _v, bool r)
{
struct bootfs_vnode *v = (struct bootfs_vnode *)_v;
@@ -571,13 +572,13 @@ bootfs_put_vnode(fs_cookie _fs, fs_vnode _v, bool r)
}
static int
static status_t
bootfs_remove_vnode(fs_cookie _fs, fs_vnode _v, bool reenter)
{
struct bootfs *fs = (struct bootfs *)_fs;
struct bootfs_vnode *v = (struct bootfs_vnode *)_v;
struct bootfs_vnode dummy;
int err;
status_t err;
TRACE(("bootfs_remove_vnode: remove %p (0x%Lx) r %d\n", v, v->id, reenter));
@@ -601,14 +602,14 @@ err:
}
static int
static status_t
bootfs_create(fs_cookie _fs, fs_vnode _dir, const char *name, int omode, int perms, file_cookie *_cookie, vnode_id *new_vnid)
{
return EROFS;
}
static int
static status_t
bootfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
{
struct bootfs *fs = _fs;
@@ -633,7 +634,7 @@ bootfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
}
static int
static status_t
bootfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
struct bootfs *fs = _fs;
@@ -646,7 +647,7 @@ bootfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
bootfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
struct bootfs *fs = _fs;
@@ -662,7 +663,7 @@ bootfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
bootfs_fsync(fs_cookie _fs, fs_vnode _v)
{
return 0;
@@ -733,7 +734,7 @@ bootfs_seek(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, off_t pos, int seek
struct bootfs *fs = _fs;
struct bootfs_vnode *v = _v;
struct bootfs_cookie *cookie = _cookie;
int err = B_OK;
status_t err = B_OK;
TRACE(("bootfs_seek: vnode %p, cookie %p, pos 0x%Lx , seek_type %d\n", v, cookie, pos, seekType));
@@ -781,20 +782,20 @@ bootfs_seek(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, off_t pos, int seek
}
static int
static status_t
bootfs_create_dir(fs_cookie _fs, fs_vnode _dir, const char *name, int perms, vnode_id *new_vnid)
{
return EROFS;
}
static int
static status_t
bootfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
{
struct bootfs *fs = _fs;
struct bootfs_vnode *vnode = _v;
struct bootfs_cookie *cookie;
int status = 0;
status_t status = 0;
TRACE(("bootfs_open_dir: vnode %p\n", vnode));
@@ -817,7 +818,7 @@ bootfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
}
static int
static status_t
bootfs_read_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie, struct dirent *dirent, size_t bufferSize, uint32 *_num)
{
struct bootfs_cookie *cookie = _cookie;
@@ -855,7 +856,7 @@ err:
}
static int
static status_t
bootfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
{
struct bootfs *fs = _fs;
@@ -871,7 +872,7 @@ bootfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
}
static int
static status_t
bootfs_ioctl(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, ulong op, void *buf, size_t len)
{
TRACE(("bootfs_ioctl: fs_cookie %p vnode %p, file_cookie %p, op %lu, buf %p, len %ld\n", _fs, _v, _cookie, op, buf, len));
@@ -879,7 +880,7 @@ bootfs_ioctl(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, ulong op, void *bu
}
static int
static status_t
bootfs_can_page(fs_cookie _fs, fs_vnode _v)
{
struct bootfs_vnode *v = _v;
@@ -936,26 +937,26 @@ bootfs_write_page(fs_cookie _fs, fs_vnode _v, iovecs *vecs, off_t pos)
}
static int
static status_t
bootfs_unlink(fs_cookie _fs, fs_vnode _dir, const char *name)
{
return EROFS;
}
static int
static status_t
bootfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname)
{
return EROFS;
}
static int
static status_t
bootfs_read_stat(fs_cookie _fs, fs_vnode _v, struct stat *stat)
{
struct bootfs *fs = _fs;
struct bootfs_vnode *v = _v;
int err = 0;
status_t err = 0;
TRACE(("bootfs_rstat: fs_cookie %p vnode %p v->id 0x%Lx , stat %p\n", fs, v, v->id, stat));
@@ -989,7 +990,7 @@ err:
}
static int
static status_t
bootfs_write_stat(fs_cookie _fs, fs_vnode _v, const struct stat *stat, int stat_mask)
{
struct bootfs *fs = _fs;
@@ -1058,7 +1059,7 @@ static struct fs_calls bootfs_calls = {
};
int
status_t
bootstrap_bootfs(void)
{
region_id rid;
+36 -34
View File
@@ -155,7 +155,7 @@ devfs_create_vnode(struct devfs *fs, const char *name)
}
static int
static status_t
devfs_delete_vnode(struct devfs *fs, struct devfs_vnode *v, bool force_delete)
{
// cant delete it if it's in a directory or is a directory
@@ -240,7 +240,7 @@ devfs_find_in_dir(struct devfs_vnode *dir, const char *path)
}
static int
static status_t
devfs_insert_in_dir(struct devfs_vnode *dir, struct devfs_vnode *v)
{
if (dir->stream.type != STREAM_TYPE_DIR)
@@ -254,7 +254,7 @@ devfs_insert_in_dir(struct devfs_vnode *dir, struct devfs_vnode *v)
}
static int
static status_t
devfs_remove_from_dir(struct devfs_vnode *dir, struct devfs_vnode *findit)
{
struct devfs_vnode *v;
@@ -277,7 +277,8 @@ devfs_remove_from_dir(struct devfs_vnode *dir, struct devfs_vnode *findit)
}
static int
/* XXX seems to be unused
static bool
devfs_is_dir_empty(struct devfs_vnode *dir)
{
if (dir->stream.type != STREAM_TYPE_DIR)
@@ -285,9 +286,10 @@ devfs_is_dir_empty(struct devfs_vnode *dir)
return !dir->stream.u.dir.dir_head;
}
*/
static int
static status_t
devfs_get_partition_info( struct devfs *fs, struct devfs_vnode *v,
struct devfs_cookie *cookie, void *buf, size_t len)
{
@@ -311,7 +313,7 @@ devfs_get_partition_info( struct devfs *fs, struct devfs_vnode *v,
}
static int
static status_t
devfs_set_partition( struct devfs *fs, struct devfs_vnode *v,
struct devfs_cookie *cookie, void *buf, size_t len)
{
@@ -403,12 +405,12 @@ err2:
// #pragma mark -
static int
static status_t
devfs_mount(fs_id id, const char *devfs, void *args, fs_cookie *_fs, vnode_id *root_vnid)
{
struct devfs *fs;
struct devfs_vnode *v;
int err;
status_t err;
TRACE(("devfs_mount: entry\n"));
@@ -476,7 +478,7 @@ err:
}
static int
static status_t
devfs_unmount(fs_cookie _fs)
{
struct devfs *fs = _fs;
@@ -500,7 +502,7 @@ devfs_unmount(fs_cookie _fs)
}
static int
static status_t
devfs_sync(fs_cookie fs)
{
TRACE(("devfs_sync: entry\n"));
@@ -509,13 +511,13 @@ devfs_sync(fs_cookie fs)
}
static int
static status_t
devfs_lookup(fs_cookie _fs, fs_vnode _dir, const char *name, vnode_id *_id, int *_type)
{
struct devfs *fs = (struct devfs *)_fs;
struct devfs_vnode *dir = (struct devfs_vnode *)_dir;
struct devfs_vnode *vnode, *vdummy;
int err;
status_t err;
TRACE(("devfs_lookup: entry dir %p, name '%s'\n", dir, name));
@@ -545,7 +547,7 @@ err:
}
static int
static status_t
devfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t bufferSize)
{
struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode;
@@ -557,7 +559,7 @@ devfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t buffer
}
static int
static status_t
devfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *_vnode, bool reenter)
{
struct devfs *fs = (struct devfs *)_fs;
@@ -581,7 +583,7 @@ devfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *_vnode, bool reenter)
}
static int
static status_t
devfs_put_vnode(fs_cookie _fs, fs_vnode _v, bool reenter)
{
#if DEVFS_TRACE
@@ -594,7 +596,7 @@ devfs_put_vnode(fs_cookie _fs, fs_vnode _v, bool reenter)
}
static int
static status_t
devfs_remove_vnode(fs_cookie _fs, fs_vnode _v, bool reenter)
{
struct devfs *fs = (struct devfs *)_fs;
@@ -619,20 +621,20 @@ devfs_remove_vnode(fs_cookie _fs, fs_vnode _v, bool reenter)
}
static int
static status_t
devfs_create(fs_cookie _fs, fs_vnode _dir, const char *name, int omode, int perms, file_cookie *_cookie, vnode_id *new_vnid)
{
return EROFS;
}
static int
static status_t
devfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
{
struct devfs *fs = _fs;
struct devfs_vnode *vnode = _v;
struct devfs_cookie *cookie;
int status = 0;
status_t status = 0;
TRACE(("devfs_open: fs_cookie %p vnode %p, oflags 0x%x, file_cookie %p \n", fs, vnode, oflags, _cookie));
@@ -650,7 +652,7 @@ devfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
}
static int
static status_t
devfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
struct devfs_vnode *vnode = _v;
@@ -667,7 +669,7 @@ devfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
devfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
struct devfs_vnode *vnode = _v;
@@ -687,7 +689,7 @@ devfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
devfs_fsync(fs_cookie _fs, fs_vnode _v)
{
return 0;
@@ -772,14 +774,14 @@ devfs_seek(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, off_t pos, int seekT
}
static int
static status_t
devfs_create_dir(fs_cookie _fs, fs_vnode _dir, const char *name, int perms, vnode_id *new_vnid)
{
return EROFS;
}
static int
static status_t
devfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
{
struct devfs *fs = _fs;
@@ -806,7 +808,7 @@ devfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
}
static int
static status_t
devfs_read_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie, struct dirent *dirent, size_t bufferSize, uint32 *_num)
{
struct devfs_cookie *cookie = _cookie;
@@ -848,7 +850,7 @@ err:
}
static int
static status_t
devfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
{
struct devfs *fs = _fs;
@@ -868,7 +870,7 @@ devfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
}
static int
static status_t
devfs_ioctl(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, ulong op, void *buf, size_t len)
{
struct devfs *fs = _fs;
@@ -969,13 +971,13 @@ static ssize_t devfs_writepage(fs_cookie _fs, fs_vnode _v, iovecs *vecs, off_t p
}
*/
static int
static status_t
devfs_unlink(fs_cookie _fs, fs_vnode _dir, const char *name)
{
struct devfs *fs = _fs;
struct devfs_vnode *dir = _dir;
struct devfs_vnode *vnode;
int status = B_NO_ERROR;
status_t status = B_NO_ERROR;
mutex_lock(&fs->lock);
@@ -1004,14 +1006,14 @@ err:
}
static int
static status_t
devfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname)
{
return EROFS;
}
static int
static status_t
devfs_read_stat(fs_cookie _fs, fs_vnode _v, struct stat *stat)
{
struct devfs_vnode *vnode = _v;
@@ -1027,7 +1029,7 @@ devfs_read_stat(fs_cookie _fs, fs_vnode _v, struct stat *stat)
}
static int
static status_t
devfs_write_stat(fs_cookie _fs, fs_vnode _v, const struct stat *stat, int stat_mask)
{
#if DEVFS_TRACE
@@ -1096,7 +1098,7 @@ static struct fs_calls devfs_calls = {
};
int
status_t
bootstrap_devfs(void)
{
@@ -1106,7 +1108,7 @@ bootstrap_devfs(void)
}
int
status_t
devfs_publish_device(const char *path, void *ident, device_hooks *calls)
{
int err = 0;
+38 -38
View File
@@ -114,7 +114,7 @@ rootfs_create_vnode(struct rootfs *fs)
}
static int
static status_t
rootfs_delete_vnode(struct rootfs *fs, struct rootfs_vnode *v, bool force_delete)
{
// cant delete it if it's in a directory or is a directory
@@ -185,7 +185,7 @@ rootfs_find_in_dir(struct rootfs_vnode *dir, const char *path)
}
static int
static status_t
rootfs_insert_in_dir(struct rootfs_vnode *dir, struct rootfs_vnode *v)
{
v->dir_next = dir->stream.dir.dir_head;
@@ -194,7 +194,7 @@ rootfs_insert_in_dir(struct rootfs_vnode *dir, struct rootfs_vnode *v)
}
static int
static status_t
rootfs_remove_from_dir(struct rootfs_vnode *dir, struct rootfs_vnode *findit)
{
struct rootfs_vnode *v;
@@ -217,18 +217,18 @@ rootfs_remove_from_dir(struct rootfs_vnode *dir, struct rootfs_vnode *findit)
}
static int
static bool
rootfs_is_dir_empty(struct rootfs_vnode *dir)
{
return !dir->stream.dir.dir_head;
}
static int
static status_t
rootfs_remove(struct rootfs *fs, struct rootfs_vnode *dir, const char *name, bool isDirectory)
{
struct rootfs_vnode *vnode;
int status = B_OK;
status_t status = B_OK;
mutex_lock(&fs->lock);
@@ -260,12 +260,12 @@ err:
// #pragma mark -
static int
static status_t
rootfs_mount(fs_id id, const char *device, void *args, fs_cookie *_fs, vnode_id *root_vnid)
{
struct rootfs *fs;
struct rootfs_vnode *vnode;
int err;
status_t err;
TRACE(("rootfs_mount: entry\n"));
@@ -325,7 +325,7 @@ err1:
}
static int
static status_t
rootfs_unmount(fs_cookie _fs)
{
struct rootfs *fs = (struct rootfs *)_fs;
@@ -352,7 +352,7 @@ rootfs_unmount(fs_cookie _fs)
}
static int
static status_t
rootfs_sync(fs_cookie fs)
{
TRACE(("rootfs_sync: entry\n"));
@@ -361,14 +361,14 @@ rootfs_sync(fs_cookie fs)
}
static int
static status_t
rootfs_lookup(fs_cookie _fs, fs_vnode _dir, const char *name, vnode_id *_id, int *_type)
{
struct rootfs *fs = (struct rootfs *)_fs;
struct rootfs_vnode *dir = (struct rootfs_vnode *)_dir;
struct rootfs_vnode *vnode,*vdummy;
struct rootfs_vnode *v1;
int status;
status_t status;
TRACE(("rootfs_lookup: entry dir %p, name '%s'\n", dir, name));
if (dir->stream.type != STREAM_TYPE_DIR)
@@ -397,7 +397,7 @@ err:
}
static int
static status_t
rootfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t bufferSize)
{
struct rootfs_vnode *vnode = (struct rootfs_vnode *)_vnode;
@@ -409,7 +409,7 @@ rootfs_get_vnode_name(fs_cookie _fs, fs_vnode _vnode, char *buffer, size_t buffe
}
static int
static status_t
rootfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *_vnode, bool reenter)
{
struct rootfs *fs = (struct rootfs *)_fs;
@@ -433,7 +433,7 @@ rootfs_get_vnode(fs_cookie _fs, vnode_id id, fs_vnode *_vnode, bool reenter)
}
static int
static status_t
rootfs_put_vnode(fs_cookie _fs, fs_vnode _vnode, bool reenter)
{
#if ROOTFS_TRACE
@@ -445,7 +445,7 @@ rootfs_put_vnode(fs_cookie _fs, fs_vnode _vnode, bool reenter)
}
static int
static status_t
rootfs_remove_vnode(fs_cookie _fs, fs_vnode _vnode, bool reenter)
{
struct rootfs *fs = (struct rootfs *)_fs;
@@ -470,14 +470,14 @@ rootfs_remove_vnode(fs_cookie _fs, fs_vnode _vnode, bool reenter)
}
static int
static status_t
rootfs_create(fs_cookie _fs, fs_vnode _dir, const char *name, int omode, int perms, file_cookie *_cookie, vnode_id *new_vnid)
{
return EINVAL;
}
static int
static status_t
rootfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
{
// allow to open the file, but it can't be done anything with it
@@ -485,7 +485,7 @@ rootfs_open(fs_cookie _fs, fs_vnode _v, int oflags, file_cookie *_cookie)
}
static int
static status_t
rootfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
#if ROOTFS_TRACE
@@ -498,7 +498,7 @@ rootfs_close(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
rootfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
{
struct rootfs_cookie *cookie = _cookie;
@@ -514,7 +514,7 @@ rootfs_free_cookie(fs_cookie _fs, fs_vnode _v, file_cookie _cookie)
}
static int
static status_t
rootfs_fsync(fs_cookie _fs, fs_vnode _v)
{
return 0;
@@ -544,14 +544,14 @@ rootfs_seek(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, off_t pos, int st)
}
static int
static status_t
rootfs_create_dir(fs_cookie _fs, fs_vnode _dir, const char *name, int perms, vnode_id *new_vnid)
{
struct rootfs *fs = _fs;
struct rootfs_vnode *dir = _dir;
struct rootfs_vnode *vnode;
bool created_vnode = false;
int status = 0;
status_t status = 0;
TRACE(("rootfs_create_dir: dir %p, name = '%s', perms = %d, id = 0x%Lx pointer id = %p\n", dir, name, perms,*new_vnid, new_vnid));
@@ -597,7 +597,7 @@ err:
}
static int
static status_t
rootfs_remove_dir(fs_cookie _fs, fs_vnode _dir, const char *name)
{
struct rootfs *fs = _fs;
@@ -609,7 +609,7 @@ rootfs_remove_dir(fs_cookie _fs, fs_vnode _dir, const char *name)
}
static int
static status_t
rootfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
{
struct rootfs *fs = (struct rootfs *)_fs;
@@ -639,7 +639,7 @@ rootfs_open_dir(fs_cookie _fs, fs_vnode _v, file_cookie *_cookie)
}
static int
static status_t
rootfs_read_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie, struct dirent *dirent, size_t bufferSize, uint32 *_num)
{
struct rootfs_cookie *cookie = _cookie;
@@ -679,7 +679,7 @@ err:
}
static int
static status_t
rootfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
{
struct rootfs *fs = _fs;
@@ -695,7 +695,7 @@ rootfs_rewind_dir(fs_cookie _fs, fs_vnode _vnode, file_cookie _cookie)
}
static int
static status_t
rootfs_ioctl(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, ulong op, void *buf, size_t len)
{
TRACE(("rootfs_ioctl: vnode %p, cookie %p, op %ld, buf %p, len %ld\n", _v, _cookie, op, buf, len));
@@ -704,7 +704,7 @@ rootfs_ioctl(fs_cookie _fs, fs_vnode _v, file_cookie _cookie, ulong op, void *bu
}
static int
static status_t
rootfs_can_page(fs_cookie _fs, fs_vnode _v)
{
return -1;
@@ -725,7 +725,7 @@ rootfs_write_page(fs_cookie _fs, fs_vnode _v, iovecs *vecs, off_t pos)
}
static int
static status_t
rootfs_read_link(fs_cookie _fs, fs_vnode _link, char *buffer, size_t bufferSize)
{
struct rootfs *fs = _fs;
@@ -742,14 +742,14 @@ rootfs_read_link(fs_cookie _fs, fs_vnode _link, char *buffer, size_t bufferSize)
}
static int
static status_t
rootfs_symlink(fs_cookie _fs, fs_vnode _dir, const char *name, const char *path, int mode)
{
struct rootfs *fs = _fs;
struct rootfs_vnode *dir = _dir;
struct rootfs_vnode *vnode;
bool created_vnode = false;
int status = 0;
status_t status = 0;
TRACE(("rootfs_symlink: dir %p, name = '%s', path = %s\n", dir, name, path));
@@ -798,7 +798,7 @@ err:
}
static int
static status_t
rootfs_unlink(fs_cookie _fs, fs_vnode _dir, const char *name)
{
struct rootfs *fs = _fs;
@@ -810,14 +810,14 @@ rootfs_unlink(fs_cookie _fs, fs_vnode _dir, const char *name)
}
static int
static status_t
rootfs_rename(fs_cookie _fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname)
{
struct rootfs *fs = _fs;
struct rootfs_vnode *olddir = _olddir;
struct rootfs_vnode *newdir = _newdir;
struct rootfs_vnode *v1, *v2;
int err;
status_t err;
TRACE(("rootfs_rename: olddir %p (0x%Lx), oldname '%s', newdir %p (0x%Lx), newname '%s'\n",
olddir, olddir->id, oldname, newdir, newdir->id, newname));
@@ -882,7 +882,7 @@ err:
}
static int
static status_t
rootfs_read_stat(fs_cookie _fs, fs_vnode _v, struct stat *stat)
{
struct rootfs_vnode *vnode = _v;
@@ -898,7 +898,7 @@ rootfs_read_stat(fs_cookie _fs, fs_vnode _v, struct stat *stat)
}
static int
static status_t
rootfs_write_stat(fs_cookie _fs, fs_vnode _v, const struct stat *stat, int stat_mask)
{
#if ROOTFS_TRACE
@@ -968,7 +968,7 @@ static struct fs_calls rootfs_calls = {
};
int
status_t
bootstrap_rootfs(void)
{
dprintf("bootstrap_rootfs: entry\n");
+2 -2
View File
@@ -73,7 +73,7 @@ struct vnode {
fs_vnode private_node;
struct fs_mount *mount;
struct vnode *covered_by;
int ref_count;
int32 ref_count;
bool delete_me;
bool busy;
};
@@ -1039,7 +1039,7 @@ vfs_get_cache_ptr(void *vnode)
int
vfs_set_cache_ptr(void *vnode, void *cache)
{
if (test_and_set((int *)&(((struct vnode *)vnode)->cache), (int)cache, 0) == 0)
if (test_and_set((int32 *)&(((struct vnode *)vnode)->cache), (int32)cache, 0) == 0)
return 0;
return -1;