[PATCH] fuse: introduce list for requests under I/O

Create a new list for requests in the process of being transfered to/from
userspace. This will be needed to be able to abort all requests even those
currently under I/O

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Miklos Szeredi and committed by
Linus Torvalds
d77a1d5b 83cfd493

+10 -6
+4 -4
fs/fuse/dev.c
··· 181 181 */ 182 182 static void request_end(struct fuse_conn *fc, struct fuse_req *req) 183 183 { 184 + list_del(&req->list); 184 185 req->state = FUSE_REQ_FINISHED; 185 186 spin_unlock(&fuse_lock); 186 187 if (req->background) { ··· 642 641 643 642 req = list_entry(fc->pending.next, struct fuse_req, list); 644 643 req->state = FUSE_REQ_READING; 645 - list_del_init(&req->list); 644 + list_move(&req->list, &fc->io); 646 645 647 646 in = &req->in; 648 647 reqsize = in->h.len; ··· 676 675 request_end(fc, req); 677 676 else { 678 677 req->state = FUSE_REQ_SENT; 679 - list_add_tail(&req->list, &fc->processing); 678 + list_move_tail(&req->list, &fc->processing); 680 679 spin_unlock(&fuse_lock); 681 680 } 682 681 return reqsize; ··· 769 768 if (!req) 770 769 goto err_unlock; 771 770 772 - list_del_init(&req->list); 773 771 if (req->interrupted) { 774 772 spin_unlock(&fuse_lock); 775 773 fuse_copy_finish(&cs); ··· 776 776 request_end(fc, req); 777 777 return -ENOENT; 778 778 } 779 + list_move(&req->list, &fc->io); 779 780 req->out.h = oh; 780 781 req->locked = 1; 781 782 cs.req = req; ··· 836 835 while (!list_empty(head)) { 837 836 struct fuse_req *req; 838 837 req = list_entry(head->next, struct fuse_req, list); 839 - list_del_init(&req->list); 840 838 req->out.h.error = -ECONNABORTED; 841 839 request_end(fc, req); 842 840 spin_lock(&fuse_lock);
+5 -2
fs/fuse/fuse_i.h
··· 124 124 * A request to the client 125 125 */ 126 126 struct fuse_req { 127 - /** This can be on either unused_list, pending or processing 128 - lists in fuse_conn */ 127 + /** This can be on either unused_list, pending processing or 128 + io lists in fuse_conn */ 129 129 struct list_head list; 130 130 131 131 /** Entry on the background list */ ··· 222 222 223 223 /** The list of requests being processed */ 224 224 struct list_head processing; 225 + 226 + /** The list of requests under I/O */ 227 + struct list_head io; 225 228 226 229 /** Requests put in the background (RELEASE or any other 227 230 interrupted request) */
+1
fs/fuse/inode.c
··· 382 382 init_waitqueue_head(&fc->waitq); 383 383 INIT_LIST_HEAD(&fc->pending); 384 384 INIT_LIST_HEAD(&fc->processing); 385 + INIT_LIST_HEAD(&fc->io); 385 386 INIT_LIST_HEAD(&fc->unused_list); 386 387 INIT_LIST_HEAD(&fc->background); 387 388 sema_init(&fc->outstanding_sem, 1); /* One for INIT */