diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/argv.c b/src/tests/add-ons/kernel/file_systems/fs_shell/argv.c index 286d443821..37173c2982 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/argv.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/argv.c @@ -28,7 +28,6 @@ char ** build_argv(char *str, int *argc) { int table_size = 16, _argc; - char *ptr=str; char **argv; if (argc == NULL) diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/kernel.c b/src/tests/add-ons/kernel/file_systems/fs_shell/kernel.c index f47860812a..12596f9f22 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/kernel.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/kernel.c @@ -187,7 +187,7 @@ static void dec_vnode(vnode *vn, char r); static int compare_vnode(vnode *vna, vnode *vnb); static nspace * nsidtons(nspace_id nsid); -static int alloc_wd_fd(bool kernel, vnode *vn, bool coe, int *fdp); +//static int alloc_wd_fd(bool kernel, vnode *vn, bool coe, int *fdp); static int is_root(vnode *root, vnode **mount); static int is_mount_vnode(vnode *mount, vnode **root); @@ -197,14 +197,14 @@ static ofile * get_fd(bool kernel, int fd, int type); static int put_fd(ofile *f); static int new_fd(bool kernel, int nfd, ofile *f, int fd, bool coe); static int remove_fd(bool kernel, int fd, int type); -static int get_coe(bool kernel, int fd, int type, bool *coe); -static int set_coe(bool kernel, int fd, int type, bool coe); -static int get_omode(bool kernel, int fd, int type, int *omode); +//static int get_coe(bool kernel, int fd, int type, bool *coe); +//static int set_coe(bool kernel, int fd, int type, bool coe); +//static int get_omode(bool kernel, int fd, int type, int *omode); static int invoke_close(ofile *f); static int invoke_free(ofile *f); static fdarray * new_fds(int num); -static int free_fds(fdarray *fds); +//static int free_fds(fdarray *fds); #define BITSZ(n) (((n) + 31) & ~31) @@ -461,7 +461,6 @@ init_vnode_layer(void) fsystem *fs; nspace *ns; void *data; - size_t sz; extern vnode_ops rootfs; /* XXXdbg */ /* @@ -970,7 +969,6 @@ sys_open(bool kernel, int fd, const char *path, int omode, int perms, void *cookie; ofile *f; int nfd; - fdarray *fds; op_create *opc; op_open *opo; op_free_cookie *opf; @@ -1066,12 +1064,9 @@ sys_open_entry_ref(bool kernel, nspace_id device, vnode_id parent, const char *n { int err; vnode *vn; - vnode_id vnid; void *cookie; ofile *f; int nfd; - fdarray *fds; - op_create *opc; op_open *opo; op_free_cookie *opf; @@ -1901,7 +1896,7 @@ sys_open_query(bool kernel, int fd, const char *path, const char *query, ulong f int err; nspace *ns; fsystem *fs; - vnode *root, *vn, *mount; + vnode *root; printf("sys_open_query() -- start\n"); err = get_file_fd(TRUE, fd, path, TRUE, &root); @@ -1931,7 +1926,7 @@ sys_close_query(bool kernel, int fd, const char *path, void *cookie) int err; nspace *ns; fsystem *fs; - vnode *root, *vn, *mount; + vnode *root; err = get_file_fd(TRUE, fd, path, TRUE, &root); if (err) @@ -1962,7 +1957,7 @@ sys_read_query(bool kernel, int fd, const char *path, void *cookie,struct dirent int err; nspace *ns; fsystem *fs; - vnode *root, *vn, *mount; + vnode *root; long num; err = get_file_fd(TRUE, fd, path, TRUE, &root); @@ -2122,12 +2117,9 @@ parse_path_vn(nspace_id nsid, vnode_id vnid, char **pstart, int eatsymlink, return err; } return parse_path(bvn, pstart, path, eatsymlink, vnp); - -error1: - dec_vnode(bvn, FALSE); - return err; } + static int parse_path(vnode *bvn, char **pstart, char *path, int eatsymlink, vnode **vnp) { @@ -2336,8 +2328,8 @@ restart: else { printf("new_vnode(): vnode already exists with the same data (vnode id = %Ld)\n", vnid); vn->rcnt++; - return; UNLOCK(vnlock); + return 0; } } @@ -2446,7 +2438,7 @@ dec_vnode(vnode *vn, char r) LOCK(vnlock); vn->rcnt--; - if (vn->rcnt == 0) + if (vn->rcnt == 0) { if (vn->remove) { vn->busy = TRUE; move_vnode(vn, LOCKED_LIST); @@ -2463,6 +2455,7 @@ dec_vnode(vnode *vn, char r) move_vnode(ovn, FREE_LIST); } } + } UNLOCK(vnlock); return; @@ -2514,12 +2507,12 @@ move_vnode(vnode *vn, int list) if (vn->list.prev) vn->list.prev->list.next = vn->list.next; else - lists[vn->inlist].head = vn->list.next; + lists[(int)vn->inlist].head = vn->list.next; if (vn->list.next) vn->list.next->list.prev = vn->list.prev; else - lists[vn->inlist].tail = vn->list.prev; - lists[vn->inlist].num--; + lists[(int)vn->inlist].tail = vn->list.prev; + lists[(int)vn->inlist].num--; vn->inlist = list; vn->list.next = NULL; vn->list.prev = lists[list].tail; @@ -2579,7 +2572,7 @@ load_vnode(nspace_id nsid, vnode_id vnid, char r, vnode **vnp) LOCK(vnlock); while (TRUE) { vn = lookup_vnode(nsid, vnid); - if (vn) + if (vn) { if (vn->busy) { UNLOCK(vnlock); snooze(SLEEP_TIME); @@ -2587,6 +2580,7 @@ load_vnode(nspace_id nsid, vnode_id vnid, char r, vnode **vnp) continue; } else break; + } vn = steal_vnode(FREE_LIST); if (!vn) { @@ -2933,6 +2927,7 @@ remove_fd(bool kernel, int fd, int type) return err; } +#if 0 static int get_coe(bool kernel, int fd, int type, bool *coe) { @@ -3004,6 +2999,7 @@ get_omode(bool kernel, int fd, int type, int *omode) UNLOCK(fds->lock); return EBADF; } +#endif static int invoke_close(ofile *f) @@ -3068,6 +3064,7 @@ nsidtons(nspace_id nsid) return ns; } +#if 0 static int alloc_wd_fd(bool kernel, vnode *vn, bool coe, int *fdp) { @@ -3104,7 +3101,7 @@ error2: error1: return err; } - +#endif /* @@ -3217,6 +3214,7 @@ new_fds(int num) return fds; } +#if 0 static int free_fds(fdarray *fds) { @@ -3238,7 +3236,7 @@ free_fds(fdarray *fds) free(fds); return 0; } - +#endif // dummies diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/rootfs.c b/src/tests/add-ons/kernel/file_systems/fs_shell/rootfs.c index 5b954eaac0..6741d079b2 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/rootfs.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/rootfs.c @@ -651,7 +651,7 @@ rootfs_readdir(void *_ns, void *_node, void *_cookie, long *num, nspace *ns; vnode *node; dirpos *cookie; - char *e, *q; + char *e; struct my_dirent *p; long i; vnode *vn; @@ -699,8 +699,9 @@ rootfs_readdir(void *_ns, void *_node, void *_cookie, long *num, } if ((cookie->pos > 2) && (i > 0)) strcpy(cookie->name, last); + *num = i; -exit: + UNLOCK(cookie->lock); UNLOCK(ns->lock); return 0; diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/sl.c b/src/tests/add-ons/kernel/file_systems/fs_shell/sl.c index 100ab17857..8713bab936 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/sl.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/sl.c @@ -282,8 +282,8 @@ void *SearchSL(SkipList l, void *key) void DoForSL(SkipList l, int (*function)(), void *arg) { - register SLNode p,q, fix; - register int k,m, ret; + register SLNode p, q, fix; + register int k, ret; SLNode save[MaxNumberOfLevels], who[MaxNumberOfLevels]; void (*freeitem)() = l->freeitem; @@ -347,7 +347,7 @@ void DoForSL(SkipList l, int (*function)(), void *arg) void DoForRangeSL(SkipList l, void *key, int (*compare)(), int (*func)(), void *arg) { - register int k,m; + register int k; SLNode update[MaxNumberOfLevels]; register SLNode p,q; void (*freeitem)() = l->freeitem; diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/sysdep.c b/src/tests/add-ons/kernel/file_systems/fs_shell/sysdep.c index ac4f909957..b6ac688268 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/sysdep.c +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/sysdep.c @@ -93,7 +93,6 @@ device_is_removeable(int fd) #ifdef unix return 0; /* XXXdbg should do an ioctl or something */ #else - struct stat st; device_geometry dg; if (ioctl(fd, B_GET_GEOMETRY, &dg) < 0) { @@ -335,6 +334,7 @@ system_time(void) #endif /* unix */ #ifdef __BEOS__ +#include void dprintf(const char *format, ...) diff --git a/src/tests/add-ons/kernel/file_systems/fs_shell/tracker.cpp b/src/tests/add-ons/kernel/file_systems/fs_shell/tracker.cpp index f2feab4e51..b5558af0b9 100644 --- a/src/tests/add-ons/kernel/file_systems/fs_shell/tracker.cpp +++ b/src/tests/add-ons/kernel/file_systems/fs_shell/tracker.cpp @@ -35,12 +35,12 @@ tracker_query_file(dev_t device, ino_t parent, char *name) sys_close(true, fd); } - +#if 0 static void tracker_scan_files(void) { } - +#endif extern "C" int32 tracker_loop(void *data) @@ -74,4 +74,5 @@ tracker_loop(void *data) } delete_port(gTrackerPort); + return B_OK; }