Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2705 → Rev 2706

/trunk/uspace/srv/fs/tmpfs/tmpfs_ops.c
245,7 → 245,7
char component[NAME_MAX + 1];
int len = 0;
while (next <= last) {
while (dtmp && next <= last) {
 
/* collect the component */
if (PLB_GET_CHAR(next) != '/') {
295,49 → 295,47
/* descent one level */
dcur = dtmp;
dtmp = dtmp->child;
}
 
/* handle miss: excessive components */
if (!dtmp && next <= last) {
if (lflag & L_CREATE) {
if (dcur->type != TMPFS_DIRECTORY) {
ipc_answer_0(rid, ENOTDIR);
/* handle miss: excessive components */
if (!dtmp && next <= last) {
if (lflag & L_CREATE) {
if (dcur->type != TMPFS_DIRECTORY) {
ipc_answer_0(rid, ENOTDIR);
return;
}
 
/* collect next component */
while (next <= last) {
if (PLB_GET_CHAR(next) == '/') {
/* more than one component */
ipc_answer_0(rid, ENOENT);
return;
}
 
/* collect next component */
while (next <= last) {
if (PLB_GET_CHAR(next) == '/') {
/* more than one component */
ipc_answer_0(rid, ENOENT);
return;
}
if (len + 1 == NAME_MAX) {
/* component length overflow */
ipc_answer_0(rid, ENAMETOOLONG);
return;
}
component[len++] = PLB_GET_CHAR(next);
next++; /* process next character */
if (len + 1 == NAME_MAX) {
/* component length overflow */
ipc_answer_0(rid, ENAMETOOLONG);
return;
}
assert(len);
component[len] = '\0';
len = 0;
component[len++] = PLB_GET_CHAR(next);
next++; /* process next character */
}
assert(len);
component[len] = '\0';
len = 0;
unsigned long index;
index = create_node(dcur, component, lflag);
if (index) {
ipc_answer_4(rid, EOK,
tmpfs_reg.fs_handle, dev_handle,
index, 0);
} else {
ipc_answer_0(rid, ENOSPC);
}
return;
unsigned long index;
index = create_node(dcur, component, lflag);
if (index) {
ipc_answer_4(rid, EOK, tmpfs_reg.fs_handle,
dev_handle, index, 0);
} else {
ipc_answer_0(rid, ENOSPC);
}
ipc_answer_0(rid, ENOENT);
return;
}
ipc_answer_0(rid, ENOENT);
return;
}
 
/* handle hit */