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


Ignore:
Timestamp:
2008-02-17T13:32:53Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2616965d
Parents:
b5553a2
Message:

Add the VFS_FREE operation. This operation frees up whatever resources used by
a file system node for which there is no name (i.e. an unlinked node).

Cleanup VFS operations enums and remove unneeded VFS operations.

File:
1 edited

Legend:

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

    rb5553a2 rf17667a  
    497497}
    498498
     499void tmpfs_free(ipc_callid_t rid, ipc_call_t *request)
     500{
     501        int dev_handle = IPC_GET_ARG1(*request);
     502        unsigned long index = IPC_GET_ARG2(*request);
     503
     504        link_t *hlp;
     505        hlp = hash_table_find(&dentries, &index);
     506        if (!hlp) {
     507                ipc_answer_0(rid, ENOENT);
     508                return;
     509        }
     510        tmpfs_dentry_t *dentry = hash_table_get_instance(hlp, tmpfs_dentry_t,
     511            dh_link);
     512       
     513        assert(!dentry->parent);
     514        assert(!dentry->child);
     515        assert(!dentry->sibling);
     516
     517        if (dentry->type == TMPFS_FILE)
     518                free(dentry->data);
     519        free(dentry->name);
     520        free(dentry);
     521
     522        ipc_answer_0(rid, EOK);
     523}
     524
    499525/**
    500526 * @}
Note: See TracChangeset for help on using the changeset viewer.