libfuse: clean up fuse_chan
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 21 Jun 2013 11:35:30 +0000 (13:35 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Fri, 21 Jun 2013 11:35:30 +0000 (13:35 +0200)
Clean up fuse_chan related interfaces.  Remove the following from the
lowlevel library API:

struct fuse_chan_ops;
fuse_chan_new();
fuse_chan_session();
fuse_chan_recv();
fuse_chan_send();

include/fuse_lowlevel.h
lib/fuse_i.h
lib/fuse_versionscript

index 539c6e793da671b783e6014b828d49585b3c6d95..4817747c7b16d16a776dafccdabce78041e1825f 100644 (file)
@@ -1616,8 +1616,7 @@ void fuse_session_process_buf(struct fuse_session *se,
 /**
  * Receive a raw request supplied in a generic buffer
  *
- * This is a more generic version of fuse_chan_recv().  The fuse_buf
- * supplied to this function contains a suitably allocated memory
+ * The fuse_buf supplied to this function contains a suitably allocated memory
  * buffer.  This may be overwritten with a file descriptor buffer.
  *
  * @param se the session
@@ -1677,55 +1676,6 @@ int fuse_session_loop_mt(struct fuse_session *se);
  * Channel interface                                          *
  * ----------------------------------------------------------- */
 
-/**
- * Channel operations
- *
- * This is used in channel creation
- */
-struct fuse_chan_ops {
-       /**
-        * Hook for receiving a raw request
-        *
-        * @param ch pointer to the channel
-        * @param buf the buffer to store the request in
-        * @param size the size of the buffer
-        * @return the actual size of the raw request, or -1 on error
-        */
-       int (*receive)(struct fuse_chan **chp, char *buf, size_t size);
-
-       /**
-        * Hook for sending a raw reply
-        *
-        * A return value of -ENOENT means, that the request was
-        * interrupted, and the reply was discarded
-        *
-        * @param ch the channel
-        * @param iov vector of blocks
-        * @param count the number of blocks in vector
-        * @return zero on success, -errno on failure
-        */
-       int (*send)(struct fuse_chan *ch, const struct iovec iov[],
-                   size_t count);
-
-       /**
-        * Destroy the channel
-        *
-        * @param ch the channel
-        */
-       void (*destroy)(struct fuse_chan *ch);
-};
-
-/**
- * Create a new channel
- *
- * @param op channel operations
- * @param fd file descriptor of the channel
- * @param bufsize the minimal receive buffer size
- * @return the new channel object, or NULL on failure
- */
-struct fuse_chan *fuse_chan_new(struct fuse_chan_ops *op, int fd,
-                               size_t bufsize);
-
 /**
  * Query the file descriptor of the channel
  *
@@ -1742,40 +1692,6 @@ int fuse_chan_fd(struct fuse_chan *ch);
  */
 size_t fuse_chan_bufsize(struct fuse_chan *ch);
 
-/**
- * Query the session to which this channel is assigned
- *
- * @param ch the channel
- * @return the session, or NULL if the channel is not assigned
- */
-struct fuse_session *fuse_chan_session(struct fuse_chan *ch);
-
-/**
- * Receive a raw request
- *
- * A return value of -ENODEV means, that the filesystem was unmounted
- *
- * @param ch pointer to the channel
- * @param buf the buffer to store the request in
- * @param size the size of the buffer
- * @return the actual size of the raw request, or -errno on error
- */
-int fuse_chan_recv(struct fuse_chan **ch, char *buf, size_t size);
-
-/**
- * Send a raw reply
- *
- * A return value of -ENOENT means, that the request was
- * interrupted, and the reply was discarded
- *
- * @param ch the channel
- * @param iov vector of blocks
- * @param count the number of blocks in vector
- * @return zero on success, -errno on failure
- */
-int fuse_chan_send(struct fuse_chan *ch, const struct iovec iov[],
-                  size_t count);
-
 /**
  * Destroy a channel
  *
index c205fa8cde051c771b2bfc72b659c1213089c9e7..245e175f088e6279d7998f95a89275c7c8d815d7 100644 (file)
 struct fuse_chan;
 struct fuse_ll;
 
+/**
+ * Channel operations
+ *
+ * This is used in channel creation
+ */
+struct fuse_chan_ops {
+       /**
+        * Hook for receiving a raw request
+        *
+        * @param ch pointer to the channel
+        * @param buf the buffer to store the request in
+        * @param size the size of the buffer
+        * @return the actual size of the raw request, or -1 on error
+        */
+       int (*receive)(struct fuse_chan **chp, char *buf, size_t size);
+
+       /**
+        * Hook for sending a raw reply
+        *
+        * A return value of -ENOENT means, that the request was
+        * interrupted, and the reply was discarded
+        *
+        * @param ch the channel
+        * @param iov vector of blocks
+        * @param count the number of blocks in vector
+        * @return zero on success, -errno on failure
+        */
+       int (*send)(struct fuse_chan *ch, const struct iovec iov[],
+                   size_t count);
+
+       /**
+        * Destroy the channel
+        *
+        * @param ch the channel
+        */
+       void (*destroy)(struct fuse_chan *ch);
+};
+
 struct fuse_session {
        int (*receive_buf)(struct fuse_session *se, struct fuse_buf *buf,
                           struct fuse_chan **chp);
@@ -111,6 +149,50 @@ struct fuse_session *fuse_session_new(void *data);
  */
 void *fuse_session_data(struct fuse_session *se);
 
+/**
+ * Create a new channel
+ *
+ * @param op channel operations
+ * @param fd file descriptor of the channel
+ * @param bufsize the minimal receive buffer size
+ * @return the new channel object, or NULL on failure
+ */
+struct fuse_chan *fuse_chan_new(struct fuse_chan_ops *op, int fd,
+                               size_t bufsize);
+
+/**
+ * Query the session to which this channel is assigned
+ *
+ * @param ch the channel
+ * @return the session, or NULL if the channel is not assigned
+ */
+struct fuse_session *fuse_chan_session(struct fuse_chan *ch);
+
+/**
+ * Send a raw reply
+ *
+ * A return value of -ENOENT means, that the request was
+ * interrupted, and the reply was discarded
+ *
+ * @param ch the channel
+ * @param iov vector of blocks
+ * @param count the number of blocks in vector
+ * @return zero on success, -errno on failure
+ */
+int fuse_chan_send(struct fuse_chan *ch, const struct iovec iov[],
+                  size_t count);
+
+/**
+ * Receive a raw request
+ *
+ * A return value of -ENODEV means, that the filesystem was unmounted
+ *
+ * @param ch pointer to the channel
+ * @param buf the buffer to store the request in
+ * @param size the size of the buffer
+ * @return the actual size of the raw request, or -errno on error
+ */
+int fuse_chan_recv(struct fuse_chan **ch, char *buf, size_t size);
 
 void fuse_kern_unmount(const char *mountpoint, int fd);
 int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
index 8bd2c925dae2c883d7197c192a26639b704323e5..39be9f44cc8909f409ea9851a8a4f3c555923153 100644 (file)
@@ -7,8 +7,6 @@ FUSE_3.0 {
                fuse_chan_bufsize;
                fuse_chan_destroy;
                fuse_chan_fd;
-               fuse_chan_send;
-               fuse_chan_session;
                fuse_reply_attr;
                fuse_reply_buf;
                fuse_reply_entry;
@@ -39,8 +37,6 @@ FUSE_3.0 {
                fuse_set_signal_handlers;
                fuse_add_direntry;
                fuse_add_direntry_plus;
-               fuse_chan_new;
-               fuse_chan_recv;
                fuse_daemonize;
                fuse_get_session;
                fuse_interrupted;