Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2755 → Rev 2756

/trunk/uspace/srv/fs/tmpfs/tmpfs.h
54,6 → 54,7
TMPFS_FILE,
TMPFS_DIRECTORY
} type;
unsigned lnkcnt; /**< Link count. */
size_t size; /**< File size if type is TMPFS_FILE. */
void *data; /**< File content's if type is TMPFS_FILE. */
} tmpfs_dentry_t;
/trunk/uspace/srv/fs/tmpfs/tmpfs_ops.c
86,7 → 86,7
 
static unsigned tmpfs_lnkcnt_get(void *nodep)
{
return 1;
return ((tmpfs_dentry_t *) nodep)->lnkcnt;
}
 
static void *tmpfs_child_get(void *nodep)
175,6 → 175,7
dentry->child = NULL;
dentry->name = NULL;
dentry->type = TMPFS_NONE;
dentry->lnkcnt = 0;
dentry->size = 0;
dentry->data = NULL;
link_initialize(&dentry->dh_link);
233,6 → 234,9
char *name = malloc(len + 1);
if (!name)
return false;
childp->lnkcnt++;
strcpy(name, nm);
childp->name = name;
 
275,6 → 279,8
free(dentry->name);
dentry->name = NULL;
 
dentry->lnkcnt--;
 
return EOK;
}
 
282,6 → 288,7
{
tmpfs_dentry_t *dentry = (tmpfs_dentry_t *) nodep;
assert(!dentry->lnkcnt);
assert(!dentry->child);
assert(!dentry->sibling);