Changeset f7376cbf in mainline


Ignore:
Timestamp:
2010-01-25T21:04:49Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ea44bd1
Parents:
ae75e2e3
Message:

Rename L_NOCROSS_LAST_MP to L_MP and introduce L_ROOT.
Lookup the mounted root in vfs_unmount() using L_ROOT.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/ipc/vfs.h

    rae75e2e3 rf7376cbf  
    101101 * No lookup flags used.
    102102 */
    103 #define L_NONE  0
     103#define L_NONE                  0
    104104
    105105/**
     
    108108 * with L_DIRECTORY.
    109109 */
    110 #define L_FILE  1
     110#define L_FILE                  1
    111111
    112112/**
    113  * Lookup wil succeed only if the object is a directory. If L_CREATE is
     113 * Lookup will succeed only if the object is a directory. If L_CREATE is
    114114 * specified, an empty directory will be created. This flag is mutually
    115115 * exclusive with L_FILE.
    116116 */
    117 #define L_DIRECTORY  2
     117#define L_DIRECTORY             2
     118
     119/**
     120 * Lookup will succeed only if the object is a root directory. The flag is
     121 * mutually exclusive with L_FILE and L_MP.
     122 */
     123#define L_ROOT                  4
     124
     125/**
     126 * Lookup will succeed only if the object is a mount point. The flag is mutually
     127 * exclusive with L_FILE and L_ROOT.
     128 */
     129#define L_MP                    8
     130
    118131
    119132/**
     
    121134 * object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used.
    122135 */
    123 #define L_EXCLUSIVE  4
     136#define L_EXCLUSIVE             16
    124137
    125138/**
    126139 * L_CREATE is used for creating both regular files and directories.
    127140 */
    128 #define L_CREATE  8
     141#define L_CREATE                32
    129142
    130143/**
    131144 * L_LINK is used for linking to an already existing nodes.
    132145 */
    133 #define L_LINK  16
     146#define L_LINK                  64
    134147
    135148/**
     
    138151 * VFS_UNLINK.
    139152 */
    140 #define L_UNLINK  32
     153#define L_UNLINK                128
    141154
    142155/**
     
    146159 * client.
    147160 */
    148 #define L_OPEN  64
    149 
    150 /**
    151  * L_NOCROSS_LAST_MP is used exclusively during the VFS_IN_UNMOUNT operation. It
    152  * tells the lookup routine not to cross the last mount point in the lookup
    153  * path.
    154  */
    155 #define L_NOCROSS_LAST_MP       128
     161#define L_OPEN                  256
    156162
    157163#endif
  • uspace/lib/libfs/libfs.c

    rae75e2e3 rf7376cbf  
    315315
    316316                if ((tmp) && (tmp->mp_data.mp_active) &&
    317                     (!(lflag & L_NOCROSS_LAST_MP) || (next <= last))) {
     317                    (!(lflag & L_MP) || (next <= last))) {
    318318                        if (next > last)
    319319                                next = last = first;
     
    486486                goto out;
    487487        }
     488
     489        if ((lflag & L_ROOT) && par) {
     490                ipc_answer_0(rid, EINVAL);
     491                goto out;
     492        }
    488493       
    489494out_with_answer:
  • uspace/srv/vfs/vfs_ops.c

    rae75e2e3 rf7376cbf  
    459459         * Lookup the mounted root and instantiate it.
    460460         */
    461         rc = vfs_lookup_internal(mp, L_NONE, &mr_res, NULL);
     461        rc = vfs_lookup_internal(mp, L_ROOT, &mr_res, NULL);
    462462        if (rc != EOK) {
    463463                fibril_rwlock_write_unlock(&namespace_rwlock);
     
    521521                 */
    522522
    523                 /*
    524                  * The L_NOCROSS_LAST_MP flag is essential if we really want to
    525                  * lookup the mount point and not the mounted root.
    526                  */
    527                 rc = vfs_lookup_internal(mp, L_NOCROSS_LAST_MP, &mp_res, NULL);
     523                rc = vfs_lookup_internal(mp, L_MP, &mp_res, NULL);
    528524                free(mp);
    529525                if (rc != EOK) {
     
    595591        /*
    596592         * Make sure that we are called with exactly one of L_FILE and
    597          * L_DIRECTORY. Make sure that the user does not pass L_OPEN or
    598          * L_NOCROSS_LAST_MP.
     593         * L_DIRECTORY. Make sure that the user does not pass L_OPEN,
     594         * L_ROOT or L_MP.
    599595         */
    600596        if (((lflag & (L_FILE | L_DIRECTORY)) == 0) ||
    601597            ((lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) ||
    602             (lflag & L_OPEN) || (lflag & L_NOCROSS_LAST_MP)) {
     598            (lflag & (L_OPEN | L_ROOT | L_MP))) {
    603599                ipc_answer_0(rid, EINVAL);
    604600                return;
Note: See TracChangeset for help on using the changeset viewer.