Changeset 4ef6645 in mainline


Ignore:
Timestamp:
2009-05-23T09:51:37Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
493853ec
Parents:
16d17ca
Message:

Surprisingly easy support for homogenous mounts.
It works by simply allowing autoconnections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r16d17ca r4ef6645  
    356356                GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data),
    357357                    return ENOENT);
    358                 if (phone  == cloned_phone)
    359                         return EEXISTS;
    360358                if (cloned_phone < phone) {
    361359                        mutex_lock(&cloned_phone->lock);
    362360                        mutex_lock(&phone->lock);
     361                } else if (cloned_phone > phone) {
     362                        mutex_lock(&phone->lock);
     363                        mutex_lock(&cloned_phone->lock);
    363364                } else {
    364365                        mutex_lock(&phone->lock);
    365                         mutex_lock(&cloned_phone->lock);
    366366                }
    367367                if ((cloned_phone->state != IPC_PHONE_CONNECTED) ||
    368368                    phone->state != IPC_PHONE_CONNECTED) {
    369                         mutex_unlock(&cloned_phone->lock);
     369                        if (cloned_phone != phone)
     370                                mutex_unlock(&cloned_phone->lock);
    370371                        mutex_unlock(&phone->lock);
    371372                        return EINVAL;
     
    379380                newphid = phone_alloc(phone->callee->task);
    380381                if (newphid < 0) {
    381                         mutex_unlock(&cloned_phone->lock);
     382                        if (cloned_phone != phone)
     383                                mutex_unlock(&cloned_phone->lock);
    382384                        mutex_unlock(&phone->lock);
    383385                        return ELIMIT;
     
    385387                ipc_phone_connect(&phone->callee->task->phones[newphid],
    386388                    cloned_phone->callee);
    387                 mutex_unlock(&cloned_phone->lock);
     389                if (cloned_phone != phone)
     390                        mutex_unlock(&cloned_phone->lock);
    388391                mutex_unlock(&phone->lock);
    389392                /* Set the new phone for the callee. */
Note: See TracChangeset for help on using the changeset viewer.