Changeset e095644 in mainline for uspace/lib/libc/generic/vfs/vfs.c


Ignore:
Timestamp:
2010-01-24T17:32:20Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50fda24
Parents:
fea0ce6 (diff), ae75e2e3 (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 partial support for the unmount feature.
VFS_OUT_UNMOUNT and VFS_OUT_UNMOUNTED not yet implemented by DEVFS, FAT and
TMPFS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/vfs/vfs.c

    rfea0ce6 re095644  
    197197}
    198198
     199int unmount(const char *mp)
     200{
     201        ipcarg_t rc;
     202        ipcarg_t rc_orig;
     203        aid_t req;
     204        size_t mpa_size;
     205        char *mpa;
     206       
     207        mpa = absolutize(mp, &mpa_size);
     208        if (!mpa)
     209                return ENOMEM;
     210       
     211        futex_down(&vfs_phone_futex);
     212        async_serialize_start();
     213        vfs_connect();
     214       
     215        req = async_send_0(vfs_phone, VFS_IN_UNMOUNT, NULL);
     216        rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
     217        if (rc != EOK) {
     218                async_wait_for(req, &rc_orig);
     219                async_serialize_end();
     220                futex_up(&vfs_phone_futex);
     221                free(mpa);
     222                if (rc_orig == EOK)
     223                        return (int) rc;
     224                else
     225                        return (int) rc_orig;
     226        }
     227       
     228
     229        async_wait_for(req, &rc);
     230        async_serialize_end();
     231        futex_up(&vfs_phone_futex);
     232        free(mpa);
     233       
     234        return (int) rc;
     235}
     236
    199237static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag)
    200238{
Note: See TracChangeset for help on using the changeset viewer.