dev.c (334f485df85ac7736ebe14940bf0a059c5f26d7d) dev.c (e5e5558e923f35839108a12718494ecb73fb782f)
1/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8

--- 677 unchanged lines hidden (view full) ---

686 struct fuse_req *req;
687 req = list_entry(entry, struct fuse_req, list);
688 if (req->in.h.unique == unique)
689 return req;
690 }
691 return NULL;
692}
693
1/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8

--- 677 unchanged lines hidden (view full) ---

686 struct fuse_req *req;
687 req = list_entry(entry, struct fuse_req, list);
688 if (req->in.h.unique == unique)
689 return req;
690 }
691 return NULL;
692}
693
694/* fget() needs to be done in this context */
695static void process_getdir(struct fuse_req *req)
696{
697 struct fuse_getdir_out_i *arg = req->out.args[0].value;
698 arg->file = fget(arg->fd);
699}
700
694static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,
695 unsigned nbytes)
696{
697 unsigned reqsize = sizeof(struct fuse_out_header);
698
699 if (out->h.error)
700 return nbytes != reqsize ? -EINVAL : 0;
701

--- 63 unchanged lines hidden (view full) ---

765 err = copy_out_args(&cs, &req->out, nbytes);
766 fuse_copy_finish(&cs);
767
768 spin_lock(&fuse_lock);
769 req->locked = 0;
770 if (!err) {
771 if (req->interrupted)
772 err = -ENOENT;
701static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,
702 unsigned nbytes)
703{
704 unsigned reqsize = sizeof(struct fuse_out_header);
705
706 if (out->h.error)
707 return nbytes != reqsize ? -EINVAL : 0;
708

--- 63 unchanged lines hidden (view full) ---

772 err = copy_out_args(&cs, &req->out, nbytes);
773 fuse_copy_finish(&cs);
774
775 spin_lock(&fuse_lock);
776 req->locked = 0;
777 if (!err) {
778 if (req->interrupted)
779 err = -ENOENT;
780 else if (req->in.h.opcode == FUSE_GETDIR && !oh.error)
781 process_getdir(req);
773 } else if (!req->interrupted)
774 req->out.h.error = -EIO;
775 request_end(fc, req);
776
777 return err ? err : nbytes;
778
779 err_unlock:
780 spin_unlock(&fuse_lock);

--- 104 unchanged lines hidden ---
782 } else if (!req->interrupted)
783 req->out.h.error = -EIO;
784 request_end(fc, req);
785
786 return err ? err : nbytes;
787
788 err_unlock:
789 spin_unlock(&fuse_lock);

--- 104 unchanged lines hidden ---