Changeset ae78b53 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2008-01-19T13:40:38Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4bb31f7
Parents:
5973fd0
Message:

Introduce the notion of lflag (i.e. lookup flags) to support the ability to
limit the scope of VFS node types that can be opened by open() and opendir(). In
the future, lflag will also specify actions for VFS_LOOKUP handlers that will be
carried out in situations such as the VFS node is not found (e.g. implementation
of mkdir() and open() with O_CREAT in oflag).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r5973fd0 rae78b53  
    7272        };
    7373
    74         return vfs_lookup_internal("/", strlen("/"), result, &altroot);
     74        return vfs_lookup_internal("/", strlen("/"), L_DIRECTORY, result,
     75            &altroot);
    7576}
    7677
     
    196197                 */
    197198                rwlock_write_lock(&namespace_rwlock);
    198                 rc = vfs_lookup_internal(buf, size, &mp_res, NULL);
     199                rc = vfs_lookup_internal(buf, size, L_DIRECTORY, &mp_res,
     200                    NULL);
    199201                if (rc != EOK) {
    200202                        /*
     
    298300
    299301        /*
    300          * The POSIX interface is open(path, flags, mode).
    301          * We can receive flags and mode along with the VFS_OPEN call; the path
     302         * The POSIX interface is open(path, oflag, mode).
     303         * We can receive oflags and mode along with the VFS_OPEN call; the path
    302304         * will need to arrive in another call.
    303          */
    304         int flags = IPC_GET_ARG1(*request);
    305         int mode = IPC_GET_ARG2(*request);
     305         *
     306         * We also receive one private, non-POSIX set of flags called lflag
     307         * used to pass information to vfs_lookup_internal().
     308         */
     309        int lflag = IPC_GET_ARG1(*request);
     310        int oflag = IPC_GET_ARG2(*request);
     311        int mode = IPC_GET_ARG3(*request);
    306312        size_t len;
    307313
     
    346352         */
    347353        vfs_lookup_res_t lr;
    348         rc = vfs_lookup_internal(path, len, &lr, NULL);
     354        rc = vfs_lookup_internal(path, len, lflag, &lr, NULL);
    349355        if (rc) {
    350356                rwlock_read_unlock(&namespace_rwlock);
Note: See TracChangeset for help on using the changeset viewer.