doc
authorMiklos Szeredi <miklos@szeredi.hu>
Sat, 28 Apr 2007 17:38:17 +0000 (17:38 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Sat, 28 Apr 2007 17:38:17 +0000 (17:38 +0000)
NEWS
include/fuse.h
lib/fuse.c
lib/modules/iconv.c
lib/modules/subdir.c

diff --git a/NEWS b/NEWS
index 794e840b13109d8147093f0905c75de064dd7616..b8354921bbe7a61d28c0021d2a6ccde708026356 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ What is new in 2.7
 
  - Stacking support for the high level API
 
- - Fix problems with mtab writing
+ - Improved mounting
 
 What is new in 2.6
 
index d38ad361c5ed4f67260a6a85dcdfb34cc70d7428..614293341ab758009787f71d9ead1557bbb258ab 100644 (file)
@@ -463,7 +463,7 @@ struct fuse_context {
  * @param argc the argument counter passed to the main() function
  * @param argv the argument vector passed to the main() function
  * @param op the file system operation
- * @param user_data user data set in context for init() method
+ * @param user_data user data supplied in the context during the init() method
  * @return 0 on success, nonzero on failure
  */
 /*
@@ -482,9 +482,9 @@ int fuse_main(int argc, char *argv[], const struct fuse_operations *op,
  *
  * @param ch the communication channel
  * @param args argument vector
- * @param op the operations
+ * @param op the filesystem operations
  * @param op_size the size of the fuse_operations structure
- * @param user_data user data set in context for init() method
+ * @param user_data user data supplied in the context during the init() method
  * @return the created FUSE handle
  */
 struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
@@ -573,10 +573,25 @@ int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
                    size_t op_size, void *user_data);
 
 /*
- *
+ * Stacking API
  */
 
+/**
+ * Fuse filesystem object
+ *
+ * This is opaque object represents a filesystem layer
+ */
 struct fuse_fs;
+
+/*
+ * These functions call the relevant filesystem operation, and return
+ * the result.
+ *
+ * If the operation is not defined, they return -ENOSYS, with the
+ * exception of fuse_fs_open, fuse_fs_release, fuse_fs_opendir,
+ * fuse_fs_releasedir and fuse_fs_statfs, which return 0.
+ */
+
 int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf);
 int fuse_fs_fgetattr(struct fuse_fs *fs, const char *path, struct stat *buf,
                      struct fuse_file_info *fi);
@@ -639,18 +654,71 @@ int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
 void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
 void fuse_fs_destroy(struct fuse_fs *fs);
 
+/**
+ * Create a new fuse filesystem object
+ *
+ * This is usually called from the factory of a fuse module to create
+ * a new instance of a filesystem.
+ *
+ * @param op the filesystem operations
+ * @param op_size the size of the fuse_operations structure
+ * @param user_data user data supplied in the context during the init() method
+ * @return a new filesystem object
+ */
 struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
                             void *user_data);
 
+/**
+ * Filesystem module
+ *
+ * Filesystem modules are registered with the FUSE_REGISTER_MODULE()
+ * macro.
+ *
+ * If the "-omodules=modname:..." option is present, filesystem
+ * objects are created and pushed onto the stack with the 'factory'
+ * function.
+ */
 struct fuse_module {
+    /**
+     * Name of filesystem
+     */
     const char *name;
-    struct fuse_fs *(*factory)(struct fuse_args *, struct fuse_fs *[]);
+
+    /**
+     * Factory for creating filesystem objects
+     *
+     * The function may use and remove options from 'args' that belong
+     * to this module.
+     *
+     * For now the 'fs' vector always contains exactly one filesystem.
+     * This is the filesystem which will be below the newly created
+     * filesystem in the stack.
+     *
+     * @param args the command line arguments
+     * @param fs NULL terminated filesystem object vector
+     * @return the new filesystem object
+     */
+    struct fuse_fs *(*factory)(struct fuse_args *args, struct fuse_fs *fs[]);
+
     struct fuse_module *next;
     struct fusemod_so *so;
     int ctr;
 };
 
+/**
+ * Register a filesystem module
+ *
+ * This function is used by FUSE_REGISTER_MODULE and there's usually
+ * no need to call it directly
+ */
 void fuse_register_module(struct fuse_module *mod);
+
+/**
+ * Register filesystem module
+ *
+ * For the parameters, see description of the fields in 'struct
+ * fuse_module'
+ */
 #define FUSE_REGISTER_MODULE(name_, factory_) \
 static __attribute__((constructor)) void name_ ## _register(void) \
 { \
index 66f5fe71482443ef5e6abe15e96b7a148feb663a..ce5d9af26e8bc085da986b8bdfd01cf507d0de7c 100644 (file)
@@ -777,7 +777,6 @@ int fuse_fs_rename(struct fuse_fs *fs, const char *oldpath,
         return -ENOSYS;
 }
 
-
 int fuse_fs_unlink(struct fuse_fs *fs, const char *path)
 {
     fuse_get_context()->private_data = fs->user_data;
index eec020594de30c777bad9e421450e37c928727cd..ca53b663860e7d38fefbaf6770fbb8bac25e9f0c 100644 (file)
@@ -1,5 +1,12 @@
+/*
+    fuse iconv module: file name charset conversion
+    Copyright (C) 2007  Miklos Szeredi <miklos@szeredi.hu>
+
+    This program can be distributed under the terms of the GNU LGPL.
+    See the file COPYING.LIB
+*/
+
 #define FUSE_USE_VERSION 26
-#define _FILE_OFFSET_BITS 64
 
 #include <fuse.h>
 #include <stdio.h>
@@ -36,7 +43,7 @@ static int iconv_convpath(struct iconv *ic, const char *path, char **newpathp,
                           int fromfs)
 {
     size_t pathlen = strlen(path);
-    size_t newpathlen = pathlen; /* FIXME after testing */
+    size_t newpathlen = pathlen * 4;
     char *newpath = malloc(newpathlen + 1);
     size_t plen = newpathlen;
     char *p = newpath;
index eaba99de50ac83e154c9322783012d6a3d2bcad3..8174e34f6d2194cd527a7ac2b0d52b7c7faf7c00 100644 (file)
@@ -1,5 +1,12 @@
+/*
+    fuse subdir module: offset paths with a base directory
+    Copyright (C) 2007  Miklos Szeredi <miklos@szeredi.hu>
+
+    This program can be distributed under the terms of the GNU LGPL.
+    See the file COPYING.LIB
+*/
+
 #define FUSE_USE_VERSION 26
-#define _FILE_OFFSET_BITS 64
 
 #include <fuse.h>
 #include <stdio.h>