Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2790 → Rev 2791

/trunk/uspace/lib/libfs/libfs.c
148,7 → 148,7
 
void *par = NULL;
void *cur = ops->root_get();
void *tmp = ops->child_get(cur);
void *tmp;
 
if (ops->plb_get_char(next) == '/')
next++; /* eat slash */
155,7 → 155,7
char component[NAME_MAX + 1];
int len = 0;
while (tmp && next <= last) {
while (ops->has_children(cur) && next <= last) {
 
/* collect the component */
if (ops->plb_get_char(next) != '/') {
176,8 → 176,7
len = 0;
 
/* match the component */
while (tmp && !ops->match(cur, tmp, component))
tmp = ops->sibling_get(tmp);
tmp = ops->match(cur, component);
 
/* handle miss: match amongst siblings */
if (!tmp) {
228,11 → 227,10
/* descend one level */
par = cur;
cur = tmp;
tmp = ops->child_get(tmp);
}
 
/* handle miss: excessive components */
if (!tmp && next <= last) {
if (!ops->has_children(cur) && next <= last) {
if (lflag & (L_CREATE | L_LINK)) {
if (!ops->is_directory(cur)) {
ipc_answer_0(rid, ENOTDIR);
/trunk/uspace/lib/libfs/libfs.h
42,7 → 42,7
#include <async.h>
 
typedef struct {
bool (* match)(void *, void *, const char *);
void * (* match)(void *, const char *);
void * (* node_get)(fs_handle_t, dev_handle_t, fs_index_t);
void * (* create)(int);
void (* destroy)(void *);
51,8 → 51,7
fs_index_t (* index_get)(void *);
size_t (* size_get)(void *);
unsigned (* lnkcnt_get)(void *);
void *(* child_get)(void *);
void *(* sibling_get)(void *);
bool (* has_children)(void *);
void *(* root_get)(void);
char (* plb_get_char)(unsigned pos);
bool (* is_directory)(void *);