Changeset fc2e71e in mainline


Ignore:
Timestamp:
2010-01-31T20:53:42Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c16013b
Parents:
1735f3e
Message:

Forbid mounting the same TMPFS instance multiple times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r1735f3e rfc2e71e  
    439439{
    440440        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     441        fs_node_t *rootfn;
    441442        int rc;
    442443
     
    463464        opts[size] = '\0';
    464465
     466        /*
     467         * Check if this device is not already mounted.
     468         */
     469        rc = tmpfs_root_get(&rootfn, dev_handle);
     470        if ((rc == EOK) && (rootfn)) {
     471                (void) tmpfs_node_put(&rootfn);
     472                free(opts);
     473                ipc_answer_0(rid, EEXIST);
     474                return;
     475        }
     476
    465477        /* Initialize TMPFS instance. */
    466478        if (!tmpfs_instance_init(dev_handle)) {
     
    470482        }
    471483
    472         fs_node_t *rootfn;
    473484        rc = tmpfs_root_get(&rootfn, dev_handle);
    474485        assert(rc == EOK);
Note: See TracChangeset for help on using the changeset viewer.