summaryrefslogtreecommitdiff
path: root/pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2018-05-10 12:30:19 -0700
committerMichael Forney <mforney@mforney.org>2018-05-10 13:00:22 -0700
commit59cc7cd24d6884bd5daff3efcdb39ea074319344 (patch)
tree6c257826964b5e55ce8ac1d56c3257e9b25bfde1 /pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
parent5a4f3899c1c06147c94b8f81de2883244c411873 (diff)
sshfs: Update to 3.3.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.patch46
1 files changed, 23 insertions, 23 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 b252cce1..32db649c 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,14 +1,14 @@
-From 7a1afc816dbc1f7218feaae2ffd97d4a0f0343f9 Mon Sep 17 00:00:00 2001
+From 322be2bcf22ab3a3c39b083d8b8f92631952517f 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
---
- sshfs.c | 125 +++++++++++++++++++++++++++++++++++++++++-----------------------
+ sshfs.c | 125 ++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 80 insertions(+), 45 deletions(-)
diff --git a/sshfs.c b/sshfs.c
-index 7fe9c6e..cb2f554 100644
+index 58b5c31..1bd0af6 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -171,6 +171,17 @@ struct request {
@@ -29,7 +29,7 @@ index 7fe9c6e..cb2f554 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 7fe9c6e..cb2f554 100644
pthread_mutex_t lock;
pthread_mutex_t lock_write;
int processing_thread_started;
-@@ -1162,12 +1173,6 @@ static int do_write(struct iovec *iov, size_t count)
+@@ -1165,12 +1176,6 @@ static int do_write(struct iovec *iov, size_t count)
return 0;
}
@@ -51,7 +51,7 @@ index 7fe9c6e..cb2f554 100644
static void buf_to_iov(const struct buffer *buf, struct iovec *iov)
{
iov->iov_base = buf->p;
-@@ -1260,6 +1265,43 @@ static void request_free(struct request *req)
+@@ -1263,6 +1268,43 @@ static void request_free(struct request *req)
g_free(req);
}
@@ -95,7 +95,7 @@ index 7fe9c6e..cb2f554 100644
static void chunk_free(struct read_chunk *chunk)
{
while (!list_empty(&chunk->reqs)) {
-@@ -1289,21 +1331,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
+@@ -1292,21 +1334,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
pthread_mutex_unlock(&sshfs.lock);
}
@@ -117,7 +117,7 @@ index 7fe9c6e..cb2f554 100644
static int process_one_request(void)
{
int res;
-@@ -1320,8 +1347,7 @@ static int process_one_request(void)
+@@ -1323,8 +1350,7 @@ static int process_one_request(void)
return -1;
pthread_mutex_lock(&sshfs.lock);
@@ -127,7 +127,7 @@ index 7fe9c6e..cb2f554 100644
if (req == NULL)
fprintf(stderr, "request %i not found\n", id);
else {
-@@ -1333,7 +1359,7 @@ static int process_one_request(void)
+@@ -1336,7 +1362,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 7fe9c6e..cb2f554 100644
}
pthread_mutex_unlock(&sshfs.lock);
if (req != NULL) {
-@@ -1394,6 +1420,9 @@ static void close_conn(void)
+@@ -1397,6 +1423,9 @@ static void close_conn(void)
static void *process_requests(void *data_)
{
@@ -146,7 +146,7 @@ index 7fe9c6e..cb2f554 100644
(void) data_;
while (1) {
-@@ -1404,7 +1433,20 @@ static void *process_requests(void *data_)
+@@ -1407,7 +1436,20 @@ static void *process_requests(void *data_)
pthread_mutex_lock(&sshfs.lock);
sshfs.processing_thread_started = 0;
close_conn();
@@ -168,7 +168,7 @@ index 7fe9c6e..cb2f554 100644
sshfs.connver ++;
sshfs.outstanding_len = 0;
pthread_cond_broadcast(&sshfs.outstanding_cond);
-@@ -1552,7 +1594,6 @@ static int sftp_error_to_errno(uint32_t error)
+@@ -1555,7 +1597,6 @@ static int sftp_error_to_errno(uint32_t error)
static void sftp_detect_uid()
{
int flags;
@@ -176,7 +176,7 @@ index 7fe9c6e..cb2f554 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1562,7 +1603,7 @@ static void sftp_detect_uid()
+@@ -1565,7 +1606,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 7fe9c6e..cb2f554 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1573,7 +1614,7 @@ static void sftp_detect_uid()
+@@ -1576,7 +1617,7 @@ static void sftp_detect_uid()
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -194,7 +194,7 @@ index 7fe9c6e..cb2f554 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1610,7 +1651,6 @@ out:
+@@ -1613,7 +1654,6 @@ out:
static int sftp_check_root(const char *base_path)
{
int flags;
@@ -202,7 +202,7 @@ index 7fe9c6e..cb2f554 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1622,7 +1662,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1625,7 +1665,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 7fe9c6e..cb2f554 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1633,7 +1673,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1636,7 +1676,7 @@ static int sftp_check_root(const char *base_path)
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -220,7 +220,7 @@ index 7fe9c6e..cb2f554 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1823,7 +1863,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1826,7 +1866,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 7fe9c6e..cb2f554 100644
struct request *req = g_new0(struct request, 1);
req->want_reply = want_reply;
-@@ -1834,8 +1873,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1837,8 +1876,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 7fe9c6e..cb2f554 100644
err = start_processing_thread();
if (err) {
pthread_mutex_unlock(&sshfs.lock);
-@@ -1846,21 +1883,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1849,21 +1886,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 7fe9c6e..cb2f554 100644
pthread_mutex_unlock(&sshfs.lock);
if (!rmed && !want_reply) {
-@@ -2033,7 +2073,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle)
+@@ -2036,7 +2076,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 7fe9c6e..cb2f554 100644
return 1;
else
return 0;
-@@ -3293,11 +3333,6 @@ static int processing_init(void)
+@@ -3298,11 +3338,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 7fe9c6e..cb2f554 100644
}
--
-2.14.3
+2.17.0