0004-Use-struct-list_head-instead-of-GList.patch (1559B)
- From 3ed67a49b1daf016a2cffaad89fdfb2b4a89892c Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Sun, 5 Jun 2016 17:30:20 -0700
- Subject: [PATCH] Use struct list_head instead of GList
- ---
- sshfs.c | 16 +++++++---------
- 1 file changed, 7 insertions(+), 9 deletions(-)
- diff --git a/sshfs.c b/sshfs.c
- index 391afdd..9c074a3 100644
- --- a/sshfs.c
- +++ b/sshfs.c
- @@ -2090,14 +2090,14 @@ static int sshfs_req_pending(struct request *req)
- static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset,
- fuse_fill_dir_t filler)
- {
- + int done = 0;
- int err = 0;
- int outstanding = 0;
- int max = READDIR_START;
- - GList *list = NULL;
- -
- - int done = 0;
- + struct list_head list;
- assert(offset == 0);
- + list_init(&list);
- while (!done || outstanding) {
- struct request *req;
- struct buffer name;
- @@ -2112,16 +2112,14 @@ static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset,
- break;
- }
- - list = g_list_append(list, req);
- + list_add(&req->list, &list);
- outstanding++;
- }
- if (outstanding) {
- - GList *first;
- /* wait for response to next request */
- - first = g_list_first(list);
- - req = first->data;
- - list = g_list_delete_link(list, first);
- + req = list_entry(list.prev, struct request, list);
- + list_del(&req->list);
- outstanding--;
- if (done) {
- @@ -2160,7 +2158,7 @@ static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset,
- }
- }
- }
- - assert(list == NULL);
- + assert(list_empty(&list));
- return err;
- }
- --
- 2.24.0