Changeset b5553a2 in mainline for uspace/srv/vfs


Ignore:
Timestamp:
2008-02-16T11:23:19Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f17667a
Parents:
8ccd2ea
Message:

Introduce the notion of VFS node link counts.

Location:
uspace/srv/vfs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs.h

    r8ccd2ea rb5553a2  
    174174        vfs_triplet_t triplet;
    175175        size_t size;
     176        unsigned lnkcnt;
    176177} vfs_lookup_res_t;
    177178
     
    182183typedef struct {
    183184        VFS_TRIPLET;            /**< Identity of the node. */
    184         unsigned refcnt;        /**< Usage counter. */
     185
     186        /**
     187         * Usage counter.  This includes, but is not limited to, all vfs_file_t
     188         * structures that reference this node.
     189         */
     190        unsigned refcnt;
     191       
     192        /** Number of names this node has in the file system namespace. */
     193        unsigned lnkcnt;
     194
    185195        link_t nh_link;         /**< Node hash-table link. */
    186196        size_t size;            /**< Cached size of the file. */
  • uspace/srv/vfs/vfs_lookup.c

    r8ccd2ea rb5553a2  
    169169                result->triplet.index = (int) IPC_GET_ARG3(answer);
    170170                result->size = (size_t) IPC_GET_ARG4(answer);
     171                result->lnkcnt = (unsigned) IPC_GET_ARG5(answer);
    171172        }
    172173
  • uspace/srv/vfs/vfs_node.c

    r8ccd2ea rb5553a2  
    149149                node->index = result->triplet.index;
    150150                node->size = result->size;
     151                node->lnkcnt = result->lnkcnt;
    151152                link_initialize(&node->nh_link);
    152153                rwlock_initialize(&node->contents_rwlock);
     
    157158
    158159        assert(node->size == result->size);
     160        assert(node->lnkcnt == result->lnkcnt);
    159161
    160162        _vfs_node_addref(node);
Note: See TracChangeset for help on using the changeset viewer.