/trunk/uspace/lib/libfs/libfs.c |
---|
196,12 → 196,15 |
nodep = ops->node_get(dev_handle, |
index); |
if (nodep) { |
if (!ops->link(cur, nodep, component)) { |
int rc; |
rc = ops->link(cur, nodep, component); |
if (rc != EOK) { |
if (lflag & L_CREATE) { |
(void)ops->destroy( |
nodep); |
} |
ipc_answer_0(rid, ENOSPC); |
ipc_answer_0(rid, rc); |
} else { |
ipc_answer_5(rid, EOK, |
fs_handle, dev_handle, |
266,10 → 269,13 |
else |
nodep = ops->node_get(dev_handle, index); |
if (nodep) { |
if (!ops->link(cur, nodep, component)) { |
int rc; |
rc = ops->link(cur, nodep, component); |
if (rc != EOK) { |
if (lflag & L_CREATE) |
(void)ops->destroy(nodep); |
ipc_answer_0(rid, ENOSPC); |
ipc_answer_0(rid, rc); |
} else { |
ipc_answer_5(rid, EOK, |
fs_handle, dev_handle, |
/trunk/uspace/lib/libfs/libfs.h |
---|
47,7 → 47,7 |
void (* node_put)(void *); |
void * (* create)(dev_handle_t, int); |
int (* destroy)(void *); |
bool (* link)(void *, void *, const char *); |
int (* link)(void *, void *, const char *); |
int (* unlink)(void *, void *); |
fs_index_t (* index_get)(void *); |
size_t (* size_get)(void *); |
/trunk/uspace/srv/fs/tmpfs/tmpfs_dump.c |
---|
59,6 → 59,7 |
{ |
struct rdentry entry; |
libfs_ops_t *ops = &tmpfs_libfs_ops; |
int rc; |
do { |
char *fname; |
93,7 → 94,8 |
} |
fname[entry.len] = 0; |
if (!ops->link((void *) parent, (void *) node, fname)) { |
rc = ops->link((void *) parent, (void *) node, fname); |
if (rc != EOK) { |
ops->destroy((void *) node); |
free(fname); |
return false; |
134,8 → 136,9 |
return false; |
} |
fname[entry.len] = 0; |
if (!ops->link((void *) parent, (void *) node, fname)) { |
rc = ops->link((void *) parent, (void *) node, fname); |
if (rc != EOK) { |
ops->destroy((void *) node); |
free(fname); |
return false; |
/trunk/uspace/srv/fs/tmpfs/tmpfs_ops.c |
---|
75,7 → 75,7 |
static void *tmpfs_node_get(dev_handle_t, fs_index_t); |
static void tmpfs_node_put(void *); |
static void *tmpfs_create_node(dev_handle_t, int); |
static bool tmpfs_link_node(void *, void *, const char *); |
static int tmpfs_link_node(void *, void *, const char *); |
static int tmpfs_unlink_node(void *, void *); |
static int tmpfs_destroy_node(void *); |
308,7 → 308,7 |
return (void *) node; |
} |
bool tmpfs_link_node(void *prnt, void *chld, const char *nm) |
int tmpfs_link_node(void *prnt, void *chld, const char *nm) |
{ |
tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt; |
tmpfs_dentry_t *childp = (tmpfs_dentry_t *) chld; |
317,13 → 317,13 |
tmpfs_name_t *namep = malloc(sizeof(tmpfs_name_t)); |
if (!namep) |
return false; |
return ENOMEM; |
tmpfs_name_initialize(namep); |
size_t len = strlen(nm); |
namep->name = malloc(len + 1); |
if (!namep->name) { |
free(namep); |
return false; |
return ENOMEM; |
} |
strcpy(namep->name, nm); |
namep->parent = parentp; |
343,7 → 343,7 |
parentp->child = childp; |
} |
return true; |
return EOK; |
} |
int tmpfs_unlink_node(void *prnt, void *chld) |
/trunk/uspace/srv/fs/fat/fat_ops.c |
---|
223,7 → 223,7 |
static void fat_node_put(void *); |
static void *fat_create_node(dev_handle_t, int); |
static int fat_destroy_node(void *); |
static bool fat_link(void *, void *, const char *); |
static int fat_link(void *, void *, const char *); |
static int fat_unlink(void *, void *); |
static void *fat_match(void *, const char *); |
static fs_index_t fat_index_get(void *); |
341,9 → 341,9 |
return EOK; |
} |
bool fat_link(void *prnt, void *chld, const char *name) |
int fat_link(void *prnt, void *chld, const char *name) |
{ |
return false; /* not supported at the moment */ |
return ENOTSUP; /* not supported at the moment */ |
} |
int fat_unlink(void *prnt, void *chld) |
525,6 → 525,10 |
.is_file = fat_is_file |
}; |
/* |
* VFS operations. |
*/ |
void fat_mounted(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |