Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 368ee04 in mainline for uspace/app/trace/trace.c


Ignore:
Timestamp:
2017-04-05T18:10:39Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
93ad8166
Parents:
39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jakub/helenos/vfs-2.5-cherrypick

This merge cherry-picks some of the changesets from Jiri Zarevucky's:

lp:~zarevucky-jiri/helenos/vfs-2.5

and then continues independently, yet sometime in a similar vein.

Roughly speaking, Jiri's branch is merged entirely up to its revision
1926 and then cherry-picked on and off until its revision 1965. Among
these changes are:

  • relativization of the API,
  • client-side roots,
  • server-side mounts,
  • inbox for passing arbitrary files from parent to child,
  • some streamlining and cleanup.

Additional changes include:

  • addressing issues introduced by the above changes,
  • client-side I/O cursors (file positions),
  • all HelenOS file system APIs begin with the vfs_ prefix and can be used after including vfs/vfs.h,
  • removal of some POSIX-ish headers and definitions,
  • additional cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/trace.c

    r39f892a9 r368ee04  
    512512                goto error;
    513513
    514         /* Send program pathname */
    515         rc = loader_set_pathname(ldr, path);
     514        /* Send program. */
     515        rc = loader_set_program_path(ldr, path);
    516516        if (rc != EOK)
    517517                goto error;
     
    523523
    524524        /* Send default files */
    525         int *files[4];
     525        int fd_root;
    526526        int fd_stdin;
    527527        int fd_stdout;
    528528        int fd_stderr;
    529529       
    530         if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK))
    531                 files[0] = &fd_stdin;
    532         else
    533                 files[0] = NULL;
    534        
    535         if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK))
    536                 files[1] = &fd_stdout;
    537         else
    538                 files[1] = NULL;
    539        
    540         if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK))
    541                 files[2] = &fd_stderr;
    542         else
    543                 files[2] = NULL;
    544        
    545         files[3] = NULL;
    546        
    547         rc = loader_set_files(ldr, files);
    548         if (rc != EOK)
    549                 goto error;
    550 
     530        fd_root = vfs_root();
     531        if (fd_root >= 0) {
     532                rc = loader_add_inbox(ldr, "root", fd_root);
     533                vfs_put(fd_root);
     534                if (rc != EOK)
     535                        goto error;
     536        }
     537       
     538        if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK)) {
     539                rc = loader_add_inbox(ldr, "stdin", fd_stdin);
     540                if (rc != EOK)
     541                        goto error;
     542        }
     543       
     544        if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK)) {
     545                rc = loader_add_inbox(ldr, "stdout", fd_stdout);
     546                if (rc != EOK)
     547                        goto error;
     548        }
     549       
     550        if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK)) {
     551                rc = loader_add_inbox(ldr, "stderr", fd_stderr);
     552                if (rc != EOK)
     553                        goto error;
     554        }
     555       
    551556        /* Load the program. */
    552557        rc = loader_load_program(ldr);
     
    696701
    697702        p = proto_new("vfs");
    698         o = oper_new("open", 2, arg_def, V_INT_ERRNO, 0, resp_def);
    699         proto_add_oper(p, VFS_IN_OPEN, o);
    700         o = oper_new("read", 1, arg_def, V_ERRNO, 1, resp_def);
     703        o = oper_new("read", 3, arg_def, V_ERRNO, 1, resp_def);
    701704        proto_add_oper(p, VFS_IN_READ, o);
    702         o = oper_new("write", 1, arg_def, V_ERRNO, 1, resp_def);
     705        o = oper_new("write", 3, arg_def, V_ERRNO, 1, resp_def);
    703706        proto_add_oper(p, VFS_IN_WRITE, o);
    704         o = oper_new("seek", 3, arg_def, V_ERRNO, 0, resp_def);
    705         proto_add_oper(p, VFS_IN_SEEK, o);
    706         o = oper_new("truncate", 5, arg_def, V_ERRNO, 0, resp_def);
    707         proto_add_oper(p, VFS_IN_TRUNCATE, o);
    708         o = oper_new("fstat", 1, arg_def, V_ERRNO, 0, resp_def);
    709         proto_add_oper(p, VFS_IN_FSTAT, o);
    710         o = oper_new("close", 1, arg_def, V_ERRNO, 0, resp_def);
    711         proto_add_oper(p, VFS_IN_CLOSE, o);
    712         o = oper_new("mount", 2, arg_def, V_ERRNO, 0, resp_def);
     707        o = oper_new("vfs_resize", 5, arg_def, V_ERRNO, 0, resp_def);
     708        proto_add_oper(p, VFS_IN_RESIZE, o);
     709        o = oper_new("vfs_stat", 1, arg_def, V_ERRNO, 0, resp_def);
     710        proto_add_oper(p, VFS_IN_STAT, o);
     711        o = oper_new("vfs_put", 1, arg_def, V_ERRNO, 0, resp_def);
     712        proto_add_oper(p, VFS_IN_PUT, o);
     713        o = oper_new("vfs_mount", 2, arg_def, V_ERRNO, 0, resp_def);
    713714        proto_add_oper(p, VFS_IN_MOUNT, o);
    714715/*      o = oper_new("unmount", 0, arg_def);
    715716        proto_add_oper(p, VFS_IN_UNMOUNT, o);*/
    716         o = oper_new("sync", 1, arg_def, V_ERRNO, 0, resp_def);
     717        o = oper_new("vfs_sync", 1, arg_def, V_ERRNO, 0, resp_def);
    717718        proto_add_oper(p, VFS_IN_SYNC, o);
    718         o = oper_new("mkdir", 1, arg_def, V_ERRNO, 0, resp_def);
    719         proto_add_oper(p, VFS_IN_MKDIR, o);
    720         o = oper_new("unlink", 0, arg_def, V_ERRNO, 0, resp_def);
    721         proto_add_oper(p, VFS_IN_UNLINK, o);
    722719        o = oper_new("rename", 0, arg_def, V_ERRNO, 0, resp_def);
    723720        proto_add_oper(p, VFS_IN_RENAME, o);
    724         o = oper_new("stat", 0, arg_def, V_ERRNO, 0, resp_def);
    725         proto_add_oper(p, VFS_IN_STAT, o);
    726         o = oper_new("statfs", 0, arg_def, V_ERRNO, 0, resp_def);
     721        o = oper_new("vfs_statfs", 0, arg_def, V_ERRNO, 0, resp_def);
    727722        proto_add_oper(p, VFS_IN_STATFS, o);
     723        o = oper_new("vfs_walk", 2, arg_def, V_INT_ERRNO, 0, resp_def);
     724        proto_add_oper(p, VFS_IN_WALK, o);
     725        o = oper_new("vfs_open", 2, arg_def, V_ERRNO, 0, resp_def);
     726        proto_add_oper(p, VFS_IN_OPEN, o);
     727        o = oper_new("vfs_unlink", 3, arg_def, V_ERRNO, 0, resp_def);
     728        proto_add_oper(p, VFS_IN_UNLINK, o);
    728729
    729730        proto_register(SERVICE_VFS, p);
Note: See TracChangeset for help on using the changeset viewer.