From 88db3e94ef35aac933334694fa3065da68266d91 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 8 Feb 2013 08:03:02 +0100 Subject: [PATCH] libfuse: remove deprecated fuse_read_cmd(), fuse_process_cmd() --- ChangeLog | 2 ++ include/fuse.h | 9 -------- lib/fuse.c | 47 ------------------------------------------ lib/fuse_versionscript | 2 -- 4 files changed, 2 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index 832ecf7..434d100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ - fuse_invalidate() - fuse_set_getcontext_func() - fuse_loop_mt_proc() + - fuse_read_cmd() + - fuse_process_cmd() 2013-02-06 Miklos Szeredi diff --git a/include/fuse.h b/include/fuse.h index 07282ab..361befa 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -942,9 +942,6 @@ void fuse_register_module(struct fuse_module *mod); /* NOTE: the following functions are deprecated, and will be removed from the 3.0 API. Use the lowlevel session functions instead */ -/** Function type used to process commands */ -typedef void (*fuse_processor_t)(struct fuse *, struct fuse_cmd *, void *); - /** This is the part of fuse_main() before the event loop */ struct fuse *fuse_setup(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, @@ -954,12 +951,6 @@ struct fuse *fuse_setup(int argc, char *argv[], /** This is the part of fuse_main() after the event loop */ void fuse_teardown(struct fuse *fuse, char *mountpoint); -/** Read a single command. If none are read, return NULL */ -struct fuse_cmd *fuse_read_cmd(struct fuse *f); - -/** Process a single command */ -void fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd); - /** Return the exited flag, which indicates if fuse_exit() has been called */ int fuse_exited(struct fuse *f); diff --git a/lib/fuse.c b/lib/fuse.c index c686516..be06fba 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -4048,18 +4048,6 @@ int fuse_notify_poll(struct fuse_pollhandle *ph) return fuse_lowlevel_notify_poll(ph); } -static void free_cmd(struct fuse_cmd *cmd) -{ - free(cmd->buf); - free(cmd); -} - -void fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd) -{ - fuse_session_process(f->se, cmd->buf, cmd->buflen, cmd->ch); - free_cmd(cmd); -} - int fuse_exited(struct fuse *f) { return fuse_session_exited(f->se); @@ -4070,41 +4058,6 @@ struct fuse_session *fuse_get_session(struct fuse *f) return f->se; } -static struct fuse_cmd *fuse_alloc_cmd(size_t bufsize) -{ - struct fuse_cmd *cmd = (struct fuse_cmd *) malloc(sizeof(*cmd)); - if (cmd == NULL) { - fprintf(stderr, "fuse: failed to allocate cmd\n"); - return NULL; - } - cmd->buf = (char *) malloc(bufsize); - if (cmd->buf == NULL) { - fprintf(stderr, "fuse: failed to allocate read buffer\n"); - free(cmd); - return NULL; - } - return cmd; -} - -struct fuse_cmd *fuse_read_cmd(struct fuse *f) -{ - struct fuse_chan *ch = fuse_session_next_chan(f->se, NULL); - size_t bufsize = fuse_chan_bufsize(ch); - struct fuse_cmd *cmd = fuse_alloc_cmd(bufsize); - if (cmd != NULL) { - int res = fuse_chan_recv(&ch, cmd->buf, bufsize); - if (res <= 0) { - free_cmd(cmd); - if (res < 0 && res != -EINTR && res != -EAGAIN) - fuse_exit(f); - return NULL; - } - cmd->buflen = res; - cmd->ch = ch; - } - return cmd; -} - static int fuse_session_loop_remember(struct fuse *f) { struct fuse_session *se = f->se; diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index 20d84f9..6e72dd6 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -6,8 +6,6 @@ FUSE_3.0 { fuse_loop; fuse_loop_mt; fuse_main; - fuse_process_cmd; - fuse_read_cmd; fuse_chan_bufsize; fuse_chan_data; fuse_chan_destroy; -- 2.30.2