diff options
| author | Michael Forney <mforney@mforney.org> | 2017-08-10 20:13:38 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-08-10 20:13:38 -0700 |
| commit | 15876a42c27ab666d36e2f73cd116a3b26199729 (patch) | |
| tree | f83a5e1481517e359e7ab466034ed0392c3062ac /pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch | |
| parent | 8bb86237036b5dabaebd7c7039131bc0022b6481 (diff) | |
sshfs: Update to 3.2.0
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 | 44 |
1 files changed, 22 insertions, 22 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 95071dbc..7fbd71ce 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 7b709a968b3505ac0e55a0fdea8c54791ed718d6 Mon Sep 17 00:00:00 2001 +From bc0f086e2d95b79c6061ea8894c57a5b5350bd4d 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 3c4f242..c5ed603 100644 +index a76ae8a..7078618 100644 --- a/sshfs.c +++ b/sshfs.c @@ -171,6 +171,17 @@ struct request { @@ -29,7 +29,7 @@ index 3c4f242..c5ed603 100644 struct sshfs_io { int num_reqs; pthread_cond_t finished; -@@ -249,7 +260,7 @@ struct sshfs { +@@ -250,7 +261,7 @@ struct sshfs { int slave; char *host; char *base_path; @@ -38,7 +38,7 @@ index 3c4f242..c5ed603 100644 pthread_mutex_t lock; pthread_mutex_t lock_write; int processing_thread_started; -@@ -1154,12 +1165,6 @@ static int do_write(struct iovec *iov, size_t count) +@@ -1156,12 +1167,6 @@ static int do_write(struct iovec *iov, size_t count) return 0; } @@ -51,7 +51,7 @@ index 3c4f242..c5ed603 100644 static void buf_to_iov(const struct buffer *buf, struct iovec *iov) { iov->iov_base = buf->p; -@@ -1252,6 +1257,43 @@ static void request_free(struct request *req) +@@ -1254,6 +1259,43 @@ static void request_free(struct request *req) g_free(req); } @@ -95,7 +95,7 @@ index 3c4f242..c5ed603 100644 static void chunk_free(struct read_chunk *chunk) { while (!list_empty(&chunk->reqs)) { -@@ -1281,21 +1323,6 @@ static void chunk_put_locked(struct read_chunk *chunk) +@@ -1283,21 +1325,6 @@ static void chunk_put_locked(struct read_chunk *chunk) pthread_mutex_unlock(&sshfs.lock); } @@ -117,7 +117,7 @@ index 3c4f242..c5ed603 100644 static int process_one_request(void) { int res; -@@ -1312,8 +1339,7 @@ static int process_one_request(void) +@@ -1314,8 +1341,7 @@ static int process_one_request(void) return -1; pthread_mutex_lock(&sshfs.lock); @@ -127,7 +127,7 @@ index 3c4f242..c5ed603 100644 if (req == NULL) fprintf(stderr, "request %i not found\n", id); else { -@@ -1325,7 +1351,7 @@ static int process_one_request(void) +@@ -1327,7 +1353,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 3c4f242..c5ed603 100644 } pthread_mutex_unlock(&sshfs.lock); if (req != NULL) { -@@ -1386,6 +1412,9 @@ static void close_conn(void) +@@ -1388,6 +1414,9 @@ static void close_conn(void) static void *process_requests(void *data_) { @@ -146,7 +146,7 @@ index 3c4f242..c5ed603 100644 (void) data_; while (1) { -@@ -1396,7 +1425,20 @@ static void *process_requests(void *data_) +@@ -1398,7 +1427,20 @@ static void *process_requests(void *data_) pthread_mutex_lock(&sshfs.lock); sshfs.processing_thread_started = 0; close_conn(); @@ -168,7 +168,7 @@ index 3c4f242..c5ed603 100644 sshfs.connver ++; sshfs.outstanding_len = 0; pthread_cond_broadcast(&sshfs.outstanding_cond); -@@ -1544,7 +1586,6 @@ static int sftp_error_to_errno(uint32_t error) +@@ -1546,7 +1588,6 @@ static int sftp_error_to_errno(uint32_t error) static void sftp_detect_uid() { int flags; @@ -176,7 +176,7 @@ index 3c4f242..c5ed603 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1554,7 +1595,7 @@ static void sftp_detect_uid() +@@ -1556,7 +1597,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 3c4f242..c5ed603 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1565,7 +1606,7 @@ static void sftp_detect_uid() +@@ -1567,7 +1608,7 @@ static void sftp_detect_uid() } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -194,7 +194,7 @@ index 3c4f242..c5ed603 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1602,7 +1643,6 @@ out: +@@ -1604,7 +1645,6 @@ out: static int sftp_check_root(const char *base_path) { int flags; @@ -202,7 +202,7 @@ index 3c4f242..c5ed603 100644 uint32_t replid; uint8_t type; struct buffer buf; -@@ -1614,7 +1654,7 @@ static int sftp_check_root(const char *base_path) +@@ -1616,7 +1656,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 3c4f242..c5ed603 100644 goto out; buf_clear(&buf); if (sftp_read(&type, &buf) == -1) -@@ -1625,7 +1665,7 @@ static int sftp_check_root(const char *base_path) +@@ -1627,7 +1667,7 @@ static int sftp_check_root(const char *base_path) } if (buf_get_uint32(&buf, &replid) == -1) goto out; @@ -220,7 +220,7 @@ index 3c4f242..c5ed603 100644 fprintf(stderr, "bad reply ID\n"); goto out; } -@@ -1819,7 +1859,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1821,7 +1861,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 3c4f242..c5ed603 100644 struct request *req = g_new0(struct request, 1); req->want_reply = want_reply; -@@ -1830,8 +1869,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1832,8 +1871,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 3c4f242..c5ed603 100644 err = start_processing_thread(); if (err) { pthread_mutex_unlock(&sshfs.lock); -@@ -1842,21 +1879,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count, +@@ -1844,21 +1881,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 3c4f242..c5ed603 100644 pthread_mutex_unlock(&sshfs.lock); if (!rmed && !want_reply) { -@@ -2029,7 +2069,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle) +@@ -2031,7 +2071,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 3c4f242..c5ed603 100644 return 1; else return 0; -@@ -3285,11 +3325,6 @@ static int processing_init(void) +@@ -3308,11 +3348,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 3c4f242..c5ed603 100644 } -- -2.14.0 +2.14.1 |
