Changeset d42976c in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c


Ignore:
Timestamp:
2010-02-04T20:14:20Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19f24fd, a281fc82
Parents:
4cac2d69 (diff), 393bef1 (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 fixes from the file system branch.
In particular, prevent mounting the same TMPFS file system instance twice for
now as the proper support will require some tweaking.

File:
1 edited

Legend:

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

    r4cac2d69 rd42976c  
    168168                    (nodep->index == key[NODES_KEY_INDEX]));
    169169        default:
    170                 abort();
    171         }
     170                assert((keys == 1) || (keys == 2));
     171        }
     172
     173        return 0;
    172174}
    173175
     
    439441{
    440442        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     443        fs_node_t *rootfn;
     444        int rc;
    441445       
    442         /* Accept the mount options */
     446        /* Accept the mount options. */
    443447        char *opts;
    444         int rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    445        
     448        rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    446449        if (rc != EOK) {
    447450                ipc_answer_0(rid, rc);
     451                return;
     452        }
     453
     454        /* Check if this device is not already mounted. */
     455        rc = tmpfs_root_get(&rootfn, dev_handle);
     456        if ((rc == EOK) && (rootfn)) {
     457                (void) tmpfs_node_put(rootfn);
     458                free(opts);
     459                ipc_answer_0(rid, EEXIST);
    448460                return;
    449461        }
     
    456468        }
    457469
    458         fs_node_t *rootfn;
    459470        rc = tmpfs_root_get(&rootfn, dev_handle);
    460471        assert(rc == EOK);
Note: See TracChangeset for help on using the changeset viewer.