summaryrefslogtreecommitdiff
path: root/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
diff options
context:
space:
mode:
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.patch44
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 32db649c..871cf1c4 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 322be2bcf22ab3a3c39b083d8b8f92631952517f Mon Sep 17 00:00:00 2001
+From 2948f0391fa23c4ec962b22e1814eced97bbea8a 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 58b5c31..1bd0af6 100644
+index 5ae54c5..6da5c9f 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -171,6 +171,17 @@ struct request {
@@ -29,7 +29,7 @@ index 58b5c31..1bd0af6 100644
struct sshfs_io {
int num_reqs;
pthread_cond_t finished;
-@@ -250,7 +261,7 @@ struct sshfs {
+@@ -251,7 +262,7 @@ struct sshfs {
int slave;
char *host;
char *base_path;
@@ -38,7 +38,7 @@ index 58b5c31..1bd0af6 100644
pthread_mutex_t lock;
pthread_mutex_t lock_write;
int processing_thread_started;
-@@ -1165,12 +1176,6 @@ static int do_write(struct iovec *iov, size_t count)
+@@ -1168,12 +1179,6 @@ static int do_write(struct iovec *iov, size_t count)
return 0;
}
@@ -51,7 +51,7 @@ index 58b5c31..1bd0af6 100644
static void buf_to_iov(const struct buffer *buf, struct iovec *iov)
{
iov->iov_base = buf->p;
-@@ -1263,6 +1268,43 @@ static void request_free(struct request *req)
+@@ -1266,6 +1271,43 @@ static void request_free(struct request *req)
g_free(req);
}
@@ -95,7 +95,7 @@ index 58b5c31..1bd0af6 100644
static void chunk_free(struct read_chunk *chunk)
{
while (!list_empty(&chunk->reqs)) {
-@@ -1292,21 +1334,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
+@@ -1295,21 +1337,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
pthread_mutex_unlock(&sshfs.lock);
}
@@ -117,7 +117,7 @@ index 58b5c31..1bd0af6 100644
static int process_one_request(void)
{
int res;
-@@ -1323,8 +1350,7 @@ static int process_one_request(void)
+@@ -1326,8 +1353,7 @@ static int process_one_request(void)
return -1;
pthread_mutex_lock(&sshfs.lock);
@@ -127,7 +127,7 @@ index 58b5c31..1bd0af6 100644
if (req == NULL)
fprintf(stderr, "request %i not found\n", id);
else {
-@@ -1336,7 +1362,7 @@ static int process_one_request(void)
+@@ -1339,7 +1365,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 58b5c31..1bd0af6 100644
}
pthread_mutex_unlock(&sshfs.lock);
if (req != NULL) {
-@@ -1397,6 +1423,9 @@ static void close_conn(void)
+@@ -1400,6 +1426,9 @@ static void close_conn(void)
static void *process_requests(void *data_)
{
@@ -146,7 +146,7 @@ index 58b5c31..1bd0af6 100644
(void) data_;
while (1) {
-@@ -1407,7 +1436,20 @@ static void *process_requests(void *data_)
+@@ -1410,7 +1439,20 @@ static void *process_requests(void *data_)
pthread_mutex_lock(&sshfs.lock);
sshfs.processing_thread_started = 0;
close_conn();
@@ -168,7 +168,7 @@ index 58b5c31..1bd0af6 100644
sshfs.connver ++;
sshfs.outstanding_len = 0;
pthread_cond_broadcast(&sshfs.outstanding_cond);
-@@ -1555,7 +1597,6 @@ static int sftp_error_to_errno(uint32_t error)
+@@ -1558,7 +1600,6 @@ static int sftp_error_to_errno(uint32_t error)
static void sftp_detect_uid()
{
int flags;
@@ -176,7 +176,7 @@ index 58b5c31..1bd0af6 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1565,7 +1606,7 @@ static void sftp_detect_uid()
+@@ -1568,7 +1609,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 58b5c31..1bd0af6 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1576,7 +1617,7 @@ static void sftp_detect_uid()
+@@ -1579,7 +1620,7 @@ static void sftp_detect_uid()
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -194,7 +194,7 @@ index 58b5c31..1bd0af6 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1613,7 +1654,6 @@ out:
+@@ -1616,7 +1657,6 @@ out:
static int sftp_check_root(const char *base_path)
{
int flags;
@@ -202,7 +202,7 @@ index 58b5c31..1bd0af6 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1625,7 +1665,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1628,7 +1668,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 58b5c31..1bd0af6 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1636,7 +1676,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1639,7 +1679,7 @@ static int sftp_check_root(const char *base_path)
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -220,7 +220,7 @@ index 58b5c31..1bd0af6 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1826,7 +1866,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1829,7 +1869,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 58b5c31..1bd0af6 100644
struct request *req = g_new0(struct request, 1);
req->want_reply = want_reply;
-@@ -1837,8 +1876,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1840,8 +1879,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 58b5c31..1bd0af6 100644
err = start_processing_thread();
if (err) {
pthread_mutex_unlock(&sshfs.lock);
-@@ -1849,21 +1886,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1852,21 +1889,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 58b5c31..1bd0af6 100644
pthread_mutex_unlock(&sshfs.lock);
if (!rmed && !want_reply) {
-@@ -2036,7 +2076,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle)
+@@ -2039,7 +2079,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 58b5c31..1bd0af6 100644
return 1;
else
return 0;
-@@ -3298,11 +3338,6 @@ static int processing_init(void)
+@@ -3312,11 +3352,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 58b5c31..1bd0af6 100644
}
--
-2.17.0
+2.18.0