Changeset adc8a63 in mainline


Ignore:
Timestamp:
2008-03-05T19:48:54Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3ca7059
Parents:
5fec355
Message:

Introduce real link counts for TMPFS.

Location:
uspace/srv/fs/tmpfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs.h

    r5fec355 radc8a63  
    5555                TMPFS_DIRECTORY
    5656        } type;
     57        unsigned lnkcnt;        /**< Link count. */
    5758        size_t size;            /**< File size if type is TMPFS_FILE. */
    5859        void *data;             /**< File content's if type is TMPFS_FILE. */
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r5fec355 radc8a63  
    8787static unsigned tmpfs_lnkcnt_get(void *nodep)
    8888{
    89         return 1;
     89        return ((tmpfs_dentry_t *) nodep)->lnkcnt;
    9090}
    9191
     
    176176        dentry->name = NULL;
    177177        dentry->type = TMPFS_NONE;
     178        dentry->lnkcnt = 0;
    178179        dentry->size = 0;
    179180        dentry->data = NULL;
     
    234235        if (!name)
    235236                return false;
     237       
     238        childp->lnkcnt++;
     239       
    236240        strcpy(name, nm);
    237241        childp->name = name;
     
    276280        dentry->name = NULL;
    277281
     282        dentry->lnkcnt--;
     283
    278284        return EOK;
    279285}
     
    283289        tmpfs_dentry_t *dentry = (tmpfs_dentry_t *) nodep;
    284290       
     291        assert(!dentry->lnkcnt);
    285292        assert(!dentry->child);
    286293        assert(!dentry->sibling);
Note: See TracChangeset for help on using the changeset viewer.