diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-02 09:38:06 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-02 10:46:49 -0700 |
commit | 65c9df72e33c134ebcac03b1ef6c1c98ae3e887c (patch) | |
tree | e4d61a0509757e624e70491064e562333d806187 | |
parent | 63fcf7a1434e6210a010010242fab0a17e75afee (diff) |
Turned fuse_session_{process,receive}_buf into wrapper functions.
-rw-r--r-- | lib/fuse.c | 4 | ||||
-rw-r--r-- | lib/fuse_i.h | 5 | ||||
-rw-r--r-- | lib/fuse_loop.c | 5 | ||||
-rwxr-xr-x | lib/fuse_loop_mt.c | 4 | ||||
-rwxr-xr-x | lib/fuse_lowlevel.c | 15 |
5 files changed, 26 insertions, 7 deletions
@@ -4345,14 +4345,14 @@ static int fuse_session_loop_remember(struct fuse *f) else break; } else if (res > 0) { - res = fuse_session_receive_buf(se, &fbuf, ch); + res = fuse_session_receive_buf_int(se, &fbuf, ch); if (res == -EINTR) continue; if (res <= 0) break; - fuse_session_process_buf(se, &fbuf, ch); + fuse_session_process_buf_int(se, &fbuf, ch); } else { timeout = fuse_clean_cache(f); curr_time(&now); diff --git a/lib/fuse_i.h b/lib/fuse_i.h index 6738197..dca588a 100644 --- a/lib/fuse_i.h +++ b/lib/fuse_i.h @@ -143,3 +143,8 @@ void fuse_free_req(fuse_req_t req); void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg); int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg); + +int fuse_session_receive_buf_int(struct fuse_session *se, struct fuse_buf *buf, + struct fuse_chan *ch); +void fuse_session_process_buf_int(struct fuse_session *se, + const struct fuse_buf *buf, struct fuse_chan *ch); diff --git a/lib/fuse_loop.c b/lib/fuse_loop.c index fb6d8a6..6df4a62 100644 --- a/lib/fuse_loop.c +++ b/lib/fuse_loop.c @@ -8,6 +8,7 @@ #include "config.h" #include "fuse_lowlevel.h" +#include "fuse_i.h" #include <stdio.h> #include <stdlib.h> @@ -22,14 +23,14 @@ int fuse_session_loop(struct fuse_session *se) }; while (!fuse_session_exited(se)) { - res = fuse_session_receive_buf(se, &fbuf, ch); + res = fuse_session_receive_buf_int(se, &fbuf, ch); if (res == -EINTR) continue; if (res <= 0) break; - fuse_session_process_buf(se, &fbuf, ch); + fuse_session_process_buf_int(se, &fbuf, ch); } free(fbuf.mem); diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 036f75c..f482962 100755 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -76,7 +76,7 @@ static void *fuse_do_work(void *data) int res; pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - res = fuse_session_receive_buf(mt->se, &w->fbuf, w->ch); + res = fuse_session_receive_buf_int(mt->se, &w->fbuf, w->ch); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); if (res == -EINTR) continue; @@ -112,7 +112,7 @@ static void *fuse_do_work(void *data) fuse_loop_start_thread(mt); pthread_mutex_unlock(&mt->lock); - fuse_session_process_buf(mt->se, &w->fbuf, w->ch); + fuse_session_process_buf_int(mt->se, &w->fbuf, w->ch); pthread_mutex_lock(&mt->lock); if (!isforget) diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index b425856..8b08f3a 100755 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2437,7 +2437,14 @@ static int fuse_ll_copy_from_pipe(struct fuse_bufvec *dst, } void fuse_session_process_buf(struct fuse_session *se, - const struct fuse_buf *buf, struct fuse_chan *ch) + const struct fuse_buf *buf, + struct fuse_chan *ch) +{ + fuse_session_process_buf_int(se, buf, ch); +} + +void fuse_session_process_buf_int(struct fuse_session *se, + const struct fuse_buf *buf, struct fuse_chan *ch) { struct fuse_ll *f = se->f; const size_t write_header_size = sizeof(struct fuse_in_header) + @@ -2712,6 +2719,12 @@ static void fuse_ll_pipe_destructor(void *data) int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf, struct fuse_chan *ch) { + return fuse_session_receive_buf_int(se, buf, ch); +} + +int fuse_session_receive_buf_int(struct fuse_session *se, struct fuse_buf *buf, + struct fuse_chan *ch) +{ struct fuse_ll *f = se->f; int err; ssize_t res; |