fix
authorMiklos Szeredi <miklos@szeredi.hu>
Mon, 8 Nov 2004 17:32:25 +0000 (17:32 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 8 Nov 2004 17:32:25 +0000 (17:32 +0000)
ChangeLog
example/fusexmp.c
example/hello.c
include/fuse.h

index b065e2ad432090a3b9864e91041a38e1f7ceee9e..9eda3cf257922254dbb0aee29beb3f444e53d600 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
 2004-11-08  Miklos Szeredi <miklos@szeredi.hu>
 
-       * Add ino argument to 'fuse_dirfil_t'.  NOTE: this is a backward
-       compatible change (if "use_ino" mount option is not specified),
-       but causes a warning when compiling filesystems not converted to
-       the new type.
+       * Add ino argument to 'fuse_dirfil_t'.  NOTE: This breaks source
+       compatibility with earlier versions.  To compile earier versions
+       just add '-DFUSE_DIRFIL_COMPAT' compile flag or fix the source.
+       Do not use the "use_ino" mount flag with filesystems compiled with
+       FUSE_DIRFIL_COMPAT.
+       
 2004-11-02  Miklos Szeredi <miklos@szeredi.hu>
 
        * Added "use_ino" mount option.  This enables the filesystems to
index 57045be58e80f231a82f3d281a1783eddfd21ca3..02d0363bb4c5155eadf372a76a7d8b6caef7f932 100644 (file)
@@ -49,7 +49,7 @@ static int xmp_readlink(const char *path, char *buf, size_t size)
 }
 
 
-static int xmp_getdir(const char *path, fuse_dirh_t h, fuse_dirfil2_t filler)
+static int xmp_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler)
 {
     DIR *dp;
     struct dirent *de;
index 37020b29380cf82ff0b72e0a68d55c76369d922d..5065fb72ef489af02054b3f7776f4320cb07c25f 100644 (file)
@@ -35,7 +35,7 @@ static int hello_getattr(const char *path, struct stat *stbuf)
     return res;
 }
 
-static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil2_t filler)
+static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler)
 {
     if(strcmp(path, "/") != 0)
         return -ENOENT;
index 8a0fd3ccd386129b2202e7fbb59b58c2722e1a17..a5115ee026409cbca0a446ebd0f86ac0447be742 100644 (file)
@@ -50,11 +50,8 @@ typedef struct fuse_dirhandle *fuse_dirh_t;
  *            not specified
  * @return 0 on success, -errno on error
  */
-typedef int (*fuse_dirfil2_t) (fuse_dirh_t h, const char *name, int type,
-                               ino_t ino);
-
-/** Obsolete version of the above function */
-typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type);
+typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type,
+                              ino_t ino);
 
 /**
  * The file system operations:
@@ -116,7 +113,7 @@ typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type);
 struct fuse_operations {
     int (*getattr)     (const char *, struct stat *);
     int (*readlink)    (const char *, char *, size_t);
-    int (*getdir)      (const char *, fuse_dirh_t, fuse_dirfil2_t);
+    int (*getdir)      (const char *, fuse_dirh_t, fuse_dirfil_t);
     int (*mknod)       (const char *, mode_t, dev_t);
     int (*mkdir)       (const char *, mode_t);
     int (*unlink)      (const char *);
@@ -294,6 +291,16 @@ int __fuse_loop_mt(struct fuse *f, fuse_processor_t proc, void *data);
 int __fuse_exited(struct fuse* f);
 void __fuse_set_getcontext_func(struct fuse_context *(*func)(void));
 
+
+/* ----------------------------------------------------------- *
+ * Compatibility cruft                                         *
+ * ----------------------------------------------------------- */
+
+#ifdef FUSE_DIRFIL_COMPAT
+typedef int (*fuse_dirfil_old_t) (fuse_dirh_t h, const char *name, int type);
+#define fuse_dirfil_t fuse_dirfil_old_t
+#endif
+
 #ifdef __cplusplus
 }
 #endif