res = -ENOENT;
path = get_path_name(f, in->ino, name);
if(path != NULL) {
+ if(f->flags & FUSE_DEBUG) {
+ printf("LOOKUP %s\n", path);
+ fflush(stdout);
+ }
res = -ENOSYS;
if(f->op.getattr)
res = f->op.getattr(path, &buf);
if(res == 0) {
convert_stat(&buf, &arg.attr);
arg.ino = find_node(f, in->ino, name, &arg.attr, in->unique);
+ if(f->flags & FUSE_DEBUG) {
+ printf(" LOOKUP: %li\n", arg.ino);
+ fflush(stdout);
+ }
}
send_reply(f, in, res, &arg, sizeof(arg));
}
res = -ENOENT;
path = get_path(f, in->ino);
if(path != NULL) {
+ if(f->flags & FUSE_DEBUG) {
+ printf("READ %u bytes from %llu\n", arg->size, arg->offset);
+ fflush(stdout);
+ }
+
res = -ENOSYS;
if(f->op.read)
res = f->op.read(path, buf, arg->size, arg->offset);
if(res > 0) {
size = res;
res = 0;
+ if(f->flags & FUSE_DEBUG) {
+ printf(" READ %u bytes\n", size);
+ fflush(stdout);
+ }
}
out->unique = in->unique;
out->error = res;
res = -ENOENT;
path = get_path(f, in->ino);
if(path != NULL) {
+ if(f->flags & FUSE_DEBUG) {
+ printf("WRITE %u bytes to %llu\n", arg->size, arg->offset);
+ fflush(stdout);
+ }
+
res = -ENOSYS;
if(f->op.write)
res = f->op.write(path, arg->buf, arg->size, arg->offset);