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>2017-07-09 02:49:39 -0700
committerMichael Forney <mforney@mforney.org>2017-07-10 10:34:19 -0700
commita6ca58071917538c6efd6c3df86d5d347be681fc (patch)
tree26bc5c189ef20d0a739fe897fac39d51a61faf79 /pkg/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
parent6b71e5c2419c75c14223196e1fe65cbf8f4ba026 (diff)
libfuse, sshfs: Update to 3.1.0, 3.0.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.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 007991ec..90f24465 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 00c4f3a1d34c8fed239e42e5ee66bbd4e678bb7e Mon Sep 17 00:00:00 2001
+From 6ff3918c325fb7cef56c081cbaa7538435bb2f7a 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,10 +8,10 @@ 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 8cde971..14a302d 100644
+index a20f727..5adb290 100644
--- a/sshfs.c
+++ b/sshfs.c
-@@ -173,6 +173,17 @@ struct request {
+@@ -171,6 +171,17 @@ struct request {
struct list_head list;
};
@@ -29,7 +29,7 @@ index 8cde971..14a302d 100644
struct sshfs_io {
int num_reqs;
pthread_cond_t finished;
-@@ -247,7 +258,7 @@ struct sshfs {
+@@ -249,7 +260,7 @@ struct sshfs {
int slave;
char *host;
char *base_path;
@@ -38,7 +38,7 @@ index 8cde971..14a302d 100644
pthread_mutex_t lock;
pthread_mutex_t lock_write;
int processing_thread_started;
-@@ -1243,12 +1254,6 @@ static int do_write(struct iovec *iov, size_t count)
+@@ -1149,12 +1160,6 @@ static int do_write(struct iovec *iov, size_t count)
return 0;
}
@@ -51,7 +51,7 @@ index 8cde971..14a302d 100644
static void buf_to_iov(const struct buffer *buf, struct iovec *iov)
{
iov->iov_base = buf->p;
-@@ -1341,6 +1346,43 @@ static void request_free(struct request *req)
+@@ -1247,6 +1252,43 @@ static void request_free(struct request *req)
g_free(req);
}
@@ -95,7 +95,7 @@ index 8cde971..14a302d 100644
static void chunk_free(struct read_chunk *chunk)
{
while (!list_empty(&chunk->reqs)) {
-@@ -1370,21 +1412,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
+@@ -1276,21 +1318,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
pthread_mutex_unlock(&sshfs.lock);
}
@@ -117,7 +117,7 @@ index 8cde971..14a302d 100644
static int process_one_request(void)
{
int res;
-@@ -1401,8 +1428,7 @@ static int process_one_request(void)
+@@ -1307,8 +1334,7 @@ static int process_one_request(void)
return -1;
pthread_mutex_lock(&sshfs.lock);
@@ -127,7 +127,7 @@ index 8cde971..14a302d 100644
if (req == NULL)
fprintf(stderr, "request %i not found\n", id);
else {
-@@ -1414,7 +1440,7 @@ static int process_one_request(void)
+@@ -1320,7 +1346,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 8cde971..14a302d 100644
}
pthread_mutex_unlock(&sshfs.lock);
if (req != NULL) {
-@@ -1475,6 +1501,9 @@ static void close_conn(void)
+@@ -1381,6 +1407,9 @@ static void close_conn(void)
static void *process_requests(void *data_)
{
@@ -146,7 +146,7 @@ index 8cde971..14a302d 100644
(void) data_;
while (1) {
-@@ -1485,7 +1514,20 @@ static void *process_requests(void *data_)
+@@ -1391,7 +1420,20 @@ static void *process_requests(void *data_)
pthread_mutex_lock(&sshfs.lock);
sshfs.processing_thread_started = 0;
close_conn();
@@ -168,7 +168,7 @@ index 8cde971..14a302d 100644
sshfs.connver ++;
sshfs.outstanding_len = 0;
pthread_cond_broadcast(&sshfs.outstanding_cond);
-@@ -1633,7 +1675,6 @@ static int sftp_error_to_errno(uint32_t error)
+@@ -1539,7 +1581,6 @@ static int sftp_error_to_errno(uint32_t error)
static void sftp_detect_uid()
{
int flags;
@@ -176,7 +176,7 @@ index 8cde971..14a302d 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1643,7 +1684,7 @@ static void sftp_detect_uid()
+@@ -1549,7 +1590,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 8cde971..14a302d 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1654,7 +1695,7 @@ static void sftp_detect_uid()
+@@ -1560,7 +1601,7 @@ static void sftp_detect_uid()
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -194,7 +194,7 @@ index 8cde971..14a302d 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1691,7 +1732,6 @@ out:
+@@ -1597,7 +1638,6 @@ out:
static int sftp_check_root(const char *base_path)
{
int flags;
@@ -202,7 +202,7 @@ index 8cde971..14a302d 100644
uint32_t replid;
uint8_t type;
struct buffer buf;
-@@ -1703,7 +1743,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1609,7 +1649,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 8cde971..14a302d 100644
goto out;
buf_clear(&buf);
if (sftp_read(&type, &buf) == -1)
-@@ -1714,7 +1754,7 @@ static int sftp_check_root(const char *base_path)
+@@ -1620,7 +1660,7 @@ static int sftp_check_root(const char *base_path)
}
if (buf_get_uint32(&buf, &replid) == -1)
goto out;
@@ -220,7 +220,7 @@ index 8cde971..14a302d 100644
fprintf(stderr, "bad reply ID\n");
goto out;
}
-@@ -1905,7 +1945,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1819,7 +1859,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 8cde971..14a302d 100644
struct request *req = g_new0(struct request, 1);
req->want_reply = want_reply;
-@@ -1916,8 +1955,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1830,8 +1869,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 8cde971..14a302d 100644
err = start_processing_thread();
if (err) {
pthread_mutex_unlock(&sshfs.lock);
-@@ -1928,21 +1965,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
+@@ -1842,21 +1879,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 8cde971..14a302d 100644
pthread_mutex_unlock(&sshfs.lock);
if (!rmed && !want_reply) {
-@@ -2132,7 +2172,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle)
+@@ -2029,7 +2069,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 8cde971..14a302d 100644
return 1;
else
return 0;
-@@ -3338,11 +3378,6 @@ static int processing_init(void)
+@@ -3277,11 +3317,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 8cde971..14a302d 100644
}
--
-2.13.1
+2.13.2