libfuse: remove deprecated fuse_loop_mt_proc()
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 8 Feb 2013 07:03:01 +0000 (08:03 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Fri, 8 Feb 2013 07:03:01 +0000 (08:03 +0100)
ChangeLog
include/fuse.h
lib/fuse_mt.c
lib/fuse_versionscript

index 97b3f69719ac974b934291b78727fb69a0b78d3f..832ecf77f850779bbdb195d4c0ca813b13a0c419 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
        - fuse_is_lib_option()
        - fuse_invalidate()
        - fuse_set_getcontext_func()
+       - fuse_loop_mt_proc()
 
 2013-02-06  Miklos Szeredi <miklos@szeredi.hu>
 
index af6bfc47f55ad3b8951f1d6787c199d83363e158..07282ab4a4d6b604b5bfe845031b96cc5f993d96 100644 (file)
@@ -960,10 +960,6 @@ struct fuse_cmd *fuse_read_cmd(struct fuse *f);
 /** Process a single command */
 void fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd);
 
-/** Multi threaded event loop, which calls the custom command
-    processor function */
-int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data);
-
 /** Return the exited flag, which indicates if fuse_exit() has been
     called */
 int fuse_exited(struct fuse *f);
index fbfa52aed4f9240c2058ec61d8f1740f59513d66..ee38b28646e7d45264ca818e7022150402b0ab54 100644 (file)
@@ -6,105 +6,9 @@
   See the file COPYING.LIB.
 */
 
-#include "fuse_i.h"
-#include "fuse_misc.h"
+#include "fuse.h"
 #include "fuse_lowlevel.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-#include <assert.h>
-
-struct procdata {
-       struct fuse *f;
-       struct fuse_chan *prevch;
-       struct fuse_session *prevse;
-       fuse_processor_t proc;
-       void *data;
-};
-
-static void mt_session_proc(void *data, const char *buf, size_t len,
-                           struct fuse_chan *ch)
-{
-       struct procdata *pd = (struct procdata *) data;
-       struct fuse_cmd *cmd = *(struct fuse_cmd **) buf;
-
-       (void) len;
-       (void) ch;
-       pd->proc(pd->f, cmd, pd->data);
-}
-
-static void mt_session_exit(void *data, int val)
-{
-       struct procdata *pd = (struct procdata *) data;
-       if (val)
-               fuse_session_exit(pd->prevse);
-       else
-               fuse_session_reset(pd->prevse);
-}
-
-static int mt_session_exited(void *data)
-{
-       struct procdata *pd = (struct procdata *) data;
-       return fuse_session_exited(pd->prevse);
-}
-
-static int mt_chan_receive(struct fuse_chan **chp, char *buf, size_t size)
-{
-       struct fuse_cmd *cmd;
-       struct procdata *pd = (struct procdata *) fuse_chan_data(*chp);
-
-       assert(size >= sizeof(cmd));
-
-       cmd = fuse_read_cmd(pd->f);
-       if (cmd == NULL)
-               return 0;
-
-       *(struct fuse_cmd **) buf = cmd;
-
-       return sizeof(cmd);
-}
-
-int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data)
-{
-       int res;
-       struct procdata pd;
-       struct fuse_session *prevse = fuse_get_session(f);
-       struct fuse_session *se;
-       struct fuse_chan *prevch = fuse_session_next_chan(prevse, NULL);
-       struct fuse_chan *ch;
-       struct fuse_session_ops sop = {
-               .exit = mt_session_exit,
-               .exited = mt_session_exited,
-               .process = mt_session_proc,
-       };
-       struct fuse_chan_ops cop = {
-               .receive = mt_chan_receive,
-       };
-
-       pd.f = f;
-       pd.prevch = prevch;
-       pd.prevse = prevse;
-       pd.proc = proc;
-       pd.data = data;
-
-       se = fuse_session_new(&sop, &pd);
-       if (se == NULL)
-               return -1;
-
-       ch = fuse_chan_new(&cop, fuse_chan_fd(prevch),
-                          sizeof(struct fuse_cmd *), &pd);
-       if (ch == NULL) {
-               fuse_session_destroy(se);
-               return -1;
-       }
-       fuse_session_add_chan(se, ch);
-       res = fuse_session_loop_mt(se);
-       fuse_session_destroy(se);
-       return res;
-}
-
 int fuse_loop_mt(struct fuse *f)
 {
        if (f == NULL)
index bd85aafb69a1f2fb45200c2efe931ac937e357e3..20d84f97dc90860bc543f38ca84526df7c6d6129 100644 (file)
@@ -5,7 +5,6 @@ FUSE_3.0 {
                fuse_exited;
                fuse_loop;
                fuse_loop_mt;
-               fuse_loop_mt_proc;
                fuse_main;
                fuse_process_cmd;
                fuse_read_cmd;