diff options
| author | Michael Forney <mforney@mforney.org> | 2018-12-23 10:56:22 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2018-12-23 13:40:49 -0800 |
| commit | ef510023de45de4ef587f35846022f00945ef5bd (patch) | |
| tree | 29ca5dcbd2829b528e852f36db191eedbed18e6c /pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch | |
| parent | d635d9281ba10519821736ad91d2beddee5361ba (diff) | |
sshfs: Update to 3.5.1
Diffstat (limited to 'pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch')
| -rw-r--r-- | pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch b/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch index 871cf1c4..d10bfa54 100644 --- a/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch +++ b/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch @@ -1,4 +1,4 @@ -From 2948f0391fa23c4ec962b22e1814eced97bbea8a Mon Sep 17 00:00:00 2001 +From 43d45856c8712f2700c6008de28b27272345460b Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 5 Jun 2016 17:25:36 -0700 Subject: [PATCH] Use a compact array and free list for requests @@ -8,7 +8,7 @@ Subject: [PATCH] Use a compact array and free list for requests 1 file changed, 80 insertions(+), 45 deletions(-) diff --git a/sshfs.c b/sshfs.c -index 5ae54c5..6da5c9f 100644 +index 6abd8ea..5b328e3 100644 --- a/sshfs.c +++ b/sshfs.c @@ -171,6 +171,17 @@ struct request { @@ -38,7 +38,7 @@ index 5ae54c5..6da5c9f 100644 pthread_mutex_t lock; pthread_mutex_t lock_write; int processing_thread_started; -@@ -1168,12 +1179,6 @@ static int do_write(struct iovec *iov, size_t count) +@@ -1169,12 +1180,6 @@ static int do_write(struct iovec *iov, size_t count) return 0; } @@ -51,7 +51,7 @@ index 5ae54c5..6da5c9f 100644 static void buf_to_iov(const struct buffer *buf, struct iovec *iov) { iov->iov_base = buf->p; -@@ -1266,6 +1271,43 @@ static void request_free(struct request *req) +@@ -1267,6 +1272,43 @@ static void request_free(struct request *req) g_free(req); } @@ -95,7 +95,7 @@ index 5ae54c5..6da5c9f 100644 static void chunk_free(struct read_chunk *chunk) { while (!list_empty(&chunk->reqs)) { -@@ -1295,21 +1337,6 @@ static void chunk_put_locked(struct read_chunk *chunk) +@@ -1296,21 +1338,6 @@ static void chunk_put_locked(struct read_chunk *chunk) pthread_mutex_unlock(&sshfs.lock); } @@ -117,7 +117,7 @@ index 5ae54c5..6da5c9f 100644 static int process_one_request(void) { int res; -@@ -1326,8 +1353,7 @@ static int process_one_request(void) +@@ -1327,8 +1354,7 @@ static int process_one_request(void) return -1; pthread_mutex_lock(&sshfs.lock); @@ -127,7 +127,7 @@ index 5ae54c5..6da5c9f 100644 if (req == NULL) fprintf(stderr, "request %i not found\n", id); else { -@@ -1339,7 +1365,7 @@ static int process_one_request(void) +@@ -1340,7 +1366,7 @@ static int process_one_request(void) sshfs.outstanding_len <= sshfs.max_outstanding_len) { pthread_cond_broadcast(&sshfs.outstanding_cond); } @@ -136,7 +136,7 @@ index 5ae54c5..6da5c9f 100644 } pthread_mutex_unlock(&sshfs.lock); if (req != NULL) { -@@ -1400,6 +1426,9 @@ static void close_conn(void) +@@ -1401,6 +1427,9 @@ static void close_conn(void) static void *process_requests(void *data_) { @@ -146,7 +146,7 @@ index 5ae54c5..6da5c9f 100644 (void) data_; while (1) { -@@ -1410,7 +1439,20 @@ static void *process_requests(void *data_) +@@ -1411,7 +1440,20 @@ static void *process_requests(void *data_) pthread_mutex_lock(&sshfs.lock); sshfs.processing_thread_started = 0; close_conn(); @@ -168,7 +168,7 @@ index 5ae54c5..6da5c9f 100644 sshfs.connver ++; sshfs.outstanding_len = 0; pthread_cond_broadcast(&sshfs.outstanding_cond); -@@ -1558,7 +1600,6 @@ static int sftp_error_to_errno(uint32_t error) +@@ -1559,7 +1601,6 @@ static int sftp_error_to_errno(uint32_t error) static void sftp_detect_uid() { int flags; @@ -176,7 +176,7 @@ index 5ae54c5..6da5c9f 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1568,7 +1609,7 @@ static void sftp_detect_uid() +@@ -1569,7 +1610,7 @@ static void sftp_detect_uid() buf_init(&buf, 5); buf_add_string(&buf, "."); buf_to_iov(&buf, &iov[0]); @@ -185,7 +185,7 @@ index 5ae54c5..6da5c9f 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1579,7 +1620,7 @@ static void sftp_detect_uid() +@@ -1580,7 +1621,7 @@ static void sftp_detect_uid() } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -194,7 +194,7 @@ index 5ae54c5..6da5c9f 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1616,7 +1657,6 @@ out: +@@ -1617,7 +1658,6 @@ out: static int sftp_check_root(const char *base_path) { int flags; @@ -202,7 +202,7 @@ index 5ae54c5..6da5c9f 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1628,7 +1668,7 @@ static int sftp_check_root(const char *base_path) +@@ -1629,7 +1669,7 @@ static int sftp_check_root(const char *base_path) buf_init(&buf, 0); buf_add_string(&buf, remote_dir); buf_to_iov(&buf, &iov[0]); @@ -211,7 +211,7 @@ index 5ae54c5..6da5c9f 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1639,7 +1679,7 @@ static int sftp_check_root(const char *base_path) +@@ -1640,7 +1680,7 @@ static int sftp_check_root(const char *base_path) } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -220,7 +220,7 @@ index 5ae54c5..6da5c9f 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1829,7 +1869,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1830,7 +1870,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, struct request **reqp) { int err; @@ -228,7 +228,7 @@ index 5ae54c5..6da5c9f 100644 struct request *req = g_new0(struct request, 1); req->want_reply = want_reply; -@@ -1840,8 +1879,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1841,8 +1880,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, pthread_mutex_lock(&sshfs.lock); if (begin_func) begin_func(req); @@ -237,7 +237,7 @@ index 5ae54c5..6da5c9f 100644 err = start_processing_thread(); if (err) { pthread_mutex_unlock(&sshfs.lock); -@@ -1852,21 +1889,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1853,21 +1890,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, while (sshfs.outstanding_len > sshfs.max_outstanding_len) pthread_cond_wait(&sshfs.outstanding_cond, &sshfs.lock); @@ -266,7 +266,7 @@ index 5ae54c5..6da5c9f 100644 pthread_mutex_unlock(&sshfs.lock); if (!rmed && !want_reply) { -@@ -2039,7 +2079,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) +@@ -2040,7 +2080,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) static int sshfs_req_pending(struct request *req) { @@ -275,7 +275,7 @@ index 5ae54c5..6da5c9f 100644 return 1; else return 0; -@@ -3312,11 +3352,6 @@ static int processing_init(void) +@@ -3313,11 +3353,6 @@ static int processing_init(void) pthread_mutex_init(&sshfs.lock, NULL); pthread_mutex_init(&sshfs.lock_write, NULL); pthread_cond_init(&sshfs.outstanding_cond, NULL); @@ -288,5 +288,5 @@ index 5ae54c5..6da5c9f 100644 } -- -2.18.0 +2.19.2 |
